Return a callable object that returns whether a token is any of the given types `token_types`.
(token_types)
| 1295 | |
| 1296 | |
| 1297 | def token_is_any_of(token_types): |
| 1298 | """Return a callable object that returns whether a token is any of the |
| 1299 | given types `token_types`.""" |
| 1300 | is_token_types = tuple(map(token_is, token_types)) |
| 1301 | |
| 1302 | def token_is_any_of(token): |
| 1303 | return any(check(token) for check in is_token_types) |
| 1304 | |
| 1305 | return token_is_any_of |
| 1306 | |
| 1307 | |
| 1308 | def extract_exit_value(args: tuple[Any, ...]) -> Any: |