Functions
is_simple_list
2
bool
▼
Check if the list starting at start_pos qualifies for fast path.
Pre-scans tok…
is_simple_list
2
bool
▼
def is_simple_list(tokens: list, start_pos: int) -> bool
Check if the list starting at start_pos qualifies for fast path.
Pre-scans tokens to determine if all criteria are met. This is O(n) but much cheaper than the full parse decision tree.
Parameters
| Name | Type | Description |
|---|---|---|
tokens |
list |
Full token list |
start_pos |
int |
Position of first LIST_ITEM_MARKER token |
Returns
bool
parse_simple_list
3
tuple[List, int]
▼
Parse a simple list using the fast path.
PRECONDITION: is_simple_list(tokens, …
parse_simple_list
3
tuple[List, int]
▼
def parse_simple_list(tokens: list, start_pos: int, parse_inline_fn: Callable[[str, SourceLocation], tuple[Inline, ...]]) -> tuple[List, int]
Parse a simple list using the fast path.
PRECONDITION: is_simple_list(tokens, start_pos) returned True.
Parameters
| Name | Type | Description |
|---|---|---|
tokens |
list |
Full token list |
start_pos |
int |
Position of first LIST_ITEM_MARKER token |
parse_inline_fn |
Callable[[str, SourceLocation], tuple[Inline, ...]] |
Function to parse inline content |
Returns
tuple[List, int]
_is_complex_content
1
bool
▼
Check if paragraph content requires complex parsing.
Returns True if content c…
_is_complex_content
1
bool
▼
def _is_complex_content(content: str) -> bool
Check if paragraph content requires complex parsing.
Returns True if content contains patterns that need special handling.
Parameters
| Name | Type | Description |
|---|---|---|
content |
str |
Returns
bool