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,8 @@
# DECISIONS (append-only, shared)
## lex phase
- **Token as dataclass**: Used `@dataclass` for `Token` so future parser phases get equality, repr, and field access for free.
- **Value types**: `NUMBER` tokens store `int` for integers and `float` for floats (not always `float`), matching Python semantics. Parser/evaluator can use `isinstance` to distinguish.
- **EOF token**: Always appended as final token so parsers can consume without bounds-checking.
- **LexError message format**: `"unexpected character {ch!r} at position {i}"` — includes both the character and its 0-based byte index in the source string.