Classes
ThematicClassifierMixin
2
▼
Mixin providing thematic break classification.
ThematicClassifierMixin
2
▼
Mixin providing thematic break classification.
Methods
Internal Methods 2 ▼
Create token with raw coordinates. Implemented by Lexer.
def _make_token(self, token_type: TokenType, value: str, start_pos: int, *, start_col: int | None = None, end_pos: int | None = None, line_indent: int = -1) -> Token
Parameters
| Name | Type | Description |
|---|---|---|
token_type |
— |
|
value |
— |
|
start_pos |
— |
|
start_col |
— |
Default:None
|
end_pos |
— |
Default:None
|
line_indent |
— |
Default:-1
|
Returns
Token
Try to classify content as thematic break.
Thematic breaks are 3+ of the same …
def _try_classify_thematic_break(self, content: str, line_start: int, indent: int = 0) -> Token | None
Try to classify content as thematic break.
Thematic breaks are 3+ of the same character (-, *, _) with optional spaces/tabs between them.
Parameters
| Name | Type | Description |
|---|---|---|
content |
— |
Line content with leading whitespace stripped |
line_start |
— |
Position in source where line starts |
indent |
— |
Number of leading spaces (for line_indent) Default:0
|