5 releases

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

#730 in Rust patterns

Download history 456/week @ 2024-01-12 284/week @ 2024-01-19 473/week @ 2024-01-26 787/week @ 2024-02-02 183/week @ 2024-02-09 1239/week @ 2024-02-16 592/week @ 2024-02-23 598/week @ 2024-03-01 683/week @ 2024-03-08 307/week @ 2024-03-15 431/week @ 2024-03-22 490/week @ 2024-03-29 1184/week @ 2024-04-05 2044/week @ 2024-04-12 1221/week @ 2024-04-19 977/week @ 2024-04-26

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

Apache-2.0 OR MIT

140KB
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

~5–15MB
~192K SLoC