Skip to content

Conversation

avh4
Copy link
Contributor

@avh4 avh4 commented Nov 14, 2022

  • retain comments between top-level declarations
    • ... (general case)
    • ... after custom type declarations
    • ... after value declarations whose body is a case expression
  • retain comments between import statements and the first top-level declaration

As a side note, to capture the comments after a sequence of items that are parsed with a recursive function, the comments between elements were temporarily captured. In those cases, I went ahead and attached those "between" comments to the AST, even though they aren't output yet. This happened for import statements, case branches, type arguments, and custom type variants.

@avh4 avh4 changed the title [WIP] format: retain top-level comments format: retain top-level comments Nov 15, 2022
@avh4 avh4 marked this pull request as ready for review November 15, 2022 03:41
@robinheghan
Copy link
Member

Would you mind rebasing this?

@avh4
Copy link
Contributor Author

avh4 commented Nov 26, 2022

Updated!

@robinheghan robinheghan merged commit 33dd3a0 into gren-lang:main Nov 27, 2022
@robinheghan
Copy link
Member

Great work!

@avh4 avh4 deleted the retain-comments/3-top-level branch November 27, 2022 21:01
@avh4 avh4 mentioned this pull request Nov 28, 2022
31 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants