InlineScanLexer

class InlineScanLexer(source: CharSequence, recognizers: List<InlineRecognizer>, fill: (TokenData) -> Token?) : Lexer

A Lexer that scans inline-level tokens in two passes.

The first pass walks the source character by character, trying each recognizer in order at every index and turning the spans nothing claimed into InlinePiece.Raw. The second pass resolves the delimiter runs the first pass left behind into nested emphasis tokens and flattens everything else into plain text.

As in com.quarkdown.core.lexer.scan.block.BlockScanLexer, the scanned text is the source followed by one newline, so a construct that needs a line terminator is still recognized on the last line; the loop stops on the unpadded length.

Parameters

source

the content to be tokenized

recognizers

the recognizers to try, in descending order of priority

fill

constructor of the token that covers unclaimed spans, or null to leave gaps

Constructors

Link copied to clipboard
constructor(source: CharSequence, recognizers: List<InlineRecognizer>, fill: (TokenData) -> Token?)

Properties

Link copied to clipboard
open override val source: CharSequence

The content to be tokenized.

Functions

Link copied to clipboard
open override fun tokenize(): Sequence<Token>

Disassembles some raw string into smaller tokens.