Browse Source
Vendored the Path library from reason-native for cross-platform realpathremotes/origin/add-simple-redirecting-site
![ulrik.strid@outlook.com](/assets/img/avatar_default.png)
![Gal Schlezinger](/assets/img/avatar_default.png)
59 changed files with 1645 additions and 3421 deletions
@ -1,36 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/bin_prot" |
|
||||||
bug-reports: "https://github.com/janestreet/bin_prot/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/bin_prot.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_compare" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_custom_printf" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_fields_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_variants_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
] |
|
||||||
depopts: [ |
|
||||||
"mirage-xen-ocaml" |
|
||||||
] |
|
||||||
synopsis: "A binary protocol generator" |
|
||||||
description: """ |
|
||||||
Part of Jane Street's Core library |
|
||||||
The Core suite of libraries is an industrial strength alternative to |
|
||||||
OCaml's standard library that was developed by Jane Street, the |
|
||||||
largest industrial user of OCaml.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/bin_prot-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=64495e0e88fe7cccba6e66b0deaef283" |
|
||||||
} |
|
@ -1,33 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/configurator" |
|
||||||
bug-reports: "https://github.com/janestreet/configurator/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/configurator.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11"} |
|
||||||
"stdio" {>= "v0.11"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
] |
|
||||||
synopsis: "Helper library for gathering system configuration" |
|
||||||
description: """ |
|
||||||
Configurator is a small library that helps writing OCaml scripts that |
|
||||||
test features available on the system, in order to generate config.h |
|
||||||
files for instance. |
|
||||||
|
|
||||||
Configurator allows one to: |
|
||||||
- test if a C program compiles |
|
||||||
- query pkg-config |
|
||||||
- import #define from OCaml header files |
|
||||||
- generate config.h file""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/configurator-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=55511f3ea8e3d66439910b3324701218" |
|
||||||
} |
|
@ -1,35 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/core" |
|
||||||
bug-reports: "https://github.com/janestreet/core/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/core.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"configurator" {>= "v0.11" & < "v0.12"} |
|
||||||
"core_kernel" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_assert" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_jane" {>= "v0.11" & < "v0.12"} |
|
||||||
"sexplib" {>= "v0.11" & < "v0.12"} |
|
||||||
"spawn" {>= "v0.12"} |
|
||||||
"stdio" {>= "v0.11" & < "v0.12"} |
|
||||||
"base-threads" |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Industrial strength alternative to OCaml's standard library" |
|
||||||
description: """ |
|
||||||
The Core suite of libraries is an industrial strength alternative to |
|
||||||
OCaml's standard library that was developed by Jane Street, the |
|
||||||
largest industrial user of OCaml.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://github.com/janestreet/core/releases/download/v0.11.3/core-v0.11.3.tbz" |
|
||||||
checksum: "md5=89ca9e9aa9f1742790efb5016cc5d69b" |
|
||||||
} |
|
@ -1,47 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/core_kernel" |
|
||||||
bug-reports: "https://github.com/janestreet/core_kernel/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/core_kernel.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"bin_prot" {>= "v0.11" & < "v0.12"} |
|
||||||
"configurator" {>= "v0.11" & < "v0.12"} |
|
||||||
"fieldslib" {>= "v0.11" & < "v0.12"} |
|
||||||
"jane-street-headers" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_assert" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_hash" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_inline_test" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_jane" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_message" {>= "v0.11" & < "v0.12"} |
|
||||||
"sexplib" {>= "v0.11" & < "v0.12"} |
|
||||||
"splittable_random" {>= "v0.11" & < "v0.12"} |
|
||||||
"stdio" {>= "v0.11" & < "v0.12"} |
|
||||||
"typerep" {>= "v0.11" & < "v0.12"} |
|
||||||
"variantslib" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
] |
|
||||||
depopts: [ |
|
||||||
"base-native-int63" |
|
||||||
] |
|
||||||
synopsis: "Industrial strength alternative to OCaml's standard library" |
|
||||||
description: """ |
|
||||||
The Core suite of libraries is an industrial strength alternative to |
|
||||||
OCaml's standard library that was developed by Jane Street, the |
|
||||||
largest industrial user of OCaml. |
|
||||||
|
|
||||||
Core_kernel is the system-independent part of Core.""" |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/core_kernel/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=2946775ce7660e026996d55da9c10b83" |
|
||||||
} |
|
@ -1,30 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/fieldslib" |
|
||||||
bug-reports: "https://github.com/janestreet/fieldslib/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/fieldslib.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values" |
|
||||||
description: """ |
|
||||||
Part of Jane Street's Core library |
|
||||||
The Core suite of libraries is an industrial strength alternative to |
|
||||||
OCaml's standard library that was developed by Jane Street, the |
|
||||||
largest industrial user of OCaml.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/fieldslib-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=a42506b460a1dc47fb65a37d875211ae" |
|
||||||
} |
|
@ -0,0 +1,27 @@ |
|||||||
|
opam-version: "2.0" |
||||||
|
maintainer: "opensource@janestreet.com" |
||||||
|
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
||||||
|
homepage: "https://github.com/janestreet/fieldslib" |
||||||
|
bug-reports: "https://github.com/janestreet/fieldslib/issues" |
||||||
|
dev-repo: "git+https://github.com/janestreet/fieldslib.git" |
||||||
|
doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/fieldslib/index.html" |
||||||
|
license: "MIT" |
||||||
|
build: [ |
||||||
|
["dune" "build" "-p" name "-j" jobs] |
||||||
|
] |
||||||
|
depends: [ |
||||||
|
"ocaml" {>= "4.04.2"} |
||||||
|
"base" {>= "v0.12" & < "v0.13"} |
||||||
|
"dune" {build & >= "1.5.1"} |
||||||
|
] |
||||||
|
synopsis: "Syntax extension to define first class values representing record fields, to get and set record fields, iterate and fold over all fields of a record and create new record values" |
||||||
|
description: " |
||||||
|
Part of Jane Street's Core library |
||||||
|
The Core suite of libraries is an industrial strength alternative to |
||||||
|
OCaml's standard library that was developed by Jane Street, the |
||||||
|
largest industrial user of OCaml. |
||||||
|
" |
||||||
|
url { |
||||||
|
src: "https://ocaml.janestreet.com/ocaml-core/v0.12/files/fieldslib-v0.12.0.tar.gz" |
||||||
|
checksum: "md5=7cb44f0fb396b6645fc9965ebb8e6741" |
||||||
|
} |
@ -1,21 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/jane-street-headers" |
|
||||||
bug-reports: "https://github.com/janestreet/jane-street-headers/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/jane-street-headers.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
] |
|
||||||
synopsis: "Jane Street C header files" |
|
||||||
description: "C header files shared between the various Jane Street packages" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/jane-street-headers-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=13299bfe41f66f6a3f42cfaa015f4869" |
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "leo@lpw25.net" |
|
||||||
authors: [ "Leo White <leo@lpw25.net>" ] |
|
||||||
homepage: "https://github.com/ocaml-doc/octavius" |
|
||||||
doc: "http://ocaml-doc.github.io/octavius/" |
|
||||||
license: "ISC" |
|
||||||
dev-repo: "git+http://github.com/ocaml-doc/octavius.git" |
|
||||||
bug-reports: "https://github.com/ocaml-doc/octavius/issues" |
|
||||||
tags: ["doc" "ocamldoc" "org:ocaml-doc"] |
|
||||||
|
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.03.0"} |
|
||||||
"jbuilder" {build & >= "1.0+beta7"} |
|
||||||
] |
|
||||||
build: [ |
|
||||||
["jbuilder" "subst" "-p" name] {pinned} |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
synopsis: "Ocamldoc comment syntax parser" |
|
||||||
description: "Octavius is a library to parse the `ocamldoc` comment syntax." |
|
||||||
url { |
|
||||||
src: "https://github.com/ocaml-doc/octavius/archive/v1.2.1.tar.gz" |
|
||||||
checksum: "md5=fe5f2e1ea8eba9f8c618580a34942bf1" |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_assert" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_assert/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_assert.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_compare" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Assert-like extension nodes that raise useful errors on failure" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_assert-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=0b3aed19391e9a23217a5abf022dfe10" |
|
||||||
} |
|
@ -1,33 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_base" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_base/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_base.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"ppx_compare" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_enumerate" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_hash" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_js_style" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Base set of ppx rewriters" |
|
||||||
description: """ |
|
||||||
ppx_base is the set of ppx rewriters used for Base. |
|
||||||
|
|
||||||
Note that Base doesn't need ppx to build, it is only used as a |
|
||||||
verification tool.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_base-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=a0020fbf308592aa71932bea8135fac5" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_bench" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_bench/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_bench.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"ppx_inline_test" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Syntax extension for writing in-line benchmarks in ocaml code" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_bench-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=a1565e9aa8e341f33e2e3dd712c889c8" |
|
||||||
} |
|
@ -1,26 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_bin_prot" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_bin_prot/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_bin_prot.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"bin_prot" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: "Generation of bin_prot readers and writers from types" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/ppx_bin_prot/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=fae0a476df94eb1dc7fccb293adffe1f" |
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_compare" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_compare/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_compare.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: "Generation of comparison functions from types" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/ppx_compare/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=3df1a90fc90d180b1f96cdd30e64145d" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_custom_printf" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_custom_printf/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_custom_printf.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Printf-style format-strings for user-defined string conversion" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_custom_printf-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=b7cf49585319576dd77f6ddd6db95b21" |
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_enumerate" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_enumerate/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_enumerate.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: "Generate a list containing all values of a finite type" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/ppx_enumerate/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=25107fc78678dc46058aa5d3a7f3ab84" |
|
||||||
} |
|
@ -1,35 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
version: "v0.11.1" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_expect" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_expect/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_expect.git" |
|
||||||
license: "MIT" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_assert" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_compare" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_custom_printf" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_fields_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_inline_test" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_variants_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"stdio" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
"re" {>= "1.5.0"} |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
] |
|
||||||
synopsis: "Cram like framework for OCaml" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://github.com/janestreet/ppx_expect/releases/download/v0.11.1/ppx_expect-v0.11.1.tbz" |
|
||||||
checksum: "md5=ee5e03094674de295aadc10efe6bb7b7" |
|
||||||
} |
|
@ -1,26 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_fail" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_fail/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_fail.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Add location to calls to failwiths" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_fail-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=b153a48e619b819a89924857586e76ac" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_fields_conv" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_fields_conv/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_fields_conv.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"fieldslib" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Generation of accessor and iteration functions for ocaml records" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_fields_conv-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=72f207c23d65f7f3eaabcc92e33ccdab" |
|
||||||
} |
|
@ -0,0 +1,26 @@ |
|||||||
|
opam-version: "2.0" |
||||||
|
maintainer: "opensource@janestreet.com" |
||||||
|
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
||||||
|
homepage: "https://github.com/janestreet/ppx_fields_conv" |
||||||
|
bug-reports: "https://github.com/janestreet/ppx_fields_conv/issues" |
||||||
|
dev-repo: "git+https://github.com/janestreet/ppx_fields_conv.git" |
||||||
|
doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/ppx_fields_conv/index.html" |
||||||
|
license: "MIT" |
||||||
|
build: [ |
||||||
|
["dune" "build" "-p" name "-j" jobs] |
||||||
|
] |
||||||
|
depends: [ |
||||||
|
"ocaml" {>= "4.04.2"} |
||||||
|
"base" {>= "v0.12" & < "v0.13"} |
||||||
|
"fieldslib" {>= "v0.12" & < "v0.13"} |
||||||
|
"dune" {build & >= "1.5.1"} |
||||||
|
"ppxlib" {>= "0.5.0"} |
||||||
|
] |
||||||
|
synopsis: "Generation of accessor and iteration functions for ocaml records" |
||||||
|
description: " |
||||||
|
Part of the Jane Street's PPX rewriters collection. |
||||||
|
" |
||||||
|
url { |
||||||
|
src: "https://ocaml.janestreet.com/ocaml-core/v0.12/files/ppx_fields_conv-v0.12.0.tar.gz" |
||||||
|
checksum: "md5=5bdf701197abc0dd4145a489912e49aa" |
||||||
|
} |
@ -1,27 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_hash" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_hash/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_hash.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_compare" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"A ppx rewriter that generates hash functions from type expressions and definitions" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/ppx_hash/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=48dfe890e195808ccdae0a7261bbb17d" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_here" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_here/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_here.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Expands [%here] into its location" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_here-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=479c9cd5f6ef90c2df9f01eab9d6c91d" |
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_inline_test" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_inline_test/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_inline_test.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Syntax extension for writing in-line tests in ocaml code" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_inline_test-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=1f2e014332373638696d8893d87f4682" |
|
||||||
} |
|
@ -1,44 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_jane" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_jane/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_jane.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"ppx_assert" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_bench" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_bin_prot" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_custom_printf" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_expect" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_fail" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_fields_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_inline_test" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_let" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_optcomp" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_optional" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_pipebang" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_message" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_value" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_typerep_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_variants_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Standard Jane Street ppx rewriters" |
|
||||||
description: """ |
|
||||||
This package installs a ppx-jane executable, which is a ppx driver |
|
||||||
including all standard Jane Street ppx rewriters.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_jane-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=11da0871ae3841fb6710ec6471ce6b92" |
|
||||||
} |
|
@ -1,29 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_js_style" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_js_style/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_js_style.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"octavius" |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Code style checker for Jane Street Packages" |
|
||||||
description: """ |
|
||||||
Part of the Jane Street's PPX rewriters collection. |
|
||||||
|
|
||||||
This packages is a no-op ppx rewriter. It is used as a 'lint' tool to |
|
||||||
enforce some coding conventions across all Jane Street packages.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_js_style-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=0994a7ecf0468f13fcac660413afafad" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_let" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_let/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_let.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Monadic let-bindings" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_let-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=40d1798d7724816c65eb5cdabd20f150" |
|
||||||
} |
|
@ -0,0 +1,25 @@ |
|||||||
|
opam-version: "2.0" |
||||||
|
maintainer: "opensource@janestreet.com" |
||||||
|
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
||||||
|
homepage: "https://github.com/janestreet/ppx_let" |
||||||
|
bug-reports: "https://github.com/janestreet/ppx_let/issues" |
||||||
|
dev-repo: "git+https://github.com/janestreet/ppx_let.git" |
||||||
|
doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/ppx_let/index.html" |
||||||
|
license: "MIT" |
||||||
|
build: [ |
||||||
|
["dune" "build" "-p" name "-j" jobs] |
||||||
|
] |
||||||
|
depends: [ |
||||||
|
"ocaml" {>= "4.04.2"} |
||||||
|
"base" {>= "v0.12" & < "v0.13"} |
||||||
|
"dune" {build & >= "1.5.1"} |
||||||
|
"ppxlib" {>= "0.5.0"} |
||||||
|
] |
||||||
|
synopsis: "Monadic let-bindings" |
||||||
|
description: " |
||||||
|
Part of the Jane Street's PPX rewriters collection. |
||||||
|
" |
||||||
|
url { |
||||||
|
src: "https://ocaml.janestreet.com/ocaml-core/v0.12/files/ppx_let-v0.12.0.tar.gz" |
||||||
|
checksum: "md5=8ebaa03cb252e29c3152cf32e5769e83" |
||||||
|
} |
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_optcomp" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_optcomp/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_optcomp.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"stdio" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Optional compilation for OCaml" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_optcomp-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=396d6bac4ed5652d7be146756613c67e" |
|
||||||
} |
|
@ -1,27 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_optional" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_optional/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_optional.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Pattern matching on flat options" |
|
||||||
description: """ |
|
||||||
A ppx rewriter that rewrites simple match statements with an if then |
|
||||||
else expression.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_optional-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=27bcae8445af584299876bdab0288152" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_pipebang" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_pipebang/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_pipebang.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"A ppx rewriter that inlines reverse application operators `|>` and `|!`" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_pipebang-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=8f41bb8e67167d04b82223d024008683" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_sexp_conv" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_sexp_conv/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_sexp_conv.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"Generation of S-expression conversion functions from type definitions" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: "https://github.com/janestreet/ppx_sexp_conv/archive/v0.11.2.tar.gz" |
|
||||||
checksum: "md5=77d3b30b3d9c5810552bde2027656b8d" |
|
||||||
} |
|
@ -0,0 +1,26 @@ |
|||||||
|
opam-version: "2.0" |
||||||
|
maintainer: "opensource@janestreet.com" |
||||||
|
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
||||||
|
homepage: "https://github.com/janestreet/ppx_sexp_conv" |
||||||
|
bug-reports: "https://github.com/janestreet/ppx_sexp_conv/issues" |
||||||
|
dev-repo: "git+https://github.com/janestreet/ppx_sexp_conv.git" |
||||||
|
doc: "https://ocaml.janestreet.com/ocaml-core/latest/doc/ppx_sexp_conv/index.html" |
||||||
|
license: "MIT" |
||||||
|
build: [ |
||||||
|
["dune" "build" "-p" name "-j" jobs] |
||||||
|
] |
||||||
|
depends: [ |
||||||
|
"ocaml" {>= "4.04.2"} |
||||||
|
"base" {>= "v0.12" & < "v0.13"} |
||||||
|
"sexplib0" {>= "v0.12" & < "v0.13"} |
||||||
|
"dune" {build & >= "1.5.1"} |
||||||
|
"ppxlib" {>= "0.5.0"} |
||||||
|
] |
||||||
|
synopsis: "[@@deriving] plugin to generate S-expression conversion functions" |
||||||
|
description: " |
||||||
|
Part of the Jane Street's PPX rewriters collection. |
||||||
|
" |
||||||
|
url { |
||||||
|
src: "https://ocaml.janestreet.com/ocaml-core/v0.12/files/ppx_sexp_conv-v0.12.0.tar.gz" |
||||||
|
checksum: "md5=648ac430b4a74c2297705d260b66778f" |
||||||
|
} |
@ -1,26 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_sexp_message" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_sexp_message/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_sexp_message.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "A ppx rewriter for easy construction of s-expressions" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_sexp_message-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=2cec96bcf6f7c54ba79fe39fc9fc4d98" |
|
||||||
} |
|
@ -1,27 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_sexp_value" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_sexp_value/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_sexp_value.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_here" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_sexp_conv" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"A ppx rewriter that simplifies building s-expressions from ocaml values" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/ppx_sexp_value-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=28375d3b4bf5cda71b9260d20e5c3d34" |
|
||||||
} |
|
@ -1,25 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_typerep_conv" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_typerep_conv/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_typerep_conv.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"typerep" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: "Generation of runtime types from type declarations" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://github.com/janestreet/ppx_typerep_conv/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=826e9daf00258184e3392c970fa7d616" |
|
||||||
} |
|
@ -1,26 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/ppx_variants_conv" |
|
||||||
bug-reports: "https://github.com/janestreet/ppx_variants_conv/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/ppx_variants_conv.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"variantslib" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.3.0"} |
|
||||||
] |
|
||||||
synopsis: |
|
||||||
"Generation of accessor and iteration functions for ocaml variant types" |
|
||||||
description: "Part of the Jane Street's PPX rewriters collection." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://github.com/janestreet/ppx_variants_conv/archive/v0.11.1.tar.gz" |
|
||||||
checksum: "md5=146b49b84315b7d67c1ca758fcbf2fb2" |
|
||||||
} |
|
@ -1,43 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/spawn" |
|
||||||
bug-reports: "https://github.com/janestreet/spawn/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/spawn.git" |
|
||||||
doc: "https://janestreet.github.io/spawn/" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["dune" "build" "-p" name "-j" jobs] |
|
||||||
# We don't test with OCaml < 4.04 as older versions of ppx_expect |
|
||||||
# don't work with dune |
|
||||||
["dune" "runtest" "-p" name "-j" jobs] {with-test & ocaml >= "4.04" } |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"dune" {build} |
|
||||||
"ppx_expect" {with-test} |
|
||||||
"ocaml" {>= "4.02.3"} |
|
||||||
] |
|
||||||
synopsis: "Spawning sub-processes" |
|
||||||
description: """ |
|
||||||
Spawn is a small library exposing only one functionality: spawning sub-process. |
|
||||||
|
|
||||||
It has three main goals: |
|
||||||
|
|
||||||
1. provide missing features of Unix.create_process such as providing a |
|
||||||
working directory |
|
||||||
|
|
||||||
2. provide better errors when a system call fails in the |
|
||||||
sub-process. For instance if a command is not found, you get a proper |
|
||||||
[Unix.Unix_error] exception |
|
||||||
|
|
||||||
3. improve performances by using vfork when available. It is often |
|
||||||
claimed that nowadays fork is as fast as vfork, however in practice |
|
||||||
fork takes time proportional to the process memory while vfork is |
|
||||||
constant time. In application using a lot of memory, vfork can be |
|
||||||
thousands of times faster than fork. |
|
||||||
""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://github.com/janestreet/spawn/releases/download/v0.13.0/spawn-v0.13.0.tbz" |
|
||||||
checksum: "md5=6eaadbf8f9231415b51658da6b8b090f" |
|
||||||
} |
|
@ -1,32 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/splittable_random" |
|
||||||
bug-reports: "https://github.com/janestreet/splittable_random/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/splittable_random.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"ppx_jane" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
] |
|
||||||
synopsis: "PRNG that can be split into independent streams" |
|
||||||
description: """ |
|
||||||
PRNG that can be split into independent streams |
|
||||||
|
|
||||||
A splittable pseudo-random number generator (SPRNG) functions like a PRNG in that it can |
|
||||||
be used as a stream of random values; it can also be \\"split\\" to produce a second, |
|
||||||
independent stream of random values. |
|
||||||
|
|
||||||
This library implements a splittable pseudo-random number generator that sacrifices |
|
||||||
cryptographic-quality randomness in favor of performance.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/splittable_random-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=9caf5111500c790f44967b6ee648bfe9" |
|
||||||
} |
|
@ -1,22 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/typerep" |
|
||||||
bug-reports: "https://github.com/janestreet/typerep/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/typerep.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
] |
|
||||||
synopsis: "typerep is a library for runtime types." |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/typerep-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=9d7500376ac660c1427137310fabe9da" |
|
||||||
} |
|
@ -1,28 +0,0 @@ |
|||||||
opam-version: "2.0" |
|
||||||
maintainer: "opensource@janestreet.com" |
|
||||||
authors: ["Jane Street Group, LLC <opensource@janestreet.com>"] |
|
||||||
homepage: "https://github.com/janestreet/variantslib" |
|
||||||
bug-reports: "https://github.com/janestreet/variantslib/issues" |
|
||||||
dev-repo: "git+https://github.com/janestreet/variantslib.git" |
|
||||||
license: "Apache-2.0" |
|
||||||
build: [ |
|
||||||
["jbuilder" "build" "-p" name "-j" jobs] |
|
||||||
] |
|
||||||
conflicts: [ "jbuilder" { = "1.0+beta19" } ] |
|
||||||
depends: [ |
|
||||||
"ocaml" {>= "4.04.1"} |
|
||||||
"base" {>= "v0.11" & < "v0.12"} |
|
||||||
"jbuilder" {build & >= "1.0+beta18.1"} |
|
||||||
"ocaml-migrate-parsetree" {>= "1.0"} |
|
||||||
"ppxlib" {>= "0.1.0"} |
|
||||||
] |
|
||||||
synopsis: "Part of Jane Street's Core library" |
|
||||||
description: """ |
|
||||||
The Core suite of libraries is an industrial strength alternative to |
|
||||||
OCaml's standard library that was developed by Jane Street, the |
|
||||||
largest industrial user of OCaml.""" |
|
||||||
url { |
|
||||||
src: |
|
||||||
"https://ocaml.janestreet.com/ocaml-core/v0.11/files/variantslib-v0.11.0.tar.gz" |
|
||||||
checksum: "md5=3031317975df165cc3154578680eddfb" |
|
||||||
} |
|
@ -1,56 +0,0 @@ |
|||||||
--- ./src/exn_stubs.c
|
|
||||||
+++ ./src/exn_stubs.c
|
|
||||||
@@ -1,8 +1,13 @@
|
|
||||||
#include <caml/mlvalues.h>
|
|
||||||
|
|
||||||
extern int caml_backtrace_pos;
|
|
||||||
+#ifndef _MSC_VER
|
|
||||||
+#define UNUSED __attribute__((unused))
|
|
||||||
+#else
|
|
||||||
+#define UNUSED
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
-CAMLprim value Base_clear_caml_backtrace_pos (value __attribute__((unused)) unit) {
|
|
||||||
+CAMLprim value Base_clear_caml_backtrace_pos (value UNUSED unit) {
|
|
||||||
caml_backtrace_pos = 0;
|
|
||||||
return Val_unit;
|
|
||||||
}
|
|
||||||
--- ./src/int_math_stubs.c
|
|
||||||
+++ ./src/int_math_stubs.c
|
|
||||||
@@ -5,6 +5,25 @@
|
|
||||||
#include <caml/mlvalues.h>
|
|
||||||
#include <caml/memory.h>
|
|
||||||
|
|
||||||
+#if defined(_MSC_VER)
|
|
||||||
+#include <intrin.h>
|
|
||||||
+#ifdef ARCH_SIXTYFOUR
|
|
||||||
+#define __builtin_popcountll(x) __popcnt64((uint64_t)(x))
|
|
||||||
+static __inline uint32_t __builtin_clzll(uint64_t value) {
|
|
||||||
+ uint32_t leading_zero = 0;
|
|
||||||
+ _BitScanReverse64(&leading_zero, value);
|
|
||||||
+ return (63 - leading_zero);
|
|
||||||
+}
|
|
||||||
+#else
|
|
||||||
+#define __builtin_popcount(x) __popcnt((unsigned int)(x))
|
|
||||||
+static __inline uint32_t __builtin_clz(uint32_t value) {
|
|
||||||
+ uint32_t leading_zero = 0;
|
|
||||||
+ _BitScanReverse(&leading_zero, value);
|
|
||||||
+ return (31 - leading_zero);
|
|
||||||
+}
|
|
||||||
+#endif /* ARCH_SIXTYFOUR */
|
|
||||||
+#endif /* defined(_MSC_VER) */
|
|
||||||
+
|
|
||||||
static int64_t int_pow(int64_t base, int64_t exponent) {
|
|
||||||
int64_t ret = 1;
|
|
||||||
int64_t mul[4];
|
|
||||||
--- ./src/jbuild
|
|
||||||
+++ ./src/jbuild
|
|
||||||
@@ -65,7 +65,7 @@
|
|
||||||
(progn
|
|
||||||
(with-stdout-to popcnt_test.c
|
|
||||||
(echo "int main(int argc, char ** argv) { return __builtin_popcount(argc); }"))
|
|
||||||
- (system "${CC} -mpopcnt -c popcnt_test.c 2> ${null} && \
|
|
||||||
+ (bash "${CC} -mpopcnt -c popcnt_test.c 2> ${null} && \
|
|
||||||
echo '(-mpopcnt)' > ${@} || echo '()' > ${@}"))))))
|
|
||||||
|
|
||||||
(ocamllex (hex_lexer))
|
|
@ -1,17 +0,0 @@ |
|||||||
{ |
|
||||||
"build": [ |
|
||||||
[ |
|
||||||
"bash", |
|
||||||
"-c", |
|
||||||
"#{os == 'windows' ? 'patch -p1 < base-v0.11.1.patch' : 'true'}" |
|
||||||
], |
|
||||||
[ |
|
||||||
"jbuilder", |
|
||||||
"build", |
|
||||||
"-p", |
|
||||||
"base", |
|
||||||
"-j", |
|
||||||
"4" |
|
||||||
] |
|
||||||
] |
|
||||||
} |
|
@ -0,0 +1,41 @@ |
|||||||
|
--- ./src/dune
|
||||||
|
+++ ./src/dune
|
||||||
|
@@ -30,7 +30,7 @@
|
||||||
|
(with-stdout-to popcnt_test.c
|
||||||
|
(echo
|
||||||
|
"int main(int argc, char ** argv) { return __builtin_popcount(argc); }"))
|
||||||
|
- (system
|
||||||
|
- "%{cc} -mpopcnt -c popcnt_test.c 2> ${null} && echo '(-mpopcnt)' > %{targets} || echo '()' > %{targets}"))))
|
||||||
|
+ (bash
|
||||||
|
+ "%{cc} -mpopcnt -c popcnt_test.c 2> /dev/null && echo '(-mpopcnt)' > %{targets} || echo '()' > %{targets}"))))
|
||||||
|
|
||||||
|
(ocamllex hex_lexer)
|
||||||
|
--- ./src/int_math_stubs.c
|
||||||
|
+++ ./src/int_math_stubs.c
|
||||||
|
@@ -12,17 +12,24 @@
|
||||||
|
#define __builtin_popcountll __popcnt64
|
||||||
|
#define __builtin_popcount __popcnt
|
||||||
|
|
||||||
|
-static uint32_t __inline __builtin_clz(uint32_t x)
|
||||||
|
+static int __inline __builtin_clz(uint32_t x)
|
||||||
|
{
|
||||||
|
int r = 0;
|
||||||
|
_BitScanForward(&r, x);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
-static uint64_t __inline __builtin_clzll(uint64_t x)
|
||||||
|
+static int __inline __builtin_clzll(uint64_t x)
|
||||||
|
{
|
||||||
|
int r = 0;
|
||||||
|
+#ifdef _WIN64
|
||||||
|
_BitScanForward64(&r, x);
|
||||||
|
+#else
|
||||||
|
+ if (!_BitScanForward(&r, (uint32_t)x) &&
|
||||||
|
+ _BitScanForward(&r, (uint32_t)(x>>32))) {
|
||||||
|
+ r += 32;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@ |
|||||||
|
{ |
||||||
|
"build": [ |
||||||
|
[ |
||||||
|
"bash", |
||||||
|
"-c", |
||||||
|
"#{os == 'windows' ? 'patch -p1 < base-v0.12.0.patch' : 'true'}" |
||||||
|
], |
||||||
|
[ |
||||||
|
"jbuilder", |
||||||
|
"build", |
||||||
|
"-p", |
||||||
|
"base", |
||||||
|
"-j", |
||||||
|
"4" |
||||||
|
] |
||||||
|
] |
||||||
|
} |
||||||
|
|
@ -1,201 +0,0 @@ |
|||||||
--- ./config/detect.sh
|
|
||||||
+++ ./config/detect.sh
|
|
||||||
@@ -4,14 +4,27 @@
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
-if ld -lm -shared --wrap caml_modify -o /dev/null 2>/dev/null; then
|
|
||||||
+
|
|
||||||
+system="$( ocamlfind ocamlc -config | awk '/^system:/ {print $2}')"
|
|
||||||
+case "$system" in
|
|
||||||
+ win*)
|
|
||||||
+ ld_wrap_possible=false
|
|
||||||
+ posix_timers_possible=false
|
|
||||||
+ ;;
|
|
||||||
+ mingw*)
|
|
||||||
+ ld_wrap_possible=false
|
|
||||||
+ posix_timers_possible=false
|
|
||||||
+ ;;
|
|
||||||
+ *)
|
|
||||||
+
|
|
||||||
+ if ld -lm -shared --wrap caml_modify -o /dev/null 2>/dev/null; then
|
|
||||||
ld_wrap_possible=true
|
|
||||||
-else
|
|
||||||
+ else
|
|
||||||
ld_wrap_possible=false
|
|
||||||
-fi
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
-ptimer=`getconf _POSIX_TIMERS || echo undefined`
|
|
||||||
-case $ptimer in
|
|
||||||
+ ptimer=`getconf _POSIX_TIMERS || echo undefined`
|
|
||||||
+ case $ptimer in
|
|
||||||
undefined)
|
|
||||||
posix_timers_possible=false
|
|
||||||
;;
|
|
||||||
@@ -22,6 +35,8 @@
|
|
||||||
posix_timers_possible=false
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
+ esac
|
|
||||||
+ ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -e setup.data ]; then
|
|
||||||
--- ./src/bigstring_marshal_stubs.c
|
|
||||||
+++ ./src/bigstring_marshal_stubs.c
|
|
||||||
@@ -1,5 +1,7 @@
|
|
||||||
#include <string.h>
|
|
||||||
+#ifndef _MSC_VER
|
|
||||||
#include <unistd.h>
|
|
||||||
+#endif
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#include <caml/alloc.h>
|
|
||||||
--- ./src/bigstring_stubs.c
|
|
||||||
+++ ./src/bigstring_stubs.c
|
|
||||||
@@ -11,16 +11,37 @@
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
+#ifndef _MSC_VER
|
|
||||||
#include <unistd.h>
|
|
||||||
+#include <stdint.h>
|
|
||||||
+#else
|
|
||||||
+#include <stdlib.h>
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#include <errno.h>
|
|
||||||
#include <assert.h>
|
|
||||||
-#include <stdint.h>
|
|
||||||
+
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
|
||||||
#include <libkern/OSByteOrder.h>
|
|
||||||
#define bswap_16 OSSwapInt16
|
|
||||||
#define bswap_32 OSSwapInt32
|
|
||||||
#define bswap_64 OSSwapInt64
|
|
||||||
+#elif __MINGW32__
|
|
||||||
+#if defined(__GNUC__) && __GNUC__ > 4
|
|
||||||
+#define bswap_16 __builtin_bswap16
|
|
||||||
+#else
|
|
||||||
+static inline uint16_t bswap_16 (uint16_t x)
|
|
||||||
+{
|
|
||||||
+ return (x << 8) | (x >> 8);
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+#define bswap_32 __builtin_bswap32
|
|
||||||
+#define bswap_64 __builtin_bswap64
|
|
||||||
+#elif _MSC_VER
|
|
||||||
+#define bswap_16 _byteswap_ushort
|
|
||||||
+#define bswap_32 _byteswap_ulong
|
|
||||||
+#define bswap_64 _byteswap_uint64
|
|
||||||
#elif __GLIBC__
|
|
||||||
#include <byteswap.h>
|
|
||||||
#include <malloc.h>
|
|
||||||
--- ./src/time_ns_stubs.c
|
|
||||||
+++ ./src/time_ns_stubs.c
|
|
||||||
@@ -12,7 +12,9 @@
|
|
||||||
#include <caml/unixsupport.h>
|
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
+#ifndef _MSC_VER
|
|
||||||
#include <stdint.h>
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#include "ocaml_utils.h"
|
|
||||||
#include "config.h"
|
|
||||||
@@ -22,7 +24,59 @@
|
|
||||||
#define NANOS_PER_SECOND 1000000000
|
|
||||||
|
|
||||||
#if defined(JSC_POSIX_TIMERS)
|
|
||||||
+#ifdef _WIN32
|
|
||||||
+#include <windows.h>
|
|
||||||
|
|
||||||
+#ifndef CLOCK_REALTIME
|
|
||||||
+#define CLOCK_REALTIME 1
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+#define POW10_7 10000000
|
|
||||||
+#define DELTA_EPOCH_IN_100NS INT64_C(116444736000000000)
|
|
||||||
+
|
|
||||||
+typedef void (WINAPI *GetSystemTimeAsFileTime_t)(LPFILETIME lpSystemTimeAsFileTime);
|
|
||||||
+static GetSystemTimeAsFileTime_t i_GetSystemTimeAsFileTime = GetSystemTimeAsFileTime;
|
|
||||||
+static int clock_gettime_init_called = 0;
|
|
||||||
+
|
|
||||||
+static void clock_gettime_init(void) {
|
|
||||||
+ /* Use GetSystemTimePreciseAsFileTime when available */
|
|
||||||
+ HMODULE h ;
|
|
||||||
+ clock_gettime_init_called = 1;
|
|
||||||
+ h = LoadLibrary("kernel32.dll");
|
|
||||||
+ if (h != NULL) {
|
|
||||||
+ GetSystemTimeAsFileTime_t proc = (GetSystemTimeAsFileTime_t)GetProcAddress(h, "GetSystemTimePreciseAsFileTime");
|
|
||||||
+ if (proc != NULL) {
|
|
||||||
+ i_GetSystemTimeAsFileTime = proc;
|
|
||||||
+ }
|
|
||||||
+ else {
|
|
||||||
+ FreeLibrary(h);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#define clock_gettime my_clock_gettime
|
|
||||||
+static int my_clock_gettime(int clock_id, struct timespec *tp)
|
|
||||||
+{
|
|
||||||
+ uint64_t t;
|
|
||||||
+ FILETIME ft;
|
|
||||||
+ ULARGE_INTEGER lft;
|
|
||||||
+ (void) clock_id;
|
|
||||||
+ if ( clock_gettime_init_called == 0 ){
|
|
||||||
+ clock_gettime_init();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ i_GetSystemTimeAsFileTime(&ft);
|
|
||||||
+
|
|
||||||
+ lft.LowPart = ft.dwLowDateTime;
|
|
||||||
+ lft.HighPart = ft.dwHighDateTime;
|
|
||||||
+
|
|
||||||
+ t = lft.QuadPart - DELTA_EPOCH_IN_100NS;
|
|
||||||
+ tp->tv_sec = t / POW10_7;
|
|
||||||
+ tp->tv_nsec = ((int) (t % POW10_7)) * 100;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+#endif /* _WIN32 */
|
|
||||||
/* Note: this is imported noalloc if (and only if) ARCH_SIXTYFOUR is defined.
|
|
||||||
* This is OK because caml_alloc_int63 doesn't actually allocate in that case. */
|
|
||||||
CAMLprim value core_kernel_time_ns_gettime_or_zero()
|
|
||||||
@@ -38,7 +92,33 @@
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
+#ifndef _MSC_VER
|
|
||||||
#include <sys/time.h>
|
|
||||||
+#endif
|
|
||||||
+#ifdef _MSC_VER
|
|
||||||
+#include <time.h>
|
|
||||||
+
|
|
||||||
+#define DELTA_EPOCH_IN_MICROSECS 116444736000000000Ui64
|
|
||||||
+
|
|
||||||
+static int gettimeofday(struct timeval *tp, void *tz)
|
|
||||||
+{
|
|
||||||
+ FILETIME file_time;
|
|
||||||
+ SYSTEMTIME system_time;
|
|
||||||
+ ULARGE_INTEGER ularge;
|
|
||||||
+ (void)tz;
|
|
||||||
+
|
|
||||||
+ GetSystemTime(&system_time);
|
|
||||||
+ SystemTimeToFileTime(&system_time, &file_time);
|
|
||||||
+ ularge.LowPart = file_time.dwLowDateTime;
|
|
||||||
+ ularge.HighPart = file_time.dwHighDateTime;
|
|
||||||
+
|
|
||||||
+ tp->tv_sec = (long) ((ularge.QuadPart - DELTA_EPOCH_IN_MICROSECS) / 10000000L);
|
|
||||||
+ tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
CAMLprim value core_kernel_time_ns_gettime_or_zero()
|
|
||||||
{
|
|
@ -1,17 +0,0 @@ |
|||||||
{ |
|
||||||
"build": [ |
|
||||||
[ |
|
||||||
"bash", |
|
||||||
"-c", |
|
||||||
"#{os == 'windows' ? 'patch -p1 < core_kernel-0.11.1.patch' : 'true'}" |
|
||||||
], |
|
||||||
[ |
|
||||||
"jbuilder", |
|
||||||
"build", |
|
||||||
"-p", |
|
||||||
"core_kernel", |
|
||||||
"-j", |
|
||||||
"4" |
|
||||||
] |
|
||||||
] |
|
||||||
} |
|
@ -0,0 +1,503 @@ |
|||||||
|
/** |
||||||
|
* Copyright 2004-present Facebook. All Rights Reserved. |
||||||
|
* |
||||||
|
* @emails oncall+ads_front_end_infra |
||||||
|
*/; |
||||||
|
|
||||||
|
let sep = "/"; |
||||||
|
let homeChar = "~"; |
||||||
|
|
||||||
|
type absolute; |
||||||
|
type relative; |
||||||
|
type upDirs = int; /* int 0 implies ./ and 1 implies ../ etc */ |
||||||
|
|
||||||
|
/** |
||||||
|
* We might eventually want to allow extending this with many |
||||||
|
* reference points. |
||||||
|
*/ |
||||||
|
type relFrom = |
||||||
|
| Home |
||||||
|
| Any; |
||||||
|
type base('kind) = |
||||||
|
/* Optional drive name */ |
||||||
|
| Abs(option(string)): base(absolute) |
||||||
|
| Rel(relFrom, upDirs): base(relative); |
||||||
|
/** |
||||||
|
* Internal representation of paths. The list of strings represents all |
||||||
|
* subdirectories after the base (in reverse order - head of the list is the |
||||||
|
* rightmost segment of the path). |
||||||
|
*/ |
||||||
|
type t('kind) = (base('kind), list(string)); |
||||||
|
type firstClass = |
||||||
|
| Absolute(t(absolute)) |
||||||
|
| Relative(t(relative)); |
||||||
|
type opaqueBase = |
||||||
|
| Base(base('exists)): opaqueBase; |
||||||
|
type opaqueT = (opaqueBase, list(string)); |
||||||
|
|
||||||
|
let drive = name => (Abs(Some(name)), []); |
||||||
|
let root = (Abs(None), []); |
||||||
|
let home = (Rel(Home, 0), []); |
||||||
|
let dot = (Rel(Any, 0), []); |
||||||
|
|
||||||
|
let hasParentDir = ((Abs(_), lst): t(absolute)) => lst !== []; |
||||||
|
|
||||||
|
let rec revSegmentsAreInside = (~ofSegments, l) => |
||||||
|
switch (ofSegments, l) { |
||||||
|
| ([], [_, ..._]) => true |
||||||
|
| ([], []) => true |
||||||
|
| ([_, ..._], []) => false |
||||||
|
| ([hd, ...tl], [hd2, ...tl2]) => |
||||||
|
String.equal(hd, hd2) && revSegmentsAreInside(~ofSegments=tl, tl2) |
||||||
|
}; |
||||||
|
|
||||||
|
let segmentsAreInside = (~ofSegments, l) => |
||||||
|
revSegmentsAreInside(~ofSegments=List.rev(ofSegments), List.rev(l)); |
||||||
|
|
||||||
|
let isDescendent: type kind. (~ofPath: t(kind), t(kind)) => bool = |
||||||
|
(~ofPath, p) => |
||||||
|
switch (ofPath, p) { |
||||||
|
| ((Abs(dr1), l1), (Abs(dr2), l2)) => |
||||||
|
switch (dr1, dr2) { |
||||||
|
| (None, None) => segmentsAreInside(~ofSegments=l1, l2) |
||||||
|
| (Some(d1), Some(d2)) => |
||||||
|
String.equal(d1, d2) && segmentsAreInside(~ofSegments=l1, l2) |
||||||
|
| (Some(_), None) |
||||||
|
| (None, Some(_)) => false |
||||||
|
} |
||||||
|
| ((Rel(Any, d1), l1), (Rel(Any, d2), l2)) => |
||||||
|
d1 === d1 && segmentsAreInside(~ofSegments=l1, l2) |
||||||
|
| ((Rel(Home, d1), l1), (Rel(Home, d2), l2)) => |
||||||
|
d1 === d1 && segmentsAreInside(~ofSegments=l1, l2) |
||||||
|
| ((Rel(Any, _), _), (Rel(Home, _), _)) => false |
||||||
|
| ((Rel(Home, _), _), (Rel(Any, _), _)) => false |
||||||
|
}; |
||||||
|
|
||||||
|
let toString: type kind. t(kind) => string = |
||||||
|
path => |
||||||
|
switch (path) { |
||||||
|
| (Abs(l), lst) => |
||||||
|
let lbl = |
||||||
|
switch (l) { |
||||||
|
| None => "" |
||||||
|
| Some(txt) => txt |
||||||
|
}; |
||||||
|
lbl ++ "/" ++ (lst |> List.rev |> String.concat(sep)); |
||||||
|
| (Rel(w, i), lst) => |
||||||
|
let init = |
||||||
|
switch (w) { |
||||||
|
| Any => "." ++ sep |
||||||
|
| Home => "~" ++ sep |
||||||
|
}; |
||||||
|
let rest = |
||||||
|
lst |
||||||
|
|> List.rev |
||||||
|
|> List.append(Array.to_list(Array.init(i, i => ".."))) |
||||||
|
|> String.concat(sep); |
||||||
|
init ++ rest; |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* Expose this under the name `toDebugString` and accept any kind of path. |
||||||
|
* The name is to warn people about using this for relative paths. This may |
||||||
|
* print paths like `"."` and `"~"`, which is not very meaningful. |
||||||
|
*/ |
||||||
|
let toDebugString = toString; |
||||||
|
|
||||||
|
type token = |
||||||
|
| SLASH |
||||||
|
| DOT |
||||||
|
| TILDE |
||||||
|
| DOTDOT |
||||||
|
| DRIVE(string) |
||||||
|
| TXT(string); |
||||||
|
|
||||||
|
let makeToken = s => |
||||||
|
switch (s) { |
||||||
|
| "~" => TILDE |
||||||
|
| "." => DOT |
||||||
|
| ".." => DOTDOT |
||||||
|
| s when String.length(s) >= 2 && s.[String.length(s) - 1] === ':' => |
||||||
|
DRIVE(s) |
||||||
|
| s => TXT(s) |
||||||
|
}; |
||||||
|
/* |
||||||
|
* Splits on slashes, but being intelligent about escaped slashes. |
||||||
|
*/ |
||||||
|
let lex = s => { |
||||||
|
let s = String.trim(s); |
||||||
|
let len = String.length(s); |
||||||
|
let revTokens = {contents: []}; |
||||||
|
/* j is what you are all caught up to */ |
||||||
|
let j = {contents: (-1)}; |
||||||
|
let prevEsc = {contents: false}; |
||||||
|
for (i in 0 to len - 1) { |
||||||
|
let ch = String.unsafe_get(s, i); |
||||||
|
if (ch === '/' && !prevEsc.contents) { |
||||||
|
if (j.contents !== i - 1) { |
||||||
|
let tok = |
||||||
|
makeToken(String.sub(s, j.contents + 1, i - j.contents - 1)); |
||||||
|
revTokens.contents = [tok, ...revTokens.contents]; |
||||||
|
}; |
||||||
|
revTokens.contents = [SLASH, ...revTokens.contents]; |
||||||
|
j.contents = i; |
||||||
|
}; |
||||||
|
prevEsc.contents = ch === '\\' && !prevEsc.contents; |
||||||
|
}; |
||||||
|
let rev = |
||||||
|
j.contents === len - 1 |
||||||
|
? revTokens.contents |
||||||
|
: [ |
||||||
|
makeToken(String.sub(s, j.contents + 1, len - 1 - j.contents)), |
||||||
|
...revTokens.contents, |
||||||
|
]; |
||||||
|
List.rev(rev); |
||||||
|
}; |
||||||
|
|
||||||
|
let parseFirstToken = token => |
||||||
|
switch (token) { |
||||||
|
| SLASH => (Base(Abs(None)), []) |
||||||
|
| DOT => (Base(Rel(Any, 0)), []) |
||||||
|
| TILDE => (Base(Rel(Home, 0)), []) |
||||||
|
| DOTDOT => (Base(Rel(Any, 1)), []) |
||||||
|
| DRIVE(l) => (Base(Abs(Some(l))), []) |
||||||
|
| TXT(s) => (Base(Rel(Any, 0)), [s]) |
||||||
|
}; |
||||||
|
|
||||||
|
let rec parseNextToken: type kind. (t(kind), token) => t(kind) = |
||||||
|
(path, nextToken) => |
||||||
|
switch (path, nextToken) { |
||||||
|
| (path, SLASH) => path |
||||||
|
| (path, DOT) => path |
||||||
|
| ((base, subs), TILDE) => (base, [homeChar, ...subs]) |
||||||
|
| ((base, subs), DRIVE(l)) => (base, [l, ...subs]) |
||||||
|
| ((base, subs), TXT(s)) => (base, [s, ...subs]) |
||||||
|
| ((base, [hd, ...tl]), DOTDOT) => (base, tl) |
||||||
|
| ((Rel(Any, r), []), DOTDOT) => (Rel(Any, r + 1), []) |
||||||
|
| ((Rel(Home, r), []), DOTDOT) => (Rel(Home, r + 1), []) |
||||||
|
| ((Abs(_), []), DOTDOT) => path |
||||||
|
}; |
||||||
|
|
||||||
|
let parseFirstTokenAbsolute = token => |
||||||
|
switch (token) { |
||||||
|
| SLASH => Some((Abs(None), [])) |
||||||
|
| DRIVE(l) => Some((Abs(Some(l)), [])) |
||||||
|
| TXT(_) |
||||||
|
| DOT |
||||||
|
| TILDE |
||||||
|
| DOTDOT => None |
||||||
|
}; |
||||||
|
|
||||||
|
let parseFirstTokenRelative = token => |
||||||
|
switch (token) { |
||||||
|
| DOT => Some((Rel(Any, 0), [])) |
||||||
|
| TILDE => Some((Rel(Home, 0), [])) |
||||||
|
| DOTDOT => Some((Rel(Any, 1), [])) |
||||||
|
| TXT(s) => Some((Rel(Any, 0), [s])) |
||||||
|
| SLASH => None |
||||||
|
| DRIVE(l) => None |
||||||
|
}; |
||||||
|
|
||||||
|
let absolute = s => |
||||||
|
switch (lex(s)) { |
||||||
|
/* Cannot pass empty string for absolute path */ |
||||||
|
| [] => None |
||||||
|
| [hd, ...tl] => |
||||||
|
switch (parseFirstTokenAbsolute(hd)) { |
||||||
|
| None => None |
||||||
|
| Some(initAbsPath) => |
||||||
|
Some(List.fold_left(parseNextToken, initAbsPath, tl)) |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
let absoluteExn = s => |
||||||
|
switch (lex(s)) { |
||||||
|
/* Cannot pass empty string for absolute path */ |
||||||
|
| [] => raise(Invalid_argument("Empty path is not a valid absolute path.")) |
||||||
|
| [hd, ...tl] => |
||||||
|
switch (parseFirstTokenAbsolute(hd)) { |
||||||
|
| None => |
||||||
|
raise( |
||||||
|
Invalid_argument("First token in path " ++ s ++ " is not absolute."), |
||||||
|
) |
||||||
|
| Some(initAbsPath) => List.fold_left(parseNextToken, initAbsPath, tl) |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
let relative = s => { |
||||||
|
let (tok, tl) = |
||||||
|
switch (lex(s)) { |
||||||
|
| [] => (DOT, []) |
||||||
|
| [hd, ...tl] => (hd, tl) |
||||||
|
}; |
||||||
|
switch (parseFirstTokenRelative(tok)) { |
||||||
|
| None => None |
||||||
|
| Some(initRelPath) => |
||||||
|
Some(List.fold_left(parseNextToken, initRelPath, tl)) |
||||||
|
}; |
||||||
|
}; |
||||||
|
|
||||||
|
let relativeExn = s => |
||||||
|
switch (lex(s)) { |
||||||
|
/* Cannot pass empty string for absolute path */ |
||||||
|
| [] => dot |
||||||
|
| [hd, ...tl] => |
||||||
|
switch (parseFirstTokenRelative(hd)) { |
||||||
|
| None => |
||||||
|
raise( |
||||||
|
Invalid_argument("First token in path " ++ s ++ " not relative."), |
||||||
|
) |
||||||
|
| Some(initRelPath) => List.fold_left(parseNextToken, initRelPath, tl) |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
/** |
||||||
|
* Relates two positive integers to zero and eachother. |
||||||
|
*/ |
||||||
|
type ord = |
||||||
|
| /** 0 === i === j */ |
||||||
|
Zeros |
||||||
|
| /** 0 === i < j */ |
||||||
|
ZeroPositive |
||||||
|
| /** i > 0 === j */ |
||||||
|
PositiveZero |
||||||
|
| /** 0 < i && 0 < j */ |
||||||
|
Positives; |
||||||
|
|
||||||
|
/** |
||||||
|
* Using `ord` allows us to retain exhaustiveness pattern matching checks that |
||||||
|
* would normally be lost when adding `when i < j` guards to matches. It's |
||||||
|
* very likely inlined so there's no performance hit. Annotate as int so that |
||||||
|
* it isn't inferred to be polymorphic. |
||||||
|
*/ |
||||||
|
let ord = (i: int, j: int) => |
||||||
|
i === 0 && j === 0 |
||||||
|
? Zeros : i === 0 ? ZeroPositive : j === 0 ? PositiveZero : Positives; |
||||||
|
|
||||||
|
let rec repeat = (soFar, i, s) => |
||||||
|
i === 0 ? soFar : repeat(soFar ++ s, i - 1, s); |
||||||
|
|
||||||
|
/* |
||||||
|
* relativize(a/rest1..., a/rest2...) == relativize(rest1..., rest2...) |
||||||
|
* relativize(../rest1..., ../rest2...) == relativize(rest1..., res2...) |
||||||
|
* relativize(a/rest1..., b/rest2...) == [...len(1)]/b/rest2 |
||||||
|
* relativize(../a/rest1..., b/rest2...) == raise |
||||||
|
* relativize(a/rest1..., ../b/rest2...) == [...len(1)]../b/rest2 |
||||||
|
* |
||||||
|
* "upDirs" is the number of ../ the path is assumed to have. The segments |
||||||
|
* `s1`/`s2`, are in the path order from left to right, unlike `Path.t` which |
||||||
|
* usually stores them in reverse order. Relativizing paths is one place where |
||||||
|
* it's more convenient to have them in the left to right segment order. |
||||||
|
*/ |
||||||
|
let rec relativizeDepth = ((upDirs1, s1), (upDirs2, s2)) => |
||||||
|
switch (ord(upDirs1, upDirs2), s1, s2) { |
||||||
|
| (Zeros, [hd1, ...tl1], [hd2, ...tl2]) => |
||||||
|
if (String.compare(hd1, hd2) === 0) { |
||||||
|
relativizeDepth((0, tl1), (0, tl2)); |
||||||
|
} else { |
||||||
|
(List.length(s1), s2); |
||||||
|
} |
||||||
|
| (Zeros, [], []) => (0, []) |
||||||
|
| (Zeros, [], [hd2, ...tl2] as s2) => (upDirs2, s2) |
||||||
|
| (Zeros, [hd1, ...tl1] as s1, []) => (List.length(s1), []) |
||||||
|
| (Positives, _, _) => |
||||||
|
relativizeDepth((upDirs1 - 1, s1), (upDirs2 - 1, s2)) |
||||||
|
| (ZeroPositive, _, _) => (List.length(s1) + upDirs2, s2) |
||||||
|
| (PositiveZero, _, _) => |
||||||
|
raise( |
||||||
|
Invalid_argument( |
||||||
|
"Cannot relativize paths source='" |
||||||
|
++ repeat("", upDirs1, "../") |
||||||
|
++ String.concat(sep, s1) |
||||||
|
++ "' dest='" |
||||||
|
++ repeat("", upDirs2, "../") |
||||||
|
++ String.concat(sep, s2), |
||||||
|
), |
||||||
|
) |
||||||
|
}; |
||||||
|
|
||||||
|
let raiseDriveMismatch = (p1, p2) => |
||||||
|
raise( |
||||||
|
Invalid_argument( |
||||||
|
"Cannot relativize paths with different drives or relative roots " |
||||||
|
++ toString(p1) |
||||||
|
++ " and " |
||||||
|
++ toString(p2), |
||||||
|
), |
||||||
|
); |
||||||
|
|
||||||
|
let relativizeExn: type k. (~source: t(k), ~dest: t(k)) => t(relative) = |
||||||
|
(~source, ~dest) => { |
||||||
|
let (depth, segs) = |
||||||
|
switch (source, dest) { |
||||||
|
| ((Abs(d1), s1), (Abs(d2), s2)) => |
||||||
|
switch (d1, d2) { |
||||||
|
| (None, None) => |
||||||
|
relativizeDepth((0, List.rev(s1)), (0, List.rev(s2))) |
||||||
|
| (Some(_), None) => raiseDriveMismatch(source, dest) |
||||||
|
| (None, Some(_)) => raiseDriveMismatch(source, dest) |
||||||
|
| (Some(d1), Some(d2)) => |
||||||
|
String.compare(d1, d2) !== 0 |
||||||
|
? raiseDriveMismatch(source, dest) |
||||||
|
: relativizeDepth((0, List.rev(s1)), (0, List.rev(s2))) |
||||||
|
} |
||||||
|
| ((Rel(w1, r1), s1), (Rel(w2, r2), s2)) => |
||||||
|
w1 === w2 |
||||||
|
? relativizeDepth((r1, List.rev(s1)), (r2, List.rev(s2))) |
||||||
|
: raiseDriveMismatch(source, dest) |
||||||
|
}; |
||||||
|
(Rel(Any, depth), List.rev(segs)); |
||||||
|
}; |
||||||
|
|
||||||
|
let relativize: |
||||||
|
type k. (~source: t(k), ~dest: t(k)) => result(t(relative), exn) = |
||||||
|
(~source, ~dest) => |
||||||
|
try (Ok(relativizeExn(~source, ~dest))) { |
||||||
|
| Invalid_argument(_) as e => Error(e) |
||||||
|
}; |
||||||
|
|
||||||
|
let rec segEq = (l1, l2) => |
||||||
|
switch (l1, l2) { |
||||||
|
| ([], []) => true |
||||||
|
| ([], [_, ..._]) => false |
||||||
|
| ([_, ..._], []) => false |
||||||
|
| ([hd1, ...tl1], [hd2, ...tl2]) => |
||||||
|
String.compare(hd1, hd2) === 0 && segEq(tl1, tl2) |
||||||
|
}; |
||||||
|
|
||||||
|
let eq: type k1 k2. (t(k1), t(k2)) => bool = |
||||||
|
(p1, p2) => |
||||||
|
switch (p1, p2) { |
||||||
|
| ((Abs(_), s1), (Rel(_), s2)) => false |
||||||
|
| ((Rel(_), s1), (Abs(_), s2)) => false |
||||||
|
| ((Abs(d1), s1), (Abs(d2), s2)) => |
||||||
|
switch (d1, d2) { |
||||||
|
| (Some(_), None) |
||||||
|
| (None, Some(_)) => false |
||||||
|
| (None, None) => segEq(s1, s2) |
||||||
|
| (Some(d1), Some(d2)) => |
||||||
|
String.compare(d1, d2) === 0 && segEq(s1, s2) |
||||||
|
} |
||||||
|
| ((Rel(w1, r1), s1), (Rel(w2, r2), s2)) => |
||||||
|
w1 === w2 && r1 === r2 && segEq(s1, s2) |
||||||
|
}; |
||||||
|
|
||||||
|
let absoluteEq = eq; |
||||||
|
|
||||||
|
let relativeEq = eq; |
||||||
|
|
||||||
|
let testForPath = s => |
||||||
|
switch (absolute(s)) { |
||||||
|
| Some(abs) => Some(Absolute(abs)) |
||||||
|
| None => |
||||||
|
switch (relative(s)) { |
||||||
|
| Some(r) => Some(Relative(r)) |
||||||
|
| None => None |
||||||
|
} |
||||||
|
}; |
||||||
|
|
||||||
|
let firstClass: type k. t(k) => firstClass = |
||||||
|
p => |
||||||
|
switch (p) { |
||||||
|
| (Abs(d), s) => Absolute((Abs(d), s)) |
||||||
|
| (Rel(w, r), s) => Relative((Rel(w, r), s)) |
||||||
|
}; |
||||||
|
|
||||||
|
let testForPathExn = s => |
||||||
|
switch (testForPath(s)) { |
||||||
|
| Some(res) => res |
||||||
|
| None => raise(Invalid_argument("Path neither absolute nor relative.")) |
||||||
|
}; |
||||||
|
|
||||||
|
let continue = (s, path) => List.fold_left(parseNextToken, path, lex(s)); |
||||||
|
|
||||||
|
let rec join: type k1 k2. (t(k1), t(k2)) => t(k1) = |
||||||
|
(p1, p2) => |
||||||
|
switch (p1, p2) { |
||||||
|
| ((Rel(w, r1), []), (Rel(Any, r2), s2)) => (Rel(w, r1 + r2), s2) |
||||||
|
| ((Rel(w, r1), [s1hd, ...s1tl] as s1), (Rel(Any, r2), s2)) => |
||||||
|
r2 > 0 |
||||||
|
? join((Rel(w, r1), s1tl), (Rel(Any, r2 - 1), s2)) |
||||||
|
: (Rel(w, r1), List.append(s2, s1)) |
||||||
|
| ((b1, s1), (Rel(Home, r2), s2)) => |
||||||
|
join((b1, [homeChar, ...List.append(s2, s1)]), (Rel(Any, r2), s2)) |
||||||
|
| ((b1, s1), (Abs(Some(ll)), s2)) => ( |
||||||
|
b1, |
||||||
|
[ll, ...List.append(s2, s1)], |
||||||
|
) |
||||||
|
| ((b1, s1), (Abs(None), s2)) => (b1, List.append(s2, s1)) |
||||||
|
| ((Abs(_) as d, []), (Rel(Any, r2), s2)) => (d, s2) |
||||||
|
| ((Abs(_) as d, [s1hd, ...s1tl] as s1), (Rel(Any, r2), s2)) => |
||||||
|
r2 > 0 |
||||||
|
? join((d, s1tl), (Rel(Any, r2 - 1), s2)) |
||||||
|
: (d, List.append(s2, s1)) |
||||||
|
}; |
||||||
|
|
||||||
|
let rec dirName: type k1. t(k1) => t(k1) = |
||||||
|
p1 => |
||||||
|
switch (p1) { |
||||||
|
| (Rel(w, r1), []) => (Rel(w, r1 + 1), []) |
||||||
|
| (Rel(w, r1), [s1hd, ...s1tl]) => (Rel(w, r1), s1tl) |
||||||
|
| (Abs(_) as d, []) => (d, []) |
||||||
|
| (Abs(_) as d, [s1hd, ...s1tl]) => (d, s1tl) |
||||||
|
}; |
||||||
|
|
||||||
|
let rec baseName: type k1. t(k1) => option(string) = |
||||||
|
p1 => |
||||||
|
switch (p1) { |
||||||
|
| (Rel(w, r1), []) => None |
||||||
|
| (Rel(w, r1), [s1hd, ...s1tl]) => Some(s1hd) |
||||||
|
| (Abs(_), []) => None |
||||||
|
| (Abs(_), [s1hd, ...s1tl]) => Some(s1hd) |
||||||
|
}; |
||||||
|
|
||||||
|
let sub: type k1. (string, t(k1)) => t(k1) = |
||||||
|
(name, path) => continue(name, path); |
||||||
|
|
||||||
|
/** |
||||||
|
* Append functions always follow their "natural" left/right ordering, |
||||||
|
* regardless of t-first/last. |
||||||
|
* |
||||||
|
* The following pairs are equivalent but note that `append` is always safe. |
||||||
|
* |
||||||
|
* Path.append(Path.root, "foo"); |
||||||
|
* Option.getUnsafe(Path.absolute("/foo")); |
||||||
|
* |
||||||
|
* Path.append(Path.root, "foo/bar"); |
||||||
|
* Option.getUnsafe(Path.absolute("/foo/bar")); |
||||||
|
* |
||||||
|
* Path.append(Path.drive("C"), "foo/bar"); |
||||||
|
* Option.getUnsafe(Path.absolute("C:/foo/bar")); |
||||||
|
* |
||||||
|
* Path.append(Path.dot, "foo"); |
||||||
|
* Option.getUnsafe(Path.relative("./foo")); |
||||||
|
*/ |
||||||
|
let append: type k1. (t(k1), string) => t(k1) = |
||||||
|
(path, name) => continue(name, path); |
||||||
|
|
||||||
|
module At = { |
||||||
|
let (/) = append; |
||||||
|
/** |
||||||
|
* Applies `dirName` to the first argument, then passes the result to |
||||||
|
* `append` with the second. |
||||||
|
* |
||||||
|
* let result = root / "foo" / "bar" /../ "baz"; |
||||||
|
* |
||||||
|
* Would result in |
||||||
|
* |
||||||
|
* "/foo/baz" |
||||||
|
*/ |
||||||
|
let (/../) = (dir, s) => append(dirName(dir), s); |
||||||
|
let (/../../) = (dir, s) => append(dirName(dirName(dir)), s); |
||||||
|
let (/../../../) = (dir, s) => |
||||||
|
append(dirName(dirName(dirName(dir))), s); |
||||||
|
let (/../../../../) = (dir, s) => |
||||||
|
append(dirName(dirName(dirName(dirName(dir)))), s); |
||||||
|
let (/../../../../../) = (dir, s) => |
||||||
|
append(dirName(dirName(dirName(dirName(dirName(dir))))), s); |
||||||
|
let (/../../../../../../) = (dir, s) => |
||||||
|
append( |
||||||
|
dirName(dirName(dirName(dirName(dirName(dirName(dir)))))), |
||||||
|
s, |
||||||
|
); |
||||||
|
}; |
@ -0,0 +1,276 @@ |
|||||||
|
/** |
||||||
|
|
||||||
|
`Path` is a library for creating and operating on file paths consistently on |
||||||
|
all platforms. |
||||||
|
|
||||||
|
`Path` works exactly the same on Windows, Linux, and OSX, instead of adjusting |
||||||
|
behavior based on your current OS |
||||||
|
|
||||||
|
The `Path` API uses the following conventions: |
||||||
|
|
||||||
|
- Accepts/returns only `t(absolute))` for values that must be absolute paths. |
||||||
|
- Accepts/returns only `t(relative))` for values that must be absolute paths. |
||||||
|
- Accepts `t('any)` for values that may be either absolute or relative paths. |
||||||
|
- Returns `firstClass = Absolute(t(absolute)) | Relative(t(relative)` for |
||||||
|
return values that could be either. Consumers must pattern match on it. |
||||||
|
- Wraps return values in `Some(..)` / `None` when it is possible that no |
||||||
|
value may be computed even when the caller supplies valid data. |
||||||
|
- Wraps return values in `Ok(..)` / `Error(exn)` when it is possible that no |
||||||
|
value may be computed due to an error occuring in either user input or system |
||||||
|
failure. |
||||||
|
- For every `functionName` that wraps return values in `Ok`/`Error`, an |
||||||
|
alternative form `functionNameExn` is also supplied which does not wrap |
||||||
|
the return value, and instead raises an exception. |
||||||
|
|
||||||
|
TODO: Consider the following universal convention instead: |
||||||
|
|
||||||
|
type specificUsageError = UserNameInvalid | LoggedOut; |
||||||
|
type blame('usage) = | Caller('usage) | Implementation(exn); |
||||||
|
// Returns Error only for system blame: |
||||||
|
result(x, exn) |
||||||
|
// Returns Error for caller/system blame |
||||||
|
result(x, blame(usage)) |
||||||
|
// Returns Error only for caller blame |
||||||
|
result(x, usage) |
||||||
|
// Returns Error for caller/system blame, but no value expected. |
||||||
|
result(option(x), blame(usage)) |
||||||
|
// Returns Error for system blame, but no value expected. |
||||||
|
result(option(x), exn) |
||||||
|
*/ |
||||||
|
|
||||||
|
type relative; |
||||||
|
type absolute; |
||||||
|
/** |
||||||
|
A file system path, parameterized on the kind of file system path, |
||||||
|
`Path.t(relative)` or `Path.t(absolute)`. |
||||||
|
*/ |
||||||
|
type t('kind); |
||||||
|
|
||||||
|
/** |
||||||
|
Used to allow dynamically checking whether or not a path is absolute or |
||||||
|
relative. Use seldomly. |
||||||
|
*/ |
||||||
|
type firstClass = |
||||||
|
| Absolute(t(absolute)) |
||||||
|
| Relative(t(relative)); |
||||||
|
|
||||||
|
let drive: string => t(absolute); |
||||||
|
let root: t(absolute); |
||||||
|
let home: t(relative); |
||||||
|
let dot: t(relative); |
||||||
|
|
||||||
|
/** |
||||||
|
Queries whether a path is absolute or relative. Use seldomly, and typically |
||||||
|
only on end-user input. Once queried, use the wrapped `t(absolute)/t(relative)` |
||||||
|
as the primary path passed around. |
||||||
|
*/ |
||||||
|
let testForPath: string => option(firstClass); |
||||||
|
|
||||||
|
/** |
||||||
|
Same as `testForPath`, but raises `Invalid_argument` if no path could be |
||||||
|
detected. |
||||||
|
*/ |
||||||
|
let testForPathExn: string => firstClass; |
||||||
|
|
||||||
|
/** |
||||||
|
Creates a "first class" path could be _either_ a relative path or an absolute |
||||||
|
one. |
||||||
|
|
||||||
|
This allows you to return values from functions that might be absolute or might |
||||||
|
be relative. It also allows relative and absolute paths to coexist inside of a |
||||||
|
list together. |
||||||
|
For example, if you create a polymorphic function that accepts any kind of |
||||||
|
path, and then you want to do something differently based on whether or not the |
||||||
|
path is relative or absolute, you would first use `firstClass(path)` and then |
||||||
|
pattern match on the result `Absolute(p) => .. | Relative(p) => ...`. |
||||||
|
*/ |
||||||
|
let firstClass: t('any) => firstClass; |
||||||
|
|
||||||
|
/** |
||||||
|
Prints absolute `Path.t` as strings, always removes the final `/` separator. |
||||||
|
*/ |
||||||
|
let toString: t(absolute) => string; |
||||||
|
|
||||||
|
/** |
||||||
|
Prints any `Path.t` for debugging, always removes the final `/` separator |
||||||
|
except in the case of the empty relative paths `./`, `~/`. |
||||||
|
*/ |
||||||
|
let toDebugString: t('kind) => string; |
||||||
|
|
||||||
|
/** |
||||||
|
Parses an absolute path into a `Path.t(absolute)` or returns `None` if the path |
||||||
|
is not a absolute, yet still valid. Raises Invalid_argument if the path is |
||||||
|
invalid. |
||||||
|
*/ |
||||||
|
let absolute: string => option(t(absolute)); |
||||||
|
/** |
||||||
|
Parses a relative path into a `Path.t(relative)` or returns `None` if the path |
||||||
|
is not a valid. |
||||||
|
*/ |
||||||
|
let relative: string => option(t(relative)); |
||||||
|
|
||||||
|
/** |
||||||
|
Same as `Path.absolute` but raises a Invalid_argument if argument is not a |
||||||
|
valid absolute path. |
||||||
|
*/ |
||||||
|
let absoluteExn: string => t(absolute); |
||||||
|
|
||||||
|
/** |
||||||
|
Same as `Path.relative` but raises a Invalid_argument if argument is not a |
||||||
|
valid relative path. |
||||||
|
*/ |
||||||
|
let relativeExn: string => t(relative); |
||||||
|
|
||||||
|
/** |
||||||
|
Creates a relative path from two paths, which is the relative path that is |
||||||
|
required to arive at the `dest`, if starting from `source` directory. The |
||||||
|
`source` and `dest` must both be `t(absolute)` or `t(relative)`, but the |
||||||
|
returned path is always of type `t(relative)`. |
||||||
|
|
||||||
|
If `source` and `dest` are relative, it is assumed that the two relative paths |
||||||
|
are relative to the same yet-to-be-specified absolute path. |
||||||
|
|
||||||
|
relativize(~source=/a, ~dest=/a) == ./ |
||||||
|
relativize(~source=/a/b/c/d /a/b/qqq == ../c/d |
||||||
|
relativize(~source=/a/b/c/d, ~dest=/f/f/zzz) == ../../../../f/f/zz |
||||||
|
relativize(~source=/a/b/c/d, ~dest=/a/b/c/d/q) == ../q |
||||||
|
relativize(~source=./x/y/z, ~dest=./a/b/c) == ../../a/b/c |
||||||
|
relativize(~source=./x/y/z, ~dest=../a/b/c) == ../../../a/b/c |
||||||
|
|
||||||
|
Unsupported: |
||||||
|
`relativize` only accepts `source` and `dest` of the same kind of path because |
||||||
|
the following are meaningless: |
||||||
|
|
||||||
|
relativize(~source=/x/y/z, ~dest=./a/b/c) == ??? |
||||||
|
relativize(~source=./x/y/z, ~dest=/a/b/c) == ??? |
||||||
|
|
||||||
|
Exceptions: |
||||||
|
If it is impossible to create a relative path from `soure` to `dest` an |
||||||
|
exception is raised. |
||||||
|
If `source`/`dest` are absolute paths, the drive must match or an exception is |
||||||
|
thrown. If `source`/`dest` are relative paths, they both must be relative to |
||||||
|
`"~"` vs. `"."`. If both are relative, but the source has more `..` than the |
||||||
|
dest, then it is also impossible to create a relative path and an exception is |
||||||
|
raised. |
||||||
|
|
||||||
|
relativize(~source=./foo/bar, ~dest=~/foo/bar) == raise(Invalid_argument) |
||||||
|
relativize(~source=~/foo/bar, ~dest=./foo/) == raise(Invalid_argument) |
||||||
|
relativize(~source=C:/foo/bar, ~dest=/foo/bar) == raise(Invalid_argument) |
||||||
|
relativize(~source=C:/foo/bar, ~dest=F:/foo/bar) == raise(Invalid_argument) |
||||||
|
relativize(~source=/foo/bar, ~dest=C:/foo/) == raise(Invalid_argument) |
||||||
|
relativize(~source=../x/y/z, ~dest=./a/b/c) == raise(Invalid_argument) |
||||||
|
relativize(~source=../x/y/z, ~dest=../foo/../a/b/c) == raise(Invalid_argument) |
||||||
|
*/ |
||||||
|
let relativizeExn: (~source: t('kind), ~dest: t('kind)) => t(relative); |
||||||
|
/** |
||||||
|
Same as `relativizeExn` but returns `result(Path.t(Path.absolute), exn)` |
||||||
|
instead of throwing an exception. |
||||||
|
*/ |
||||||
|
let relativize: |
||||||
|
(~source: t('kind), ~dest: t('kind)) => result(t(relative), exn); |
||||||
|
|
||||||
|
/** |
||||||
|
Accepts any `Path.t` and returns a `Path.t` of the same kind. Relative path |
||||||
|
inputs return relative path outputs, and absolute path inputs return absolute |
||||||
|
path outputs. |
||||||
|
*/ |
||||||
|
let dirName: t('kind) => t('kind); |
||||||
|
|
||||||
|
/** |
||||||
|
Accepts any `Path.t` and returns the final segment in its path string, or |
||||||
|
`None` if there are no segments in its path string. |
||||||
|
|
||||||
|
Path.baseName(Path.At(Path.dot /../ "")) |
||||||
|
None |
||||||
|
|
||||||
|
Path.baseName(Path.At(Path.dot /../ "foo")) |
||||||
|
Some("foo") |
||||||
|
|
||||||
|
Path.baseName(Path.At(Path.dot /../ "foo" /../ "")) |
||||||
|
None |
||||||
|
|
||||||
|
Path.baseName(Path.At(Path.dot /../ "foo" / "bar" /../ "")) |
||||||
|
Some("foo") |
||||||
|
*/ |
||||||
|
let baseName: t('kind) => option(string); |
||||||
|
|
||||||
|
/** |
||||||
|
Appends one segment to a path. Preserves the relative/absoluteness of the first |
||||||
|
arguments. |
||||||
|
*/ |
||||||
|
let append: (t('kind), string) => t('kind); |
||||||
|
|
||||||
|
/** |
||||||
|
Appends one path to another. Preserves the relative/absoluteness of the first |
||||||
|
arguments. |
||||||
|
*/ |
||||||
|
let join: (t('kind1), t('kind2)) => t('kind1); |
||||||
|
|
||||||
|
let eq: (t('kind1), t('kind2)) => bool; |
||||||
|
|
||||||
|
/** |
||||||
|
Tests for path equality of two absolute paths. |
||||||
|
*/ |
||||||
|
let absoluteEq: (t(absolute), t(absolute)) => bool; |
||||||
|
|
||||||
|
/** |
||||||
|
Tests for path equality of two absolute paths. |
||||||
|
*/ |
||||||
|
let relativeEq: (t(relative), t(relative)) => bool; |
||||||
|
|
||||||
|
/** |
||||||
|
Tests whether or not an absolute path has a parent path. Absolute paths such as |
||||||
|
"C:/" and "/" have no parent dir. |
||||||
|
*/ |
||||||
|
let hasParentDir: t(absolute) => bool; |
||||||
|
|
||||||
|
/** |
||||||
|
Returns `true` if a path exists inside another path `~ofPath` or is equal to |
||||||
|
`~ofPath`. |
||||||
|
*/ |
||||||
|
let isDescendent: (~ofPath: t('kind), t('kind)) => bool; |
||||||
|
|
||||||
|
/** |
||||||
|
Syntactic forms for utilities provided above. These are included in a separate |
||||||
|
module so that it can be opened safely without causing collisions with other |
||||||
|
identifiers in scope such as "root"/"home". |
||||||
|
|
||||||
|
Use like this: |
||||||
|
|
||||||
|
Path.At(Path.root / "foo" / "bar"); |
||||||
|
Path.At(Path.dot /../ "bar"); |
||||||
|
*/ |
||||||
|
module At: { |
||||||
|
/** |
||||||
|
Performs `append` with infix syntax. |
||||||
|
*/ |
||||||
|
let (/): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../ s` is equivalent to `append(dirName(dir), s)` |
||||||
|
*/ |
||||||
|
let (/../): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../../ s` is equivalent to `append(dirName(dirName(dir)), s)` |
||||||
|
*/ |
||||||
|
let (/../../): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../../../ s` is equivalent to |
||||||
|
`append(dirName(dirName(dirName(dir))), s)` |
||||||
|
*/ |
||||||
|
let (/../../../): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../../../../ s` is equivalent to |
||||||
|
`append(dirName(dirName(dirName(dirName(dir)))), s)` |
||||||
|
*/ |
||||||
|
let (/../../../../): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../../../../../ s` is equivalent to |
||||||
|
`append(dirName(dirName(dirName(dirName(dirName(dir))))), s)` |
||||||
|
*/ |
||||||
|
let (/../../../../../): (t('kind), string) => t('kind); |
||||||
|
/** |
||||||
|
`dir /../../../../../../ s` is equivalent to |
||||||
|
`append(dirName(dirName(dirName(dirName(dirName(dirName(dir)))))), s)` |
||||||
|
*/ |
||||||
|
let (/../../../../../../): (t('kind), string) => t('kind); |
||||||
|
}; |
Loading…
Reference in new issue