Asama 0.3 — Add SourceLocation to all Token types #37

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

Goal: Every token produced by the Tokenizer carries its SourceLocation.

Files to modify:

  • src/tokenizer/token.hpp

Requirements:

  • Add SourceLocation loc field to the base Token class.
  • Remove or deprecate int start, int end fields (replace with loc data).
  • Update StringToken, NumberToken, IdentifierToken if they reference start/end directly.
  • Ensure all token constructors initialize loc.

Success criteria:

  • After tokenizing, every token has a valid SourceLocation.
  • Old start/end offsets are derivable from SourceLocation if needed.
**Goal:** Every token produced by the Tokenizer carries its SourceLocation. **Files to modify:** - src/tokenizer/token.hpp **Requirements:** - Add SourceLocation loc field to the base Token class. - Remove or deprecate int start, int end fields (replace with loc data). - Update StringToken, NumberToken, IdentifierToken if they reference start/end directly. - Ensure all token constructors initialize loc. **Success criteria:** - After tokenizing, every token has a valid SourceLocation. - Old start/end offsets are derivable from SourceLocation if needed.
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#37
No description provided.