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