It assumes that context!!.readParent() returns non-null parent, but it actually returns null for my syntax, because the left recursion occurs at top level. Here is the screenshot on diagnosing that state:
Confirmed with 0951069 on Ubuntu 20.04, multiplatform (jvm at runtime)
I'm creating a one liner PR that fixes this issue that makes it not crash.
I have some syntax that causes run-time crash, saying:
(stacktrack omitted as they mostly mention my code.)
My syntax defines left-recursion like
A : B | A B
which I assume is the cause of the problem.Here is the mentioned suspect in the trace:
https://github.com/Strumenta/antlr-kotlin/blob/0951069063d9bbe249eebb981925217a12f55f14/antlr-kotlin-runtime/src/commonMain/kotlin/org/antlr/v4/kotlinruntime/Parser.kt#L722
It assumes that
context!!.readParent()
returns non-null parent, but it actually returns null for my syntax, because the left recursion occurs at top level. Here is the screenshot on diagnosing that state:Confirmed with 0951069 on Ubuntu 20.04, multiplatform (jvm at runtime)
I'm creating a one liner PR that fixes this issue that makes it not crash.