-
Notifications
You must be signed in to change notification settings - Fork 5
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
Represent toplevel comments in the AST #406
Comments
We need some sort of syntax for this. I think we could take inspiration from GHC's use of notes: https://www.stackbuilders.com/insights/the-notes-of-ghc/ and introduce the
I.e. notes are a simple toplevel declaration |
We should also consider top-level doc comments for modules, e.g. prefixed |
I think we can design these features together. Personally, I dislike the fact that Rust has multiple syntaxes for doc comments both before and after elements, i.e. both |
Or wait, if we allow name-spaced references to notes then if the module |
Comments which are not doc comments are currently discarded during the lexing phase and not represented in the AST. This choice has one important downside: The comments are deleted if we perform de/-refunctionalization or use the code formatter. But toplevel comments are important in tutorials and examples, and we should guarantee that they are preserved during xfunc.
The text was updated successfully, but these errors were encountered: