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,15 @@
# JOURNAL — phase eval
## Session 1
**Built:**
- `calc/evaluator.py``EvalError`, `evaluate(node) -> int | float` walking Num/BinOp/Unary AST nodes; true division; raises `EvalError` on divide-by-zero.
- `calc/test_evaluator.py` — 18 unittest cases covering D1D3: arithmetic, division, EvalError, result types.
- `calc.py` — top-level CLI; `_fmt()` converts whole-valued floats to int display; catches LexError/ParseError/EvalError and prints to stderr with exit code 1.
**Verification results:**
- All 46 tests pass (`python -m unittest -q`).
- All 6 CLI spot-checks pass (2+3*4→14, (2+3)*4→20, 7/2→3.5, 4/2→2, 1/0→error/exit1, 1+→error/exit1).
- stderr isolation confirmed (error messages go to stderr only, no traceback).
**Commit:** c5e74ed