Go one token ahead and return the old one. Use the built-in :func:`next` instead of calling this directly.
(self)
| 347 | return self.next_if(expr) is not None |
| 348 | |
| 349 | def __next__(self): |
| 350 | """Go one token ahead and return the old one. |
| 351 | |
| 352 | Use the built-in :func:`next` instead of calling this directly. |
| 353 | """ |
| 354 | rv = self.current |
| 355 | if self._pushed: |
| 356 | self.current = self._pushed.popleft() |
| 357 | elif self.current.type is not TOKEN_EOF: |
| 358 | try: |
| 359 | self.current = next(self._iter) |
| 360 | except StopIteration: |
| 361 | self.close() |
| 362 | return rv |
| 363 | |
| 364 | def close(self): |
| 365 | """Close the stream.""" |