repeatedExactly

fun <T> EvalPE<T>.repeatedExactly(times: UInt): EvalPE<List<T>>

Repeat parsing expression exactly the given times.

Samples

import io.kpeg.pe.Symbol.Rule
fun main() { 
   //sampleStart 
   // a    - FAIL
// aa   - FAIL
// aaa  - OK
// aaaa - FAIL

char('a')                        // EvalPE<Char>
    .repeatedExactly(times = 3u) // EvalPE<List<Char>> 
   //sampleEnd
}

Sources

JVM source
Link copied to clipboard