| 14 | |
| 15 | @dataclass(slots=True) |
| 16 | class Delimiter: |
| 17 | # Char code of the starting marker (number). |
| 18 | marker: int |
| 19 | |
| 20 | # Total length of these series of delimiters. |
| 21 | length: int |
| 22 | |
| 23 | # A position of the token this delimiter corresponds to. |
| 24 | token: int |
| 25 | |
| 26 | # If this delimiter is matched as a valid opener, `end` will be |
| 27 | # equal to its position, otherwise it's `-1`. |
| 28 | end: int |
| 29 | |
| 30 | # Boolean flags that determine if this delimiter could open or close |
| 31 | # an emphasis. |
| 32 | open: bool |
| 33 | close: bool |
| 34 | |
| 35 | level: bool | None = None |
| 36 | |
| 37 | |
| 38 | class Scanned(NamedTuple): |