artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
# JOURNAL — phase eval
|
||||
|
||||
## Implementation notes
|
||||
|
||||
- `evaluate()` walks the AST recursively using isinstance checks on Num/BinOp/Unary.
|
||||
- `_coerce()` converts whole-valued floats to int (e.g. `4/2 → 2`).
|
||||
- Division by zero raises `EvalError` (not the bare `ZeroDivisionError`).
|
||||
- `calc.py` CLI catches `LexError`, `ParseError`, `EvalError` and prints to stderr with exit 1.
|
||||
- Test suite has 49 total tests (lex + parse + eval); CLI tests use subprocess to exercise the full pipeline end-to-end.
|
||||
Reference in New Issue
Block a user