Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
parser4k.associativity-generated.kt Maven / Gradle / Ivy
@file:Suppress("UNCHECKED_CAST", "unused")
package parser4k
import dev.forkhandles.tuples.Tuple2
import dev.forkhandles.tuples.Tuple3
import dev.forkhandles.tuples.Tuple4
import dev.forkhandles.tuples.Tuple5
import dev.forkhandles.tuples.Tuple6
import dev.forkhandles.tuples.Tuple7
import dev.forkhandles.tuples.Tuple8
/////////////////////////////////////////////////////
// This file was generated by generate-source-code.kt
/////////////////////////////////////////////////////
fun InOrder2.mapLeftAssoc(transform: (Tuple2) -> T1): Parser =
InOrder(listOf(parser1, parser2))
.mapLeftAssoc { (it1, it2) -> transform(Tuple2(it1 as T1, it2 as T2)) } as Parser
fun InOrder3.mapLeftAssoc(transform: (Tuple3) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3))
.mapLeftAssoc { (it1, it2, it3) -> transform(Tuple3(it1 as T1, it2 as T2, it3 as T3)) } as Parser
fun InOrder4.mapLeftAssoc(transform: (Tuple4) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3, parser4))
.mapLeftAssoc { (it1, it2, it3, it4) -> transform(Tuple4(it1 as T1, it2 as T2, it3 as T3, it4 as T4)) } as Parser
fun InOrder5.mapLeftAssoc(transform: (Tuple5) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3, parser4, parser5))
.mapLeftAssoc { (it1, it2, it3, it4, it5) -> transform(Tuple5(it1 as T1, it2 as T2, it3 as T3, it4 as T4, it5 as T5)) } as Parser
fun InOrder6.mapLeftAssoc(transform: (Tuple6) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3, parser4, parser5, parser6))
.mapLeftAssoc { (it1, it2, it3, it4, it5, it6) -> transform(Tuple6(it1 as T1, it2 as T2, it3 as T3, it4 as T4, it5 as T5, it6 as T6)) } as Parser
fun InOrder7.mapLeftAssoc(transform: (Tuple7) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3, parser4, parser5, parser6, parser7))
.mapLeftAssoc { (it1, it2, it3, it4, it5, it6, it7) -> transform(Tuple7(it1 as T1, it2 as T2, it3 as T3, it4 as T4, it5 as T5, it6 as T6, it7 as T7)) } as Parser
fun InOrder8.mapLeftAssoc(transform: (Tuple8) -> T1): Parser =
InOrder(listOf(parser1, parser2, parser3, parser4, parser5, parser6, parser7, parser8))
.mapLeftAssoc { (it1, it2, it3, it4, it5, it6, it7, it8) -> transform(Tuple8(it1 as T1, it2 as T2, it3 as T3, it4 as T4, it5 as T5, it6 as T6, it7 as T7, it8 as T8)) } as Parser