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,9 @@
# JOURNAL-eval
## Design notes
**evaluator.py**: Straightforward AST walker. `_normalize(v)` converts a float to int when `v == int(v)` — this handles the D3 requirement cleanly for both direct integer arithmetic and whole-valued division results. Division by zero is caught before the `/` operation and wrapped as `EvalError`.
**calc.py**: Catches `LexError`, `ParseError`, and `EvalError`; prints `error: <message>` to stderr and exits 1. No traceback leaks.
**test_evaluator.py**: 13 tests covering all D1 arithmetic cases, D2 true division and EvalError, D3 type assertions. Full 42-test suite (lex 16 + parse 13 + eval 13) passes.