glinter/source

Values

pub fn byte_offset_to_line(source: String, offset: Int) -> Int

Convert byte offset to line number (1-indexed)

pub fn line_to_byte_offset(source: String, line: Int) -> Int

Convert line number (1-indexed) to byte offset of the start of that line.

Search Document