artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
# JOURNAL-parse
|
||||
|
||||
## Implementation notes
|
||||
|
||||
Grammar chose iterative (not recursive) form for expr and term to ensure left-associativity without
|
||||
risk of right-fold bugs. Unary uses right-recursive call to handle `--5` naturally.
|
||||
|
||||
Empty string: `tokenize("")` returns `[Token('EOF', None)]`. `primary()` sees EOF and raises
|
||||
ParseError — no special-case needed.
|
||||
|
||||
`"1 2"` error: `parse()` checks that after `expr()` the current token is EOF; NUMBER is not EOF, so
|
||||
ParseError raised cleanly.
|
||||
|
||||
`")("` error: `primary()` is called, sees RPAREN (not NUMBER or LPAREN), raises ParseError.
|
||||
Reference in New Issue
Block a user