Package-level declarations

Properties

Link copied to clipboard

Given a function call that may contain chained calls, e.g. .func1 param:{value1}::func2 param:{value2}, which would be normally tokenized as a flat list of tokens, this property returns a sequence of (function name, tokens) pairs for each function in the chain.

Functions

Link copied to clipboard

Finds the argument at the given source index in this function call. Note that, by design, the range is between the argument's delimiters, excluding the parameter name if any.

Link copied to clipboard
fun Position.getByPatternContaining(pattern: Regex, text: String): String?
Link copied to clipboard
fun Position.getChar(text: String): Char?
Link copied to clipboard
fun String.getLine(line: Int): String?
Link copied to clipboard
fun Position.getLineUntilPosition(text: String): String?
Link copied to clipboard

Finds the parameter corresponding to the argument at the given source index in this function call. The argument can be either named or positional, and the lookup happens against the provided function documentation.

Link copied to clipboard
fun offsetToPosition(text: String, offset: Int): Position

Converts a character offset in the text to a Position.

Link copied to clipboard

Returns the remainder of the parsing result, truncated to the specified index relative to the original source text.

Link copied to clipboard
fun Position.toOffset(text: String): Int

Converts a Position to a character offset (index) in the text.