Replace manual exec loop with matchAll to eliminate cross-call mutable lastIndex state on module-level TOKEN_PATTERN regex. matchAll clones the regex internally, ensuring no shared state while maintaining identical behavior and original-text offset semantics. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>