Skip to main content

span_to_location

Function span_to_location 

Source
pub fn span_to_location(
    source: &str,
    span: Span,
    file: Option<String>,
) -> SourceLocation
Expand description

Convert a byte-offset Span to line/column SourceLocation

This function takes the source text and a Span (containing byte offsets) and converts it to a SourceLocation with line numbers and column positions.