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,48 @@
# STATUS-eval
Commit: 0a560468a157c0026515ee3edb9b8aff6b6a41ab
## Claims
| Gate | DoD item | Claim |
|------|----------|-------|
| D1 | arithmetic (+ - * /, precedence, parens, unary minus) | CLAIMED |
| D2 | true division; EvalError on div-by-zero | CLAIMED |
| D3 | whole-valued → int, non-whole → float | CLAIMED |
| D4 | CLI prints result, exits 0; bad input → stderr, non-zero | CLAIMED |
| D5 | test_evaluator.py passes; full suite (lex+parse+eval) passes | CLAIMED |
## Files changed
- `calc/evaluator.py``evaluate(node) -> int | float`, `EvalError`
- `calc/test_evaluator.py` — 13 unittest cases for D1D3
- `calc.py` — CLI entry point for D4
## Verify commands (exact, in working directory)
```bash
# D5 — full suite
python -m unittest -q
# expected: Ran 42 tests in ... OK
# D1
python calc.py "2+3*4" # expected: 14
python calc.py "(2+3)*4" # expected: 20
python calc.py "8-3-2" # expected: 3
python calc.py "-2+5" # expected: 3
python calc.py "2*-3" # expected: -6
# D2
python calc.py "7/2" # expected: 3.5
python calc.py "1/0" # expected: error to stderr, exit code 1
# D3
python calc.py "4/2" # expected: 2 (int, no .0)
python calc.py "7/2" # expected: 3.5 (float)
# D4
python calc.py "2+3*4" # expected stdout: 14, exit 0
python calc.py "1 +" # expected: error to stderr, exit non-zero (no traceback)
```
## DONE