chumsky
chumsky copied to clipboard
Examples for using Parser::debug()
Can you share any examples for using the debug() parser? It requires a single argument, x
I've tried wrapping another parser in debug(), and tried adding it as the final combinator, but neither would compile.
The debugging features of Chumsky are still quite early in development and I'm still doing some thinking about how I want to proceed with them.
It requires a single argument, x, but the documentation doesn't specify what this should be.
It can be literally anything that you want to use to label a particular parser in the debugging output. I tend to use things like "expression"
, "pattern"
, "atom"
, etc. depending on the context. It doesn't mean anything to the debugger, it just gets used to identify it in the output.
Ah, thanks! Would it be worth me doing a PR to add a sentence to the documentation, or is this likely to change too much as you add debugging features?
Some documentation would be useful, yes! I'll also open an issue regard parser debugging to help flesh out some ideas about how it should work.
(The issue is here: #19 )
Closing in favour of #19.