-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add debbugging tools - validation and interactive debugger #17
Comments
If i am reading the code organisation right, validators could be implemented in a similar place as in pest, under the I believe they should be optional (maybe on by default) so that it is possible to write a validator that ensures the parser will run in finite time, at the cost of saying some grammars aren't valid. For that reason they should be optional, so that if the grammar writers are confident, they can take care of validating manually. Something very cool would be to integrate some keyword (like unsafe in Rust). But that would add maybe unnecessary complexity to the grammar of pest. It could also be done using specifically formatted comments (like JSDoc/Typescript), thus avoiding polluting the grammar. |
@Tartasprint thanks for your interest!
I'd say yes. At this stage, I was looking into two major refactoring that could affect it:
Yes, it's a bit of an unexplored territory: pest-parser/pest#885 (comment) It should be straightforward to do a debugger in the same way as in the current pest (i.e. just implement
Anyway, it's up to you how to approach it if decide to work on it (any approach would be valuable, I think).
If I don't consider the refactoring I mentioned, I think so (@TheVeryDarkness or should it go somewhere else?).
Maybe this could be just be on the derive annotation level (instead of inside the grammar)? For example, by default it'll validate the grammar, but one could optionally disable it? |
I gave some thought to the things you said up there. All that to say it might be better to start thinking about that event based api and then come back on the tooling. |
Yes, I didn't have the validation in mind, but in theory, separating AST generation from the parsing process should make it easier to have "pluggable" ASTs for different use cases. |
Hi ! I am so happy to see you (all of you) were able to do this first mixture of the pest3 project. I gave it a try, and it is amazing.
I noticed that two things I liked in pest:
I noticed the validators are listed in the todo file. I would like to work on implementing static validators for ensuring a parser runs in finite time.
Is that something I can do at this stage of the project ?
For the debugger, it would be nice to have, but I think it could take much more work. I can still give it a shot if it's wanted.
The text was updated successfully, but these errors were encountered: