SpanSink
class SpanSink
A mutable accumulator for Spans, used as the U (user context) type parameter when running a parser in highlighting mode.
Pass a SpanSink instance as the user context of a parsek.ParserInput. Parsers wrapped with pTag will push Spans into spans as they succeed. After parsing completes, spans contains a flat, ordered list of all highlighted ranges.
Example
val sink = SpanSink()
val input = ParserInput.of(source.toList(), sink)
pDocument()(input)
val highlights: List<Span> = sink.spansContent copied to clipboard