Skip to content

Improve parser error reporting clarity#14

Draft
Codex wants to merge 2 commits into
mainfrom
codex/parser-add-better-error-handling
Draft

Improve parser error reporting clarity#14
Codex wants to merge 2 commits into
mainfrom
codex/parser-add-better-error-handling

Conversation

@Codex
Copy link
Copy Markdown

@Codex Codex AI commented Mar 28, 2026

Parsing failures previously only reported “unexpected token” without context. We now emit precise expectations alongside the offending token to make debugging grammar issues faster.

  • Error diagnostics: Track expected token set during syntax matching and surface it with the unexpected token and location for clearer parse errors.
  • Matching helpers: Added small helpers to normalize expected tokens and handle list/variant matches consistently.

Example error message shape:

unexpected token IDENTIFIER at 12:5, expected: COLON, EQUAL, SEMICOLON

@Codex Codex AI linked an issue Mar 28, 2026 that may be closed by this pull request
Co-authored-by: Meulengracht <10059902+Meulengracht@users.noreply.github.com>
@Codex Codex AI changed the title [WIP] Add better error handling for parser Improve parser error reporting clarity Mar 28, 2026
@Codex Codex AI requested a review from Meulengracht March 28, 2026 21:58
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.

[parser] add better error handling

2 participants