repeated

fun Any.repeated(min: Int = 1, max: Int? = null): RepeatedRecognizer

Create a recognizer that recognizes the given recognizer or pseudo-recognizer min to max (inclusive) times in a row. By default, the (pseudo)-recognizer is recognized from 1 to an infinite amount of times.

Any recognizer or pseudo-recognizer that is supported by toRecognizer can be used here.

Return

A RepeatedRecognizer that uses the constraints provided in the parameters.

Parameters

min

The minimum amount of repetitions required to get a successful match. If the number of repetitions is below the minimum, the recognition fails.

max

The maximum amount of repetitions required to get a successful match, or null if no such limit should exist. If the number of repetitions exceeds the maximum, the recognition fails.


Create a recognizer that recognizes the given recognizer or pseudo-recognizer 1 or more times in a row.

This construct supports any (pseudo-)recognizer that is supported by toRecognizer.

Return

A RepeatedRecognizer using the given recognizer/pseudo-recognizer.