-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
feature: added a pest_debugger
crate (fixes #98)
#736
Conversation
be98cfc
to
1a21ad0
Compare
Hm, two unintended semver violations:
|
The first semver violation is unrelated to the current PR, it's due to this older change: https://github.com/pest-parser/pest/pull/554/files that slipped the older semver violation checks... shall we add back the original fn arity and just pass it the statics, or leave it as it is (those functions aren't probably externally depended on / they looked that they shouldn't have been made public anyway)? The second semver violation is legit... I guess two possible ways around it are: 1) create a new wrapper struct (e.g. |
or one more alternative is to change |
maybe this is the easiest / most straightforward: 7f8e605 |
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 <dragostiselice@gmail.com>
bcad813
to
c5946c3
Compare
Bummer that I introduced a SemVer violation. I agree that those functions probably shouldn't be public, but they are and we have no plans on hiding them. I think you're right that re-adding the argument and just calling it with the static variable would be a good solution. That being said, it's been a year and no one has complained. Is there any way for us to survey public usage of Pest and see if anyone is even using the functions? Could help us know 1) our options and 2) the best way to move forward.
I don't know much about this stuff (Send and Sync specifically) but your proposed solution looks like it works well. |
@NoahTheDuke if we take code available on GH as an indicator, then those functions weren't used by anyone except from within pest itself (code search only finds pest forks with those functions): https://github.com/search?q=validate_pest_keywords+language%3ARust&type=code&l=Rust |
That's great news. Then we're probably good with leaving them as is and maybe noting it in a changelog some place. |
based on the old PR by @dragostis: #277
Changes that were made:
ba
(add breakpoints at all rules) which is useful for stepping through the entire grammar, plus breakpoint deletions and loading input directly from readline;