artifacts: add calculators/ — the 30 built calculators (5/variant) + machine-docs + git logs
This commit is contained in:
21
calculators/builder-solo/run-02/machine-docs/JOURNAL-lex.md
Normal file
21
calculators/builder-solo/run-02/machine-docs/JOURNAL-lex.md
Normal file
@ -0,0 +1,21 @@
|
||||
# JOURNAL-lex
|
||||
|
||||
## 2026-06-15
|
||||
|
||||
### Build
|
||||
- Created `calc/__init__.py` (empty package marker)
|
||||
- Created `calc/lexer.py`: `Token` (NamedTuple with `kind` and `value`), `LexError`, `tokenize(src)`
|
||||
- Handles integers (int), floats (float, including `.5` and `10.` edge cases)
|
||||
- Single-char operators: `+ - * / ( )`
|
||||
- Whitespace (space, tab) skipped
|
||||
- Invalid chars raise `LexError` with char repr and position
|
||||
- Appends `EOF` token at end
|
||||
- Created `calc/test_lexer.py`: 14 unittest cases covering D1–D3
|
||||
|
||||
### Verification
|
||||
- `python -m unittest -q` → 14 tests, 0 failures — PASS
|
||||
- `tokenize('3.5*(1-2)')` → correct 8-token sequence — PASS
|
||||
- `tokenize('1 @ 2')` → raises `LexError: unexpected character '@' at position 2` — PASS
|
||||
|
||||
### Commit
|
||||
`7ac5cdaded6af3b635d6d638f9c20082b5648393`
|
||||
Reference in New Issue
Block a user