-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathppx_tyre.opam
49 lines (44 loc) · 1.6 KB
/
ppx_tyre.opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
opam-version: "2.0"
maintainer: "Petter A. Urkedal <[email protected]>"
authors: [
"Gabriel Radanne <[email protected]>"
"Petter A. Urkedal <[email protected]>"
]
license: "LGPL-3 with OCaml linking exception"
homepage: "https://github.com/paurkedal/ppx_regexp"
bug-reports: "https://github.com/paurkedal/ppx_regexp/issues"
depends: [
"ocaml" {>= "4.02.3"}
"dune" {>= "1.11"}
"ocaml-migrate-parsetree" {>= "1.4.0"}
"re" {>= "1.7.2"}
"ppx_tools_versioned" {>= "5.2.3"}
"tyre" {>= "0.4.1"}
"qcheck" {with-test}
]
build: ["dune" "build" "-p" name "-j" jobs]
dev-repo: "git+https://github.com/paurkedal/ppx_regexp.git"
synopsis: "PPX syntax for tyre regular expressions and routes"
description: """
This PPX compiles
[%tyre {|re|}]
into `'a Tyre.t` and
function%tyre
| {|re1|} as x1 -> e1
...
| {|reN|} as x2 -> eN
into `'a Type.route`, where `re`, `re1`, ... are regular expressions
expressed in a slightly extended subset of PCRE. The interpretations are:
- `re?` extracts an option of what `re` extracts.
- `re+`, `re*`, `re{n,m}` extracts a list of what `re` extracts.
- `(?@qname)` refers to any identifier bound to a typed regular expression
of type `'a Tyre.t`.
- One or more `(?<v>re)` at the top level can be used to bind variables
instead of `as ...`.
- One or more `(?<v>re)` in a sequence extracts an object where each method
`v` is bound to what `re` extracts.
- An alternative with one `(?<v>re)` per branch extracts a polymorphic
variant where each constructor `` `v`` receives what `re` extracts as its
argument.
- `(?&v:qname)` is a shortcut for `(?<v>(?&qname))`.
"""