package loc
All checked builds passInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=d1894623628948203f77a932d7a41a2730b17894cc79b6a7488e55f254b0bb3c
sha512=e7a4a0380687d6f06277e3c08977278f4ef1e8ab1a226b1665295ae9fd94ba080576fe9d3ae46c071132326a25fb0793b190e8ca80c958c66c16b808323f779e
Description
Loc is an OCaml library for manipulating code locations, which are ranges of lexing positions from a parsed file.
Attaching locations to nodes manipulated by programs can be useful for various applications such as compilers, interpreters, linters, and refactoring tools.
README
loc
Loc is an OCaml library to manipulate code locations, which are ranges of lexing positions from a parsed file.
It is inspired by dune's Loc.t, and uses it under the hood. The type equality with Stdune.Loc.t is currently not exposed and Stdune not mentioned in the interface of Loc, with the aim of keeping the signature of Loc stable across potential internal changes in Stdune.
Code Documentation
The code documentation of the latest release is built with odoc and published to GitHub pages here.
Motivation
Attaching locations to nodes manipulated by programs can be useful for applications such as compilers, interpreters, linters, refactor tools, etc.
Here are 3 kinds of examples using the Loc library:
- Attach locations to the nodes of an AST. See bopkit.
- Apply surgical patches to a file. See file-rewriter.
- Emit located messages to the console. See cmdlang's Err module.
See also
Similar libraries or modules:
- Dune's Loc.t
- Parsexp's ranges
- Ppxlib's Location.t
- Compilerlibs's loc
Dependencies (6)
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by (7)
Conflicts
None
Build status
Results of building loc with each compiler on check.ci.ocaml.org, run of against opam-repository 8a77e58. 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.3.3 (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