Package-level declarations

Types

Link copied to clipboard

A regex pattern with a name, that can be used with groupify to group multiple patterns into a bigger pattern.

Link copied to clipboard
data class TokenRegexPattern(val name: String, val wrap: (TokenData) -> Token, val regex: String, val groupNames: List<String> = emptyList(), val walker: (TokenData, CharSequence) -> WalkedToken?? = null) : NamedRegexPattern

A Regex pattern that captures a corresponding Node from a raw string.

Link copied to clipboard
data class WalkedToken(val token: Token, val charsConsumed: Int)

Result of a walker invocation during tokenization. Produced by patterns that require secondary scanning beyond what regex can capture (e.g., balanced delimiters in function call arguments).

Functions

Link copied to clipboard

Groups a sequence of patterns into a single Regex where every capture group is identified by its token type (name). The result is cached so that repeated calls with the same patterns reuse the compiled Regex.