Skip to content
This repository was archived by the owner on Jun 2, 2026. It is now read-only.

Reject lexer errors during parse#70

Open
StantonMatt wants to merge 1 commit into
ChromeGG:mainfrom
StantonMatt:codex/reject-lexer-errors
Open

Reject lexer errors during parse#70
StantonMatt wants to merge 1 commit into
ChromeGG:mainfrom
StantonMatt:codex/reject-lexer-errors

Conversation

@StantonMatt

Copy link
Copy Markdown

Closes #63.

parse("value =< 42") was succeeding because Chevrotain reported = as a lexer error, but the parser only received the remaining valid tokens and parsed the expression as value < 42. This now returns a parse failure whenever tokenization reports invalid characters, so lexer errors cannot be silently dropped before parsing.

I also updated the existing newline-in-string expectations to assert the new lexer-error message instead of the previous parser EOF message.

Validation:

  • pnpm exec vitest src/spec/index.spec.ts --run failed before the fix with the new regression and passed after the fix
  • pnpm test
  • pnpm lint
  • pnpm type-check
  • pnpm build
  • git diff --check
  • review-fix-loop clean: no actionable correctness issues

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid operator in expression sees parse() successfully

1 participant