Module

lexers.xml_sm

Hand-written XML lexer using state machine approach.

O(n) guaranteed, zero regex, thread-safe.

Classes

XmlStateMachineLexer 1
XML lexer with <!-- --> comments and tag parsing.

XML lexer with comments and tag parsing.

Methods

tokenize 2 Iterator[Token]
def tokenize(self, code: str, config: LexerConfig | None = None) -> Iterator[Token]
Parameters
Name Type Description
code
config Default:None
Returns
Iterator[Token]