Skip to content

4.0.0

Choose a tag to compare

@github-actions github-actions released this 05 Oct 23:54
· 32 commits to main since this release
  • 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
    }
}