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

Propagate comments from parser to generated rust code #66

Open
tohrnii opened this issue Nov 5, 2022 · 4 comments
Open

Propagate comments from parser to generated rust code #66

tohrnii opened this issue Nov 5, 2022 · 4 comments
Labels

Comments

@tohrnii
Copy link
Contributor

tohrnii commented Nov 5, 2022

Currently comments written in the AirScript file are lost after parsing. We should preserve the comments and output them at the relevant places in the generated rust code.

Originally posted by @grjte in #4 (comment)

@bobbinth
Copy link
Contributor

This might be really tricky especially when we start optimizing constraint expressions and proving a more module way of describing complex constraints.

@tohrnii
Copy link
Contributor Author

tohrnii commented Nov 15, 2022

This might be really tricky especially when we start optimizing constraint expressions and proving a more module way of describing complex constraints.

Makes sense. Maybe we can limit the type of comments that get propagated? For example comments for things like constant definitions should be easy to propagate. Or if there are general comments pertaining to a whole section. If we go with this kind of restrictive kind of comments, maybe we can have a specialized syntax for comments that will get propagated and we can restrict where in the AIR file they can be used while parsing?

@bobbinth
Copy link
Contributor

Yes, I think we can come up with some good approaches here - but I'd wait until we have much more of the language implemented before tackling this (probably after we have support for spreading constraint descriptions over multiple modules/files).

@tohrnii
Copy link
Contributor Author

tohrnii commented Nov 15, 2022

Another option for this specific issue is to limit the scope of the issue to just preserve the comments in the parser for now (what @grjte originally suggested).

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

No branches or pull requests

2 participants