package parkour
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=c4a3f934273430011f6c4862c035395268c47b2cdaba52c199f97cf0404dfba9
sha512=45194b2c7d5f8bcc9d2cb92d640b9dff17b2a3d4ad7319c006daf523923d8c69cdaf53e11d25ba01d5a470b027e4fa1788a69669d11481db20773cef6cc6fa49
Description
Parkour is a parser-combinator library for human-authored text such as configuration files, DSLs and small languages. It reports precise, well-rendered syntax errors with structured diagnostics, offers opt-in error recovery that reports many problems in one run, works on strings or token streams, and is stack-safe on long and deeply nested input (nesting depth is limited). It has no runtime dependencies beyond the OCaml standard library.
README
Parkour
A parser-combinator library for OCaml, for human-authored text (config files, DSLs, small languages). It aims for precise syntax errors, a pleasant API, opt-in error recovery and stack safety on long and deeply nested input. No runtime dependencies beyond the OCaml standard library.
open Parkour
let point =
let+ x = integer <* char ',' and+ y = integer in
(x, y)
let () =
match parse point "3,x" with
| Ok (x, y) -> Printf.printf "%d %d\n" x y
| Error ds ->
let source = Source.make ~name:"point" "3,x" in
List.iter (fun d -> print_string (Diagnostic.render source d)) dsprints
error: expected integer, found 'x'
--> point:1:3
|
1 | 3,x
| ^ expected integerDocumentation
A tutorial and the API reference, built with
dune build @doc(open _build/default/_doc/_html/index.html). The examples/ directory has complete parsers (JSON, CSV, typed values, a calculator, a configuration format with error recovery, a small C-like language), each with a gallery of broken inputs and the errors they produce.
Development
Command | |
|---|---|
| build the library |
| fast test tier |
| extensive test tier (QCheck |
| format the sources |
| benchmarks (unpackaged; |
See CHANGES for the release notes. License: MIT (see LICENSE).
Dev Dependencies (2)
-
odoc
with-doc -
qcheck-core
with-test & >= "0.90"
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building parkour with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.1.1 (this version) | n/a | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure