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,112 @@
# STATUS-lex
Commit: 70b71caacd1f7334e387ff15b007573201b524b6
## Gate Results
### D1 — numbers
**Check:** `tokenize("42")``[NUMBER(42), EOF]`; also `.5`, `3.14`, `10.` tokenize to float NUMBER.
**Command:**
```bash
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)]`
Additional verified: `.5``NUMBER(0.5, float)`, `10.``NUMBER(10.0, float)`, `3.14``NUMBER(3.14, float)`
**Result: PASS**
---
### D2 — operators & parens
**Check:** `tokenize("1+2*3")``NUMBER PLUS NUMBER STAR NUMBER EOF`
**Command:**
```bash
python -c "from calc.lexer import tokenize; print([t.kind for t in tokenize('1+2*3')])"
```
**Expected:** `['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF']`
**Observed:** `['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF']`
All operator kinds verified: PLUS, MINUS, STAR, SLASH, LPAREN, RPAREN.
**Result: PASS**
---
### D3 — whitespace & errors
**Check 1 (whitespace):** `" 12 + 3 "``NUMBER PLUS NUMBER EOF`
**Command:**
```bash
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize(' 12 + 3 ')])"
```
**Expected:** `[('NUMBER', 12), ('PLUS', '+'), ('NUMBER', 3), ('EOF', None)]`
**Observed:** `[('NUMBER', 12), ('PLUS', '+'), ('NUMBER', 3), ('EOF', None)]`
**Check 2 (LexError):** `"1 @ 2"` raises `LexError` with `@` and position in message.
**Command:**
```bash
python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"
```
**Expected:** `LexError: Invalid character '@' at position 2`
**Observed:**
```
calc.lexer.LexError: Invalid character '@' at position 2
```
**Result: PASS**
---
### D4 — tests green
**Command:**
```bash
python -m unittest -q
```
**Expected:** 0 failures
**Observed:**
```
----------------------------------------------------------------------
Ran 18 tests in 0.000s
OK
```
**Result: PASS**
---
### Plan verification commands
```bash
python -m unittest -q
# Ran 18 tests in 0.000s / OK
python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('3.5*(1-2)')])"
# [('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]
python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"
# calc.lexer.LexError: Invalid character '@' at position 2
```
## DONE