section

fun LexerContext<*>.section(back: Int = 1, length: Int = back, offset: Int = 0): Section

Creates a section, based off the current state of the LexerContext.

When called with default values, the returned section matches the last character consumed.

Parameters

back

The amount of characters to offset back from the lexer's current index.

length

The amount of characters this section is composed off.

offset

This value added to back and length as an offset.