Skip to content

Comments

Improve section parsing (don't include the last line)#31

Merged
Hackerpilot merged 1 commit intodlang-community:masterfrom
wilzbach:fix-comments
Jun 28, 2017
Merged

Improve section parsing (don't include the last line)#31
Hackerpilot merged 1 commit intodlang-community:masterfrom
wilzbach:fix-comments

Conversation

@wilzbach
Copy link
Member

I ran into quite some trouble when trying to turn all Dscanner checks for Phobos.

I hope the added examples are self-documentary.

while (!lexer.empty && lexer.front.type == Type.whitespace)

// parentheses might be used in the key
while (!lexer.empty && lexer.front.type.among(Type.whitespace, Type.lParen, Type.rParen, Type.word))
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Having looked at the changes in Phobos it seems that Phobos was wrong...

Copy link
Contributor

Choose a reason for hiding this comment

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

Ddoc spec says:

Each line that starts with an identifier followed by an '=' starts a new parameter description.

I'm pretty sure that parens aren't part of identifiers anywhere else in D, so is it really a good idea to make an exception here?

@wilzbach
Copy link
Member Author

Having looked at the changes in Phobos it seems that Phobos was wrong...

Luckily my PR at Phobos was merged, so I could drop the {L,R}parens allowance in Ddoc parameters :)

@wilzbach wilzbach changed the title Fix comment parsing when applied to Phobos Improve section parsing (don't include the last line) Jun 28, 2017
@Hackerpilot Hackerpilot merged commit 128d60b into dlang-community:master Jun 28, 2017
@wilzbach wilzbach deleted the fix-comments branch June 28, 2017 22:59
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