-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feedback for peg #255
Comments
For testing a subpeg, why not As for tracing pegs, I think that would be a neat idea. At least, we could show the disassembly in a nice format so people could hopefully understand a bit about what is happening. Stepping maybe harder, but is not out of the realm of possibility. |
|
It's not complete yet, but I've been working on an implementation of It started out as bakpakin's code from his PEG blog post and is evolving from there. In the process I have started adding a little bit of tracing output. If it appropriately supports enough of the native version's constructs, may be it could be useful for debugging some PEGs? (It doesn't quite have enough of the specials to manage the Janet grammar on the website, but I'm hoping to get there soonish.) Update: AFAICT, margaret's implementation should be on the complete side. |
Closing this for now - the original peg debugging script should work correctly. |
When debugging a large peg, sometimes its really hard to know why a given rule failed. This reminded me of this article on a regex debugger https://eigenstate.org/notes/regex-debug . Not sure if it is applicable, or how a trace/step/debug view into pegs would look. But could be quite neat to step/trace a peg.
When developing a large peg, sometimes you want to run subrules by hand to test them, this would be much easier if peg/match and/or peg/compile let you specify the entry rule somehow.
This is possible, though sort of verbose using :
The text was updated successfully, but these errors were encountered: