Asama 0.4 — Add SourceLocation to all AST nodes #38

Closed
opened 2026-05-26 19:51:33 +03:00 by saqut · 0 comments
Owner

Goal: Every AST node knows its originating source location.

Files to modify:

  • src/parser/ast.hpp

Requirements:

  • Add SourceLocation loc field to ASTNode base class.
  • Optionally add SourceLocation endLoc for range.
  • Parser must set loc when creating AST nodes from tokens.
  • Update toJson() and log() methods to include location info.

Success criteria:

  • JSON output includes location for every node.
  • Log output shows location when available.
**Goal:** Every AST node knows its originating source location. **Files to modify:** - src/parser/ast.hpp **Requirements:** - Add SourceLocation loc field to ASTNode base class. - Optionally add SourceLocation endLoc for range. - Parser must set loc when creating AST nodes from tokens. - Update toJson() and log() methods to include location info. **Success criteria:** - JSON output includes location for every node. - Log output shows location when available.
saqut closed this issue 2026-06-14 21:53:27 +03:00
Sign in to join this conversation.
No description provided.