Files
agent-orchestrator-benchmark/calculators/builder-solo/run-02/machine-docs/JOURNAL-lex.md

801 B
Raw Blame History

JOURNAL-lex

2026-06-15

Build

  • Created calc/__init__.py (empty package marker)
  • Created calc/lexer.py: Token (NamedTuple with kind and value), LexError, tokenize(src)
    • Handles integers (int), floats (float, including .5 and 10. edge cases)
    • Single-char operators: + - * / ( )
    • Whitespace (space, tab) skipped
    • Invalid chars raise LexError with char repr and position
    • Appends EOF token at end
  • Created calc/test_lexer.py: 14 unittest cases covering D1D3

Verification

  • python -m unittest -q → 14 tests, 0 failures — PASS
  • tokenize('3.5*(1-2)') → correct 8-token sequence — PASS
  • tokenize('1 @ 2') → raises LexError: unexpected character '@' at position 2 — PASS

Commit

7ac5cdaded6af3b635d6d638f9c20082b5648393