Like `describe_token` but for token expressions.
(expr: str)
| 191 | |
| 192 | |
| 193 | def describe_token_expr(expr: str) -> str: |
| 194 | """Like `describe_token` but for token expressions.""" |
| 195 | if ":" in expr: |
| 196 | type, value = expr.split(":", 1) |
| 197 | |
| 198 | if type == TOKEN_NAME: |
| 199 | return value |
| 200 | else: |
| 201 | type = expr |
| 202 | |
| 203 | return _describe_token_type(type) |
| 204 | |
| 205 | |
| 206 | def count_newlines(value: str) -> int: |
no test coverage detected