def __iter__(self):
index, mark, next = self.nearest<EOL>while next is not None:<EOL><INDENT>data = self.transform(self.pending[:index], mark, next)<EOL>self.start = mark<EOL>self.current = next<EOL>self.pending = self.pending[index:]<EOL>if data:<EOL><INDENT>yield data<EOL><DEDENT>index, mark, next = self.nearest<EOL><DEDENT>if not self.streaming:<EOL><INDENT>data = self.transform(self.pending, mark, next)<EOL>self.start = '<STR_LIT>'<EOL>self.pending = '<STR_LIT>'<EOL>if data:<EOL><INDENT>yield data<EOL><DEDENT><DEDENT>
Yield over result chunks, consuming :attr:`pending` data.

On :attr:`streaming` mode, yield only finished states.

On non :attr:`streaming` mode, yield last state's result chunk
even if unfinished, consuming all pending data.

:yields: transformation result chunka
:ytype: str