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,41 @@
# STATUS — phase lex
## Gates
### D1 — numbers
**Command:** `python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('42')])"`
**Expected:** `[('NUMBER', 42), ('EOF', None)]`
**Observed:** `[('NUMBER', 42), ('EOF', None)]`
Also verified: `3.14``NUMBER(3.14)` (float), `.5``NUMBER(0.5)` (float), `10.``NUMBER(10.0)` (float).
### D2 — operators & parens
**Command:** `python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('1+2*3')])"`
**Expected:** NUMBER PLUS NUMBER STAR NUMBER EOF
**Observed:** `[('NUMBER', 1), ('PLUS', '+'), ('NUMBER', 2), ('STAR', '*'), ('NUMBER', 3), ('EOF', None)]`
### D3 — whitespace & errors
**Command (whitespace):** `python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize(' 12 + 3 ')])"`
**Observed:** `[('NUMBER', 12), ('PLUS', '+'), ('NUMBER', 3), ('EOF', None)]`
**Command (LexError):** `python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"`
**Expected:** raises LexError with '@' and position in message
**Observed:** `calc.lexer.LexError: unexpected character '@' at position 2`
### D4 — tests green
**Command:** `python -m unittest -q`
**Expected:** 0 failures
**Observed:**
```
----------------------------------------------------------------------
Ran 13 tests in 0.001s
OK
```
**Complex expression check:**
**Command:** `python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('3.5*(1-2)')])"`
**Observed:** `[('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]`
## DONE