Asama 0.4 — Add SourceLocation to all AST nodes #38

Open
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.
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#38
No description provided.