2.2 KiB
2.2 KiB
REVIEW-lex — Adversary verdicts
Phase: lex
Adversary cold-started: 2026-06-15
Status
All gates verified PASS. No vetoes.
Verdicts
D1: PASS @2026-06-15T00:20Z
Evidence (cold run from work-adv):
tokenize("42") → NUMBER(42 int), EOF ✓
tokenize("3.14") → NUMBER(3.14 float) ✓
tokenize(".5") → NUMBER(0.5 float) ✓
tokenize("10.") → NUMBER(10.0 float) ✓
Plan spec: "tokenize('42') → [NUMBER(42), EOF]" — confirmed exactly.
D2: PASS @2026-06-15T00:20Z
Evidence:
kinds("1+2*3") → ['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF'] ✓
all operators +-*/() → PLUS MINUS STAR SLASH LPAREN RPAREN ✓
tokens("3.5*(1-2)") → [('NUMBER', 3.5), ('STAR','*'), ('LPAREN','('), ('NUMBER', 1),
('MINUS','-'), ('NUMBER', 2), ('RPAREN',')'), ('EOF', None)] ✓
D3: PASS @2026-06-15T00:20Z
Evidence:
tokenize(" 12 + 3 ") → ['NUMBER', 'PLUS', 'NUMBER', 'EOF'] ✓ (whitespace skipped)
tokenize("1 @ 2") → LexError: Unexpected character '@' at position 2 ✓
tokenize("$") → LexError: ... '$' ... ✓
tokenize("x") → LexError: ... 'x' at position 0 ✓
tokenize(".") → LexError: ... '.' at position 0 ✓
LexError message includes offending char AND position ✓
D4: PASS @2026-06-15T00:20Z
Evidence:
$ python -m unittest -q
----------------------------------------------------------------------
Ran 21 tests in 0.000s
OK
Exit code: 0. 21 tests, 0 failures. Required cases covered: " 12 + 3 " ✓, "3.5*(1-2)" ✓, "1 @ 2" → LexError ✓.
Adversarial probes (break-it attempts — all held)
- Empty string →
[EOF](correct) - Whitespace-only →
[EOF](correct) - Lone dot →
LexError: Unexpected character '.' at position 0(correct) ..→ LexError on lone dot (correct)1.2.3→NUMBER(1.2) NUMBER(0.3) EOF(valid lexer behavior; parser rejects)12 @ 5→ LexError at position 3 (position accuracy confirmed)- All operators in sequence
+-*/()→ correct kinds - Newline treated as whitespace (conservative, robust)
No defects found. Implementation is correct per the phase plan.