656 B
656 B
Journal — phase lex
2026-06-15
Built calc/lexer.py with Token dataclass, LexError, and tokenize().
Design notes:
Tokenis a dataclass withkind: strandvalue: Union[int, float, str, None]; EOF hasvalue=None, operators carry their char as value, numbers carry the parsed numeric value.- Number parsing: scans while digit or
.; usesint()if no dot elsefloat(). - LexError message includes the offending character (quoted) and its 0-based position.
- 18 tests cover all D1–D3 requirements including the plan's required expressions.
Committed ba1f056, then c465844 (STATUS sha update). Waiting for Adversary review.