Skip to main content

line_col

Function line_col 

Source
pub fn line_col(source: &str, offset: usize) -> (usize, usize)
Expand description

1-indexed (line, column) of a byte offset in source. Columns count characters, not bytes. Lives in the syntax leaf so every layer that maps a span to a position — the emitter’s assertion locations, bynkc’s short rendering, and (slice 6) bynk-render — shares one implementation.