2 releases
Uses new Rust 2024
| new 0.12.2 | Apr 8, 2026 |
|---|---|
| 0.12.1 | Apr 1, 2026 |
#184 in Parser tooling
Used in 3 crates
(via perl-incremental-parsing)
6KB
Byte-oriented line/column indexing helpers.
This crate has one responsibility: map byte offsets to (line, column)
and back using cached line starts.
perl-line-index
A tiny microcrate that provides a byte-oriented line index used by incremental parsing paths.
API
LineIndex::new(&str)builds a line-start cache.LineIndex::byte_to_position(usize)maps byte offset to(line, column).LineIndex::position_to_byte(line, column)maps back to byte offsets.