# Journal — phase `lex` ## 2026-06-15 Built `calc/lexer.py` with `Token` dataclass, `LexError`, and `tokenize()`. Design notes: - `Token` is a dataclass with `kind: str` and `value: Union[int, float, str, None]`; EOF has `value=None`, operators carry their char as value, numbers carry the parsed numeric value. - Number parsing: scans while digit or `.`; uses `int()` if no dot else `float()`. - 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.