Perform the token test and return the token if it matched. Otherwise the return value is `None`.
(self, expr: str)
| 363 | next(self) |
| 364 | |
| 365 | def next_if(self, expr: str) -> t.Optional[Token]: |
| 366 | """Perform the token test and return the token if it matched. |
| 367 | Otherwise the return value is `None`. |
| 368 | """ |
| 369 | if self.current.test(expr): |
| 370 | return next(self) |
| 371 | |
| 372 | return None |
| 373 | |
| 374 | def skip_if(self, expr: str) -> bool: |
| 375 | """Like :meth:`next_if` but only returns `True` or `False`.""" |