Skip to content

test(lexer): pin BOM emission parity and span coordinates - #436

Merged
Teakowa merged 1 commit into
mainfrom
fix/427-utf8-bom
Oct 13, 2026
Merged

Teakowa merged 1 commit into
mainfrom
fix/427-utf8-bom

Conversation

@e54-bot

@e54-bot e54-bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The lexer fix itself already landed with the audit batch (frontend/lexer.rs treats U+FEFF as trivia). What was missing against the issue's acceptance criteria is the pinned contract: the extended utf8_bom_is_accepted test now proves a BOM-prefixed program emits identically to the BOM-less one, and records the span convention explicitly — the BOM stays inside the source coordinate space, occupying 1:1 and shifting the rule keyword to 1:2.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test -p workshop-rs --lib — all green
  • git diff --check

Fixes #427

The lexer already accepts U+FEFF as trivia (W1). The test now proves the
BOM-prefixed program emits identically to the BOM-less one, and records
the span contract: the BOM stays inside the source coordinate space at
1:1, shifting the first token to 1:2.

Fixes #427
@Teakowa
Teakowa merged commit 897980e into main Oct 13, 2026
5 checks passed
@Teakowa
Teakowa deleted the fix/427-utf8-bom branch October 13, 2026 11:53
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.

Lexer rejects a leading UTF-8 BOM

2 participants