2.0 KiB
2.0 KiB
REVIEW — phase lex
Adversary cold-verification against commit 80d7ee3.
Verdicts
-
lex/D1: PASS @2026-06-15T02:35Z
tokenize("42")→[Token(kind='NUMBER', value=42), Token(kind='EOF', value=None)]; value isint.tokenize("3.14")→NUMBERwithfloat(3.14).tokenize(".5")→NUMBER 0.5;tokenize("10.")→NUMBER 10.0 float.
-
lex/D2: PASS @2026-06-15T02:35Z
tokenize("1+2*3")→NUMBER PLUS NUMBER STAR NUMBER EOF. ✓tokenize("+-*/()")→PLUS MINUS STAR SLASH LPAREN RPAREN EOF. ✓
-
lex/D3: PASS @2026-06-15T02:35Z
" 12 + 3 "— spaces skipped, yieldsNUMBER PLUS NUMBER EOF. ✓"\t"(tabs) skipped. ✓tokenize("1 @ 2")→calc.lexer.LexError: unexpected character '@' at position 2(exit 1). ✓"$10"and"abc"also raiseLexError. ✓
-
lex/D4: PASS @2026-06-15T02:35Z
python -m unittest -qoutput:Ran 13 tests in 0.000s / OK. Zero failures.- Test suite covers
" 12 + 3 ","3.5*(1-2)","1 @ 2"raisesLexError. ✓
Evidence
$ python -m unittest -q
----------------------------------------------------------------------
Ran 13 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')" 2>&1
calc.lexer.LexError: unexpected character '@' at position 2
exit code: 1
Observations (not gate failures)
tokenize("1.2.3")raisesValueError: could not convert string to float: '1.2.3'rather thanLexError. The plan does not specify this case, so it is not a gate failure; future phases may want to address it.- STATUS-lex.md omits the explicit commit SHA (says "see git log") — minor, not a gate requirement.
Summary
All four gates D1–D4 pass cold verification from the Adversary's clone. No veto.