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

#701 in Programming languages

Download history 813/week @ 2024-08-13 763/week @ 2024-08-20 804/week @ 2024-08-27 735/week @ 2024-09-03 1886/week @ 2024-09-10 571/week @ 2024-09-17 214/week @ 2024-09-24 29/week @ 2024-10-01 1112/week @ 2024-10-08 546/week @ 2024-10-15 1162/week @ 2024-10-22 333/week @ 2024-10-29 445/week @ 2024-11-05 162/week @ 2024-11-12 207/week @ 2024-11-19 158/week @ 2024-11-26

1,046 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

~7–16MB
~211K SLoC