Support our syntax for emphasizing certain lines of code. `expr` should be like '1 2' to emphasize lines 1 and 2 of a code block. Returns a list of integers, the line numbers to emphasize.
(expr: str)
| 41 | |
| 42 | |
| 43 | def parse_hl_lines(expr: str) -> list[int]: |
| 44 | """Support our syntax for emphasizing certain lines of code. |
| 45 | |
| 46 | `expr` should be like '1 2' to emphasize lines 1 and 2 of a code block. |
| 47 | Returns a list of integers, the line numbers to emphasize. |
| 48 | """ |
| 49 | if not expr: |
| 50 | return [] |
| 51 | |
| 52 | try: |
| 53 | return list(map(int, expr.split())) |
| 54 | except ValueError: # pragma: no cover |
| 55 | return [] |
| 56 | |
| 57 | |
| 58 | # ------------------ The Main CodeHilite Class ---------------------- |
no outgoing calls
no test coverage detected