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,19 @@
# JOURNAL-parse
## Implementation notes
Grammar chosen (standard arithmetic precedence):
```
expr := term (('+' | '-') term)*
term := unary (('*' | '/') unary)*
unary := '-' unary | primary
primary := NUMBER | '(' expr ')'
```
`unary` is right-recursive, which gives right-associativity to stacked unary minuses (e.g. `--5``Unary('-', Unary('-', Num(5)))`). This is standard.
`expr` and `term` are iterative loops (not recursive), so same-level operators are naturally left-associative.
The `ParseError` class is defined in `parser.py` (not lexer.py) since it's the parser's concern. All five D5 error cases raise `ParseError`, not a generic exception.
Tests assert on exact tree structure using `==` on dataclasses, not on evaluation results, per the plan's requirement.