extendThrough

fun <T : Any> LineCursor.extendThrough(from: Int = 1, end: BlockEnd = BlockEnd.BEFORE_TERMINATOR, closes: (Line) -> T?): Pair<BlockExtent, T>?

Resolves an extent that grows up to and including the first line closes accepts, which is the shape of every fenced block.

Return

the resolved extent and what closes yielded, or null when the block never closes

Parameters

from

amount of lines already consumed, at least one

end

where the block's text ends relative to its closing line

closes

returns what the closing line yielded, or null when the line does not close the block