Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Fix comment_references to flag keywords (#808). #809

Merged
merged 2 commits into from
Oct 20, 2017
Merged

Conversation

pq
Copy link
Member

@pq pq commented Oct 20, 2017

Update comment_references to check for keywords that are not treated as references by the parser but should be flagged by the linter.

Fixes: dart-lang/sdk#57642.

@bwilkerson

Update `comment_references` to check for keywords that are not treated as references by the parser
but should be flagged by the linter.

Fixes: #808.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.785% when pulling c12e339 on fix_comment_refs into ae88f71 on master.

String comment = token.lexeme;
int length = comment.length;
int leftIndex = comment.indexOf('[');
while (leftIndex >= 0 && leftIndex + 1 < length) {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I don't think it's necessary to test leftIndex + 1 < length. When that's false, rightIndex will be negative.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. Fixed!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 96.784% when pulling 2260f47 on fix_comment_refs into ae88f71 on master.

@pq pq merged commit 555e294 into master Oct 20, 2017
@kevmoo kevmoo deleted the fix_comment_refs branch October 20, 2017 17:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants