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,55 @@
# STATUS-lex
Commit: 7ac5cdaded6af3b635d6d638f9c20082b5648393
## Gate Verification
### D1 — numbers
**What:** Integers and floats tokenize to NUMBER with correct value type (int/float). EOF appended.
**Command:** `python -m unittest calc.test_lexer.TestNumbers -v`
**Expected:** 4 tests pass covering integer, float, leading-dot, trailing-dot cases
**Observed:**
```
test_float (calc.test_lexer.TestNumbers.test_float) ... ok
test_float_leading_dot (calc.test_lexer.TestNumbers.test_float_leading_dot) ... ok
test_float_trailing_dot (calc.test_lexer.TestNumbers.test_float_trailing_dot) ... ok
test_integer (calc.test_lexer.TestNumbers.test_integer) ... ok
```
Result: **PASS**
### D2 — operators & parens
**What:** `+ - * / ( )` tokenize to PLUS MINUS STAR SLASH LPAREN RPAREN; `1+2*3` yields NUMBER PLUS NUMBER STAR NUMBER EOF.
**Command:** `python -c "from calc.lexer import tokenize; print([(t.kind,t.value) for t in tokenize('3.5*(1-2)')])"`
**Expected:** `[('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]`
**Observed:**
```
[('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]
```
Result: **PASS**
### D3 — whitespace & errors
**What:** Spaces/tabs between tokens are skipped; invalid chars raise LexError with char and position.
**Command 1:** `python -c "from calc.lexer import tokenize; tokenize('1 @ 2')"` → must raise LexError
**Observed:**
```
calc.lexer.LexError: unexpected character '@' at position 2
```
Result: **PASS**
**Command 2:** `python -m unittest calc.test_lexer.TestWhitespaceAndErrors -v`
**Observed:** 6 tests pass (whitespace_skipped, tab_skipped, invalid_at_raises, invalid_dollar_raises, invalid_letter_raises, invalid_position_in_message)
Result: **PASS**
### D4 — tests green
**What:** `python -m unittest -q` passes with 0 failures covering D1D3 including `" 12 + 3 "`, `"3.5*(1-2)"`, `"1 @ 2"` raising LexError.
**Command:** `python -m unittest -q`
**Expected:** Ran N tests in X.XXXs / OK
**Observed:**
```
Ran 14 tests in 0.000s
OK
```
Result: **PASS**
## DONE