Module

lexer.classifiers.list

List marker classifier mixin.

Classes

ListClassifierMixin 4
Mixin providing list marker classification.

Mixin providing list marker classification.

Methods

Internal Methods 4
_location_from 3 SourceLocation
Get source location from saved position. Implemented by Lexer.
def _location_from(self, start_pos: int, start_col: int | None = None, end_pos: int | None = None) -> SourceLocation
Parameters
Name Type Description
start_pos
start_col Default:None
end_pos Default:None
Returns
SourceLocation
_calc_indent 1 tuple[int, int]
Calculate indent level. Implemented by Lexer.
def _calc_indent(self, line: str) -> tuple[int, int]
Parameters
Name Type Description
line
Returns
tuple[int, int]
_try_classify_list_marker 3 Iterator[Token] | None
Try to classify content as list item marker.
def _try_classify_list_marker(self, content: str, line_start: int, indent: int = 0) -> Iterator[Token] | None
Parameters
Name Type Description
content
line_start
indent Default:0
Returns
Iterator[Token] | None
_yield_list_marker_and_content 4 Iterator[Token]
Yield list marker token and optional content tokens. Content after the marker …
def _yield_list_marker_and_content(self, marker: str, remaining: str, line_start: int, indent: int = 0) -> Iterator[Token]

Yield list marker token and optional content tokens.

Content after the marker is checked for block-level elements:

  • Thematic breaks (* * *, - - -, etc.)
  • Fenced code blocks
  • Block quotes
  • ATX headings
  • Nested list markers
Parameters
Name Type Description
marker
remaining
line_start
indent Default:0
Returns
Iterator[Token]