Skip to content
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

Provide better support for language comments #107

Closed
jsinger67 opened this issue Jun 8, 2023 · 1 comment
Closed

Provide better support for language comments #107

jsinger67 opened this issue Jun 8, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jsinger67
Copy link
Owner

Currently comments defined in a grammar using the directives %line_comment and %block_comment are simply skipped.
Since comments are often needed in scenarios like code formatting e.g. in language servers, this limits the usefulness of these directives and even forces the user to include comments in his grammar definition explicitly, which can be very cumbersome.

Therefore we need a way to provide comments to the user's grammar processing at parse time.

@jsinger67 jsinger67 added the enhancement New feature or request label Jun 8, 2023
@jsinger67 jsinger67 self-assigned this Jun 8, 2023
@jsinger67
Copy link
Owner Author

' parol' v0.22.0 in cunjunction with parol_runtime v0.17.0 provides a minimal solution.
During parse time the user is informed about parsed comments via a new method <UserType>GrammarTrait::on_comment_parsed. If the user needs comments she should provide an own implementation of this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant