Classes
FenceScannerMixin
15
▼
Mixin providing fenced code mode scanning logic.
Scans content inside fenced code blocks, detectin…
FenceScannerMixin
15
▼
Mixin providing fenced code mode scanning logic.
Scans content inside fenced code blocks, detecting the closing fence.
Attributes
| Name | Type | Description |
|---|---|---|
_source |
str
|
— |
_pos |
int
|
— |
_mode |
LexerMode
|
— |
_fence_char |
str
|
— |
_fence_count |
int
|
— |
_fence_info |
str
|
— |
_fence_indent |
int
|
— |
_consumed_newline |
bool
|
— |
_directive_stack |
list[tuple[int, str]]
|
— |
Methods
Internal Methods 6 ▼
_save_location
0
▼
Save current location for O(1) token location creation.
_save_location
0
▼
def _save_location(self) -> None
_find_line_end
0
int
▼
Find end of current line.
_find_line_end
0
int
▼
def _find_line_end(self) -> int
Returns
int
_commit_to
1
▼
Commit position to line_end.
_commit_to
1
▼
def _commit_to(self, line_end: int) -> None
Parameters
| Name | Type | Description |
|---|---|---|
line_end |
— |
_location_from
1
SourceLocation
▼
Get source location from saved position.
_location_from
1
SourceLocation
▼
def _location_from(self, start_pos: int) -> SourceLocation
Parameters
| Name | Type | Description |
|---|---|---|
start_pos |
— |
Returns
SourceLocation
_is_closing_fence
1
bool
▼
Check if line is a closing fence. Implemented by FenceClassifierMixin.
_is_closing_fence
1
bool
▼
def _is_closing_fence(self, line: str) -> bool
Parameters
| Name | Type | Description |
|---|---|---|
line |
— |
Returns
bool
_scan_code_fence_content
0
Iterator[Token]
▼
Scan content inside fenced code block using window approach.
_scan_code_fence_content
0
Iterator[Token]
▼
def _scan_code_fence_content(self) -> Iterator[Token]
Returns
Iterator[Token]