38 releases

0.8.2 Oct 19, 2023
0.7.16 Aug 31, 2023
0.7.13 Dec 16, 2022
0.7.11 Oct 19, 2022
0.3.2 Mar 15, 2022

#31 in Parser tooling

Download history 6246/week @ 2024-07-21 6214/week @ 2024-07-28 6266/week @ 2024-08-04 6581/week @ 2024-08-11 5606/week @ 2024-08-18 5983/week @ 2024-08-25 6824/week @ 2024-09-01 6792/week @ 2024-09-08 6177/week @ 2024-09-15 6255/week @ 2024-09-22 5409/week @ 2024-09-29 7895/week @ 2024-10-06 5781/week @ 2024-10-13 8219/week @ 2024-10-20 5862/week @ 2024-10-27 5789/week @ 2024-11-03

26,146 downloads per month
Used in 85 crates (16 directly)

MIT/Apache

47KB
1.5K SLoC

Code mapping utility types and traits.

CI Crate informations License Documentation

This library provides essentials types and trait to locate syntax elements.

  • Span describes a byte range in a source file, with an intuitive API to write lexers and parsers.
  • Location<F> combines a Span with a file identifier F to pin point a syntactic element in a source file.
  • Loc<T, F> wraps any value T and bind it to its location.

Extra traits are also provided to extend common types (Option, Result, etc.) with localization functions. The crate integrates well with diagnostic reporting libraries such as codespan-reporting to render beautiful error reports.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~0–7MB
~48K SLoC