artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# JOURNAL — phase lex
|
||||
|
||||
## Implementation notes
|
||||
|
||||
- Used `dataclass` for `Token` so equality works naturally in tests.
|
||||
- `value` field: int for integers, float for floats (including `.5` and `10.`), str for operators, None for EOF.
|
||||
- Number parsing handles leading-dot (`.5`) and trailing-dot (`10.`) cases via a single scan loop tracking `has_dot`.
|
||||
- `LexError` extends `Exception` directly; message includes the char repr and position index.
|
||||
- 15 tests cover all DoD items plus edge cases (tab whitespace, `$`, letter `x`).
|
||||
Reference in New Issue
Block a user