artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
23
calculators/builder-solo/run-05/machine-docs/JOURNAL-lex.md
Normal file
23
calculators/builder-solo/run-05/machine-docs/JOURNAL-lex.md
Normal 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 D1–D3 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
|
||||
Reference in New Issue
Block a user