On Fri, Feb 14, 2020 at 7:44 AM Marco Pivetta <ocram...@gmail.com> wrote:
> On Fri, Feb 14, 2020 at 2:38 PM Sara Golemon <poll...@php.net> wrote: > >> Thanks for picking it up, and I agree with your response to Larry. As >> nice >> as it would be to lazy iterate, the scanner is just in NO shape to >> tolerate >> reentering userspace and potentially reinvoking the scanner before the >> first run through is done. >> > > If this is the current state, maybe it would suffice to declare the return > type as `iterable`, and return a strict (fully populated) structure in a > first implementation, later to be changed to an iterator, if applicable? > > I think that's an optimistic, but ultimately harmless approach. Arrays satisfy Iterables. Worst case we never improve on that. Best case we get iterable token generators. +1 -Sara