- Updates to Kotlin 1.7.20, and removes
@ExperimentalStdlibApi
now thatDeepRecursiveFunction
is now stable - Make it possible to process choice nodes with type safety. Thanks to @ephemient for the contribution!
Instead of requiring casting to access
MappedParser(ChoiceParser(FooParser(), BarParser())) { node ->
when (node) {
is Choice2Node.Option1 -> (node.node as FooNode).foo
is Choice2Node.Option2 -> (node.node as BarNode).bar
}
}
we can rely on the compiler to check
MappedParser(ChoiceParser(FooParser(), BarParser())) { node ->
when (node) {
is Choice2Node.Option1 -> node.node.foo
is Choice2Node.Option2 -> node.node.bar
}
}