github copper-leaf/kudzu 4.0.0

latest releases: 5.3.0, 5.2.0, 5.1.0...
2 years ago
  • Updates to Kotlin 1.7.20, and removes @ExperimentalStdlibApi now that DeepRecursiveFunction 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
    }
}

Don't miss a new kudzu release

NewReleases is sending notifications on new releases.