-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Added initial debugger implementation. #277
Conversation
Moved parsing and optimization in a separate function in pest_meta.
Thanks, this certainly helps a lot! I'm just going to braindump some more ideas I have
I also hit #279, which might be related to the debugger. |
By the way, if you need these improvements soon, you could fork my own PR and work on a separate PR. I'm happy to close this one in favor of that. |
Yep, I was planning on doing that, but last week was quite busy for me. Hoping to work on something this week. |
@hansihe, any news regarding your progress? |
based on the old PR by @dragostis: pest-parser#277 Changes that were made: - debugger core context was refactored and extracted to a lib (so that it could be used in other frontends, e.g. editor plugins) - CLI was extended using rustyline helpers to provide file completions, history etc. - applied suggestions from @hansihe from the old PR (pest-parser#277 (comment)): 1. added `ba` (add breakpoints at all rules) which is useful for stepping through the entire grammar, plus breakpoint deletions and loading input directly from readline; 2. added command line arguments. - changed the listener function to return a boolean, so that the debugger can signal back to a parsing thread to finish before reaching its input's EOF.
Made some improvements in this PR: #736 |
based on the old PR by @dragostis: pest-parser#277 Changes that were made: - debugger core context was refactored and extracted to a lib (so that it could be used in other frontends, e.g. editor plugins) - CLI was extended using rustyline helpers to provide file completions, history etc. - applied suggestions from @hansihe from the old PR (pest-parser#277 (comment)): 1. added `ba` (add breakpoints at all rules) which is useful for stepping through the entire grammar, plus breakpoint deletions and loading input directly from readline; 2. added command line arguments. - changed the listener function to return a boolean, so that the debugger can signal back to a parsing thread to finish before reaching its input's EOF. historyfile init
based on the old PR by @dragostis: pest-parser#277 Changes that were made: - debugger core context was refactored and extracted to a lib (so that it could be used in other frontends, e.g. editor plugins) - CLI was extended using rustyline helpers to provide file completions, history etc. - applied suggestions from @hansihe from the old PR (pest-parser#277 (comment)): 1. added `ba` (add breakpoints at all rules) which is useful for stepping through the entire grammar, plus breakpoint deletions and loading input directly from readline; 2. added command line arguments. - changed the listener function to return a boolean, so that the debugger can signal back to a parsing thread to finish before reaching its input's EOF. Co-authored-by: Dragoș Tiselice <[email protected]>
* feature: added a `pest_debugger` crate (fixes #98) based on the old PR by @dragostis: #277 Changes that were made: - debugger core context was refactored and extracted to a lib (so that it could be used in other frontends, e.g. editor plugins) - CLI was extended using rustyline helpers to provide file completions, history etc. - applied suggestions from @hansihe from the old PR (#277 (comment)): 1. added `ba` (add breakpoints at all rules) which is useful for stepping through the entire grammar, plus breakpoint deletions and loading input directly from readline; 2. added command line arguments. - changed the listener function to return a boolean, so that the debugger can signal back to a parsing thread to finish before reaching its input's EOF. Co-authored-by: Tomas Tauber <[email protected]> Co-authored-by: Dragoș Tiselice <[email protected]>
Fixes #98.
This implementation is quite rudimentary:
ParserState
when it reaches a breakpointI'm not completely convinced that we should merge this. But I think it makes for a decent proof-of-concept. Maybe someone would be interested in further work here? @hansihe, this should be good enough as-is for tracing 2.0 grammars.