literal

fun literal(len: Int, b: LiteralBuilderBlock): EvalPE<String>

Parsing expression that represents any literal of length len that satisfies the b lambda.

Samples

import io.kpeg.pe.Symbol.Rule
fun main() { 
   //sampleStart 
   // Bob - OK
// bob - OK
// BOB - OK

literal(len = 3) {
    it.equals("Bob", ignoreCase = true)
} // EvalPE<String> 
   //sampleEnd
}
fun literal(l: String): EvalPE<String>

Parsing expression that represents the literal l.

Samples

import io.kpeg.pe.Symbol.Rule
fun main() { 
   //sampleStart 
   // Alice - OK
// alice - FAIL
// ALICE - FAIL

literal("Alice") // EvalPE<String> 
   //sampleEnd
}