Skip to content

fix(lexer): stop rescanning lines for token columns - #1056

Merged
LunaStev merged 5 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/1028-linear-lexer-columns
Nov 2, 2026
Merged

LunaStev merged 5 commits into
wavefnd:masterfrom
hiyouwhatsapp:fix/1028-linear-lexer-columns

Conversation

@hiyouwhatsapp

@hiyouwhatsapp hiyouwhatsapp commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1028

The lexer was counting from the start of the line for every token, so longer lines kept getting rescanned

I keep the Unicode column as the cursor advances now and reset it on LF, CRLF and CR. Byte offsets and the existing error-position lookup stay the same

Added tests for long single-line token streams, multibyte comments and error spans near the end of a line

Validation: all 50 upstream CI checks pass after the formatting correction. CI results

@LunaStev

Copy link
Copy Markdown
Member

The CI is failing because front/lexer/tests/column_tracking.rs does not pass cargo fmt --all --check.

Please run cargo fmt --all and push the formatting fix so the CI can pass.

The implementation otherwise looks good.

@LunaStev

LunaStev commented Nov 1, 2026

Copy link
Copy Markdown
Member

The incremental column-tracking implementation looks good, and the added regression tests cover the important Unicode and newline cases.

However, the current CI is failing because cargo fmt --all --check reports formatting differences in front/lexer/tests/column_tracking.rs.

Please run cargo fmt --all, commit the formatting changes, and verify that all CI checks pass.

No additional functional changes are requested at this stage.

@LunaStev
LunaStev merged commit 0233994 into wavefnd:master Nov 2, 2026
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Avoid rescanning the source-line prefix for every lexer token column

2 participants