Skip to main content

Module text_line

Module text_line 

Source
Expand description

Text-line cursor and boundary helpers (previously perl-text-line). Text-line cursor helpers.

This crate has a single responsibility: map cursor offsets to line boundaries and provide conservative token-boundary primitives for single-line scanning.

Functionsยง

is_identifier_byte
Return true when byte is an identifier character ([A-Za-z0-9_]).
is_keyword_boundary
Return true when token keyword bytes in [start, start + len) are bounded on both sides by non-identifier bytes.
line_bounds_at
Return the byte span of the line containing cursor_pos.
skip_ascii_whitespace
Advance idx while bytes at the cursor are ASCII whitespace.