artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user