Matchers

object Matchers

Leaf matchers shared by the scanners and by the better-parse grammars. Each returns how many characters it matches at an index, or zero for no match, which is the signature better-parse's Token.match takes.

Functions

Link copied to clipboard
fun balancedDelimiters(string: CharSequence, position: Int, begin: Char, end: Char): Int

Matches a balanced sequence delimited by begin and end, ignoring escaped delimiters.

Link copied to clipboard
fun unescapedMatch(string: CharSequence, position: Int, char: Char, onMatch: () -> Unit = {}): Int

Matches a character if it is not escaped.