Skip to content

Add UTF-8 lexer cursor and identifier regression tests #392

Closed

Description

@LunaStev

Why

The lexer stores byte offsets internally while diagnostic columns count Unicode scalar values. front/lexer/src/cursor.rs documents this invariant, but no tests verify it.

Scope

  • Test identifiers containing non-ASCII alphabetic characters.
  • Test lookahead and tokenization when multi-byte characters appear before operators and literals.
  • Trigger a lexer diagnostic after non-ASCII text and assert the human column rather than the byte offset.
  • Cover a newline after UTF-8 input to verify line_start is reset correctly.
  • Do not introduce Unicode normalization or change identifier policy.

Likely files

  • front/lexer/src/cursor.rs
  • front/lexer/src/ident.rs
  • A new lexer integration test

Completion criteria

  • Multi-byte UTF-8 input never panics or slices at an invalid boundary.
  • Identifier tokens preserve their original spelling.
  • Diagnostic line and column assertions distinguish characters from bytes.
  • cargo test -p lexer --locked passes.

Activity

  1. added
    good first issue
    needs testing
    cross-platform
    on Aug 28, 2026
  2. self-assigned this
    on Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cross-platformgood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions