artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
15
calculators/builder-solo/run-01/machine-docs/JOURNAL-eval.md
Normal file
15
calculators/builder-solo/run-01/machine-docs/JOURNAL-eval.md
Normal 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 D1–D3: 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
|
||||
Reference in New Issue
Block a user