source-map 0.15.0

Utilities for building source maps (v3) for a compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#[cfg(feature = "self-rust-tokenize")]
#[test]
fn to_tokens() {
    use self_rust_tokenize::SelfRustTokenize;
    use source_map::{Nullable, SourceId, SpanWithSource};

    let span = SpanWithSource {
        start: 10,
        end: 20,
        source: SourceId::NULL,
    };

    assert_eq!(
        span.to_tokens().to_string(),
        "BaseSpan { start : 10u32 , end : 20u32 , source : CURRENT_SOURCE_ID , }"
    );
}