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,23 @@
# JOURNAL-lex
## 2026-06-15
### Build
Created `calc/__init__.py` (empty package marker) and `calc/lexer.py` implementing:
- `Token` dataclass with `kind` (str) and `value` (int | float | None)
- `LexError(Exception)` raised on invalid characters with offending char and position
- `tokenize(src: str) -> list[Token]` covering numbers (int/float, leading/trailing dot), operators, parens, whitespace skipping, and error raising
- `EOF` singleton token appended at end of every token list
Created `calc/test_lexer.py` with 18 unittest cases covering D1D3 including the three mandatory inputs.
### Verification
All four DoD gates observed passing:
- D1: integers, floats (3.14, .5, 10.) tokenize correctly with right Python type
- D2: all six operator/paren kinds correct; `1+2*3` yields expected sequence
- D3: whitespace skipped; `@` raises LexError with position 2 in message
- D4: 18 tests, 0 failures
Commit: 70b71caacd1f7334e387ff15b007573201b524b6