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

New API for defining comments inside blocks: Block::add_comment #25

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

neysofu
Copy link
Contributor

@neysofu neysofu commented Dec 28, 2024

Block::items used to be a Vec<Statement> but we can turn it into a Vec<BlockItem> and add support for comments.

Note, the spec allows for comments everywhere in source files, not just inside blocks, and this PR only allows comments inside blocks. I don't particularly like that and I'm open to reworking my approach if you have any ideas!

Also added a changelog entry for both this PR as well as #24.

  • Modified a test to generate a comment, and check the output.

@garritfra
Copy link
Owner

LGTM 😊 also, thanks for adding the changelog entries. I'll stage a release later.

@garritfra garritfra merged commit f7c204d into garritfra:main Dec 28, 2024
3 of 4 checks passed
@neysofu neysofu deleted the filippo/comments branch December 29, 2024 21:11
@garritfra
Copy link
Owner

Released via v2.3.0. :)

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