Expand description
Source positions/ranges anchored to UTF-16 code-unit offsets (1-based
line/column). Port of varar-core/src/span.ts / Span.java.
Structs§
- LineCol
- A 1-based line/column position.
- Span
- A source range
[start_offset, end_offset)in UTF-16 code units, with 1-based line/column at each end.
Functions§
- line_
col - Computes the 1-based (line, col) at
offset(a UTF-16 code-unit index) intosource. Walks per UTF-16 code unit from the start, exactly like Java’scharAtloop (so an astral character advancescolby 2).