match

fun LineCursor.match(lineCount: Int, endIndex: Int, wrap: (TokenData) -> Token): BlockMatch

Builds a match whose token covers the source from the cursor's line up to endIndex. Prefer the BlockExtent overload, which resolves the line count and the end together. This one serves the kinds whose text is not line-aligned: the comment, the page break and the zero-width function call flag.

Return

the resulting match

Parameters

lineCount

amount of lines the block consumed

endIndex

index just past the last character the token's text covers

wrap

constructor of the token


Builds a match from a resolved BlockExtent.

Return

the resulting match

Parameters

extent

how far the block reaches

wrap

constructor of the token