#source-map

source-map

Utilities for building source maps (v3) for a compiler

15 releases (breaking)

new 0.12.0 Mar 18, 2023
0.11.2 Feb 3, 2023
0.11.0 Nov 26, 2022
0.8.0 Apr 26, 2022
0.2.0 Jul 26, 2021

#782 in Web programming

Download history 9/week @ 2022-11-28 8/week @ 2022-12-05 17/week @ 2022-12-12 5/week @ 2022-12-19 10/week @ 2022-12-26 4/week @ 2023-01-02 8/week @ 2023-01-09 4/week @ 2023-01-16 11/week @ 2023-01-23 63/week @ 2023-01-30 32/week @ 2023-02-06 29/week @ 2023-02-13 53/week @ 2023-02-20 73/week @ 2023-02-27 44/week @ 2023-03-06 76/week @ 2023-03-13

247 downloads per month
Used in 4 crates (2 directly)

MIT license

33KB
809 lines

Source map

crates.io badge docs.rs badge

Utilities for building source maps (v3) for a compiler and handling source location representations

Includes

  • Span, a structure which represents a section of a specific source
  • SourceId, a identifier for a source file
  • StringWithSourceMap, along with the ToString trait makes generating string representations with and adding source markings trivial
  • With the lsp-types-morphisms features makes converting between the position information in lsp-types easy

Example

git clone https://github.com/kaleidawave/source-map
cd source-map
cargo run -F inline-source-map --example source_map_creation -- LICENSE LICENSE.map

View pairings generated by uploading LICENSE.map to evan w's source map visualizer

Dependencies

~0–760KB
~19K SLoC