artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@ -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.
|
||||
Reference in New Issue
Block a user