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

doc annotation on modules #2247

Merged
merged 10 commits into from
Jul 15, 2024
Merged

doc annotation on modules #2247

merged 10 commits into from
Jul 15, 2024

Conversation

neunenak
Copy link
Contributor

@neunenak neunenak marked this pull request as ready for review July 14, 2024 21:33
Copy link
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good! See comments.

attribute.name(),
)
}
InvalidAttribute {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The arms of this match statement should be sorted by variant name.

src/parser.rs Outdated
@@ -430,6 +410,17 @@ impl<'run, 'src> Parser<'run, 'src> {
Some(Keyword::Alias) if self.next_are(&[Identifier, Identifier, ColonEquals]) => {
items.push(Item::Alias(self.parse_alias(attributes)?));
}
Some(Keyword::Mod)
if self.next_are(&[Identifier, Identifier, Comment])
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition is so heinous that we should deduplicate it. Maybe Parser::next_is_module?

@neunenak neunenak requested a review from casey July 15, 2024 04:15
Copy link
Owner

@casey casey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM! I refactored attribute parsing to just parse attributes before the item, then parse the item, and if the item didn't use the attributes, then return a new CompileErrorKind::ExtraneousAttribute error.

@casey casey merged commit d5ebc95 into casey:master Jul 15, 2024
5 checks passed
@neunenak neunenak deleted the mod-annotation branch August 19, 2024 05:43
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