artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs

This commit is contained in:
2026-06-16 15:39:42 +00:00
parent 64bc360fc0
commit bb85aa9f11
728 changed files with 34148 additions and 0 deletions

View File

@ -0,0 +1,18 @@
# JOURNAL-lex
## 2026-06-15
**Built:** `calc/__init__.py`, `calc/lexer.py`, `calc/test_lexer.py`, `.gitignore`
**Design decisions:**
- `Token` is a `@dataclass` with `kind: str` and `value: Union[int, float, str, None]`
- Operators/parens carry their char as value; EOF carries `None`
- Number parsing: scans contiguous digits/dots; if `.` present → `float()`, else `int()`
- `LexError` extends `Exception`; message includes repr of bad char and its index
**Verification (all 3 plan commands passed):**
1. `python -m unittest -q` → 15 tests, 0 failures
2. `tokenize('3.5*(1-2)')` → correct 8-token list
3. `tokenize('1 @ 2')` → raises `LexError: unexpected character '@' at position 2`
**Commit:** c37b70f — pushed to origin/main