Asama 3.3 — Report undefined variable errors using SymbolTable #46

Open
opened 2026-05-26 19:52:15 +03:00 by saqut · 0 comments
Owner

Goal: When a variable is used before definition, report a clear error with location.

Files to modify:

  • src/symbol/symbol_collector.hpp
  • src/core/diagnostic.hpp (new)

Requirements:

  • During symbol collection, when an identifier reference has no resolve(), emit diagnostic.
  • Diagnostic includes: error level, SourceLocation, message, optional hint.
  • Suggest close matches (Levenshtein distance < 3).
  • Support multiple errors (dont stop at first).

Success criteria:

  • int main() { return x; } reports Error: x is not defined at line 1 column 19.
  • Typos suggest close matches.
**Goal:** When a variable is used before definition, report a clear error with location. **Files to modify:** - src/symbol/symbol_collector.hpp - src/core/diagnostic.hpp (new) **Requirements:** - During symbol collection, when an identifier reference has no resolve(), emit diagnostic. - Diagnostic includes: error level, SourceLocation, message, optional hint. - Suggest close matches (Levenshtein distance < 3). - Support multiple errors (dont stop at first). **Success criteria:** - int main() { return x; } reports Error: x is not defined at line 1 column 19. - Typos suggest close matches.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: saqut/saqut-compiler#46
No description provided.