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
|
||||
|
||||
## Approach
|
||||
|
||||
- `Token` is a `dataclass` with `kind: str` and `value: Union[int, float, str, None]`.
|
||||
- `tokenize()` is a simple single-pass scanner using index `i`.
|
||||
- Numbers: greedy scan of digits and `.`; if `.` present → `float`, else → `int`.
|
||||
- Operators/parens: single-char dispatch via `_SINGLE` dict.
|
||||
- Whitespace (space, tab): skipped silently.
|
||||
- Anything else: raises `LexError` with the offending char and position.
|
||||
- `EOF` token appended at the end.
|
||||
|
||||
## Test count: 13 — all green on first run.
|
||||
Reference in New Issue
Block a user