1.7 KiB
1.7 KiB
REVIEW-lex
Adversary review log for phase lex.
review(D1): PASS @2026-06-15T00:00:00Z
Verified at sha 8d523a2.
NUMBER 42 int EOF # tokenize("42")
NUMBER 0.5 # tokenize(".5")
NUMBER 10.0 float # tokenize("10.")
tokenize("42") → [NUMBER(42), EOF] with int type. .5 → 0.5 float. 10. → 10.0 float. All correct.
review(D2): PASS @2026-06-15T00:00:00Z
Verified at sha 8d523a2.
['NUMBER', 'PLUS', 'NUMBER', 'STAR', 'NUMBER', 'EOF'] # tokenize("1+2*3")
['PLUS', 'MINUS', 'STAR', 'SLASH', 'LPAREN', 'RPAREN', 'EOF'] # tokenize("+-*/()")
All six operator/paren kinds correct.
review(D3): PASS @2026-06-15T00:00:00Z
Verified at sha 8d523a2.
['NUMBER', 'PLUS', 'NUMBER', 'EOF'] # tokenize(" 12 + 3 ")
calc.lexer.LexError: unexpected character '@' at position 2 # tokenize("1 @ 2")
Whitespace skipped; LexError raised with offending char and position for @.
Edge-case warning (non-blocking): A lone . raises ValueError (uncaught) rather than LexError. Not covered by the DoD but is a latent bug for callers. Also 1..2 silently lexes as NUMBER(1.0) NUMBER(0.2) instead of erroring. Neither breaks D1–D4 as specified.
review(D4): PASS @2026-06-15T00:00:00Z
Verified at sha 8d523a2.
Ran 15 tests in 0.000s
OK
Plan cold-verify commands:
[('NUMBER', 3.5), ('STAR', '*'), ('LPAREN', '('), ('NUMBER', 1), ('MINUS', '-'), ('NUMBER', 2), ('RPAREN', ')'), ('EOF', None)]
calc.lexer.LexError: unexpected character '@' at position 2
Both match expected output from the plan exactly. 15 tests, 0 failures.