Exception behaviour changed
Lexer("1١")The change replaces the ASCII‑digit check (`self.current_char in DIGITS`) with `str.isdigit()`, which now accepts Unicode digits such as '١'. The PR only claims a speed‑up and does not mention expanding the accepted digit set, so the new acceptance of non‑ASCII digits is an unintended regression.
DIGITS = '0123456789'- while self.current_char is not None and (self.current_char in DIGITS or self.current_char == '.'):Found by: Ultra's planned example, hostile mutation · also caught by: Nemotron plan only
ran onToken Factory Sandboxes · image 6cbae808-5ef0-4683-8481-a6120ba99109
Regression test verified passes on base, fails on head
def test_math_interpreter_1_p2_outcome_0():
"""Breakwater P2: base behaviour pinned (found by differential testing; label: likely-bug)."""
import pytest
from lexer import Lexer
with pytest.raises(Exception) as excinfo:
result = Lexer('1١').generate_tokens()
if hasattr(result, '__next__'): # generators run when iterated
list(result)
assert type(excinfo.value) is Exception # exact type: a subclass would be a behaviour change
Reproduce
uv run breakwater probe --repo https://github.com/hoopinwhoopin/Math-Interpreter --base c7c1b7e931e8 --head 04c05ed37563 --target lexer:Lexer#generate_tokens --backend contree --input "1١"1 near-duplicate class same behaviour, inputs with extra traits
Lexer("1١ ")base raises Exception · head returns normally test verified