Closed Varriount closed 1 year ago
Hmm, I'll check how line info is exactly propagated at this time; most of the line info should be copied, but I guess there are some points where injected code does not properly get linked to a source rule.
This one is not so easy to fix I'm afraid: NPeg propagates line info at compile time to make sure any compilation or syntax errors end up pointing to the right rule, but currently there is no original lineinfo available at run time.
My advice for this one would be to run with -d:npegTrace
to see where your grammar was heading when your overflow happened. I'll leave this ticket open as a reminder, when I find some time I'll have a better look to see if this can be enhanced.
Closing this, feel free to reopen if it's still relevant.
NPeg doesn't appear to attach line information to its generated code. For instance, when the backtrace depth has been exceeded, a stack trace like the following will occur:
Ideally, the traceback would indicate (either directly, or via the generated function name) what rule caused the error.