4 releases

new 0.1.1 Apr 17, 2024
0.1.0 Apr 9, 2024
0.0.1 Sep 19, 2022
0.0.0 Sep 15, 2022

#720 in Rust patterns

Download history 484/week @ 2023-12-23 363/week @ 2023-12-30 446/week @ 2024-01-06 467/week @ 2024-01-13 375/week @ 2024-01-20 355/week @ 2024-01-27 784/week @ 2024-02-03 211/week @ 2024-02-10 1277/week @ 2024-02-17 584/week @ 2024-02-24 697/week @ 2024-03-02 582/week @ 2024-03-09 309/week @ 2024-03-16 480/week @ 2024-03-23 391/week @ 2024-03-30 1146/week @ 2024-04-06

2,403 downloads per month
Used in 4 crates (2 directly)

Apache-2.0 OR MIT

135KB
2.5K SLoC

reuse rustc_span for compiler_base.

note: [WIP] Do not use it.


lib.rs:

Source positions and related helper functions.

Important concepts in this module include:

  • the span, represented by SpanData and related types;
  • source code as represented by a SourceMap; and
  • interned strings, represented by Symbols, with some common symbols available statically in the [sym] module.

Unlike most compilers, the span contains not only the position in the source code, but also various other metadata, such as the edition and macro hygiene. This metadata is stored in SyntaxContext and ExpnData.

Note

This API is completely unstable and subject to change.

Dependencies

~6–16MB
~197K SLoC