Skip to content

refactor: structured error reporting with categorized interpreter errors - #214

Merged
kshku merged 8 commits into
devfrom
feat/error-reporting
Jun 9, 2026
Merged

refactor: structured error reporting with categorized interpreter errors#214
kshku merged 8 commits into
devfrom
feat/error-reporting

Conversation

@kshku

@kshku kshku commented Jun 9, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

Replaces ad-hoc error handling (SNUK_SHOULD_NOT_REACH_HERE, VALUE_UNKOWN) with structured error reporting. The parser and interpreter now produce typed SnukError values. The interpreter error system is redesigned into 7 semantic categories with context-rich formatted messages.

Type of change

  • feat — new feature

Checklist

  • Branch cut from dev
  • Builds without warnings (-Wall -Wextra)
  • Existing test files still pass
  • Commits follow conventional commit format

Anything reviewers should know?

Closes #22

kshku added 8 commits June 8, 2026 12:37
…iled messages

SnukInterpError collapsed from 20 to 7 categories:
- TYPE: type system violations
- NAME: name resolution/declaration conflicts
- FUNCALL: function call errors
- ASSIGN: assignment/initialization failures
- CONTROL_FLOW: break/continue/return outside valid scope
- INTERFACE: interface creation errors
- INTERNAL: unreachable code paths

Added err_msg_buf[256] + interpreter_error_fmt() for formatted messages
with variable names. All 39 error call sites updated with detailed,
context-specific messages.

Removed committed docs/superpowers design files.
@kshku
kshku merged commit 82c1368 into dev Jun 9, 2026
5 checks passed
@kshku
kshku deleted the feat/error-reporting branch June 9, 2026 01:41
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.

refactor(interpreter): implement proper error reporting

1 participant