not

fun not(pe: EvalPE<*>): EvalPE<Unit>

"Not" predicate on the pe parsing expression. It succeed iff pe fails.

It worth noting that the pe won't be consumed, this is, its only a predicate and not something, that would be parsed. Thus, repeating it will yield the same result.

Samples

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

not(char('a')) 
   //sampleEnd
}

Sources

JVM source
Link copied to clipboard