Perform the token test and return the token if it matched. Otherwise the return value is `None`.
(self, expr)
| 336 | next(self) |
| 337 | |
| 338 | def next_if(self, expr): |
| 339 | """Perform the token test and return the token if it matched. |
| 340 | Otherwise the return value is `None`. |
| 341 | """ |
| 342 | if self.current.test(expr): |
| 343 | return next(self) |
| 344 | |
| 345 | def skip_if(self, expr): |
| 346 | """Like :meth:`next_if` but only returns `True` or `False`.""" |