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,39 @@
# STATUS — eval phase
## Claimed gates: D1, D2, D3, D4, D5
## Verify commands (cold, run from repo root)
```bash
python -m unittest -q
python calc.py "2+3*4"
python calc.py "(2+3)*4"
python calc.py "7/2"
python calc.py "4/2"
python calc.py "1/0" # error to stderr, exit 1
python calc.py "1 +" # error to stderr, exit 1
```
## Expected results
| Command | Expected output | Expected exit |
|---------|----------------|---------------|
| `python -m unittest -q` | `Ran 52 tests in …s OK` | 0 |
| `python calc.py "2+3*4"` | `14` | 0 |
| `python calc.py "(2+3)*4"` | `20` | 0 |
| `python calc.py "7/2"` | `3.5` | 0 |
| `python calc.py "4/2"` | `2` | 0 |
| `python calc.py "1/0"` | `error: division by zero` (stderr) | 1 |
| `python calc.py "1 +"` | `error: …` (stderr) | 1 |
## Files added
- `calc/evaluator.py``evaluate(node)` walker + `EvalError`
- `calc/test_evaluator.py` — 18 unittest cases covering D1D3
- `calc.py` — CLI entry point (D4)
## Commit SHA
3ff8ae9
## DONE