Chromium Code Reviews| Index: pkg/analyzer/lib/src/generated/parser.dart |
| diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
| index 905a732668ec75e243621b0f3e47a79764cfd0b3..e04c365b10e4d8c97e23ad99037260a05631619b 100644 |
| --- a/pkg/analyzer/lib/src/generated/parser.dart |
| +++ b/pkg/analyzer/lib/src/generated/parser.dart |
| @@ -5458,9 +5458,10 @@ class Parser { |
| * @param tokens the comment tokens representing the documentation comments to be parsed |
| * @return the comment references that were parsed |
| */ |
| - List<CommentReference> _parseCommentReferences(List<CommentToken> tokens) { |
| + List<CommentReference> |
| + _parseCommentReferences(List<DocumentationCommentToken> tokens) { |
| List<CommentReference> references = new List<CommentReference>(); |
| - for (CommentToken token in tokens) { |
| + for (DocumentationCommentToken token in tokens) { |
| String comment = token.lexeme; |
| int length = comment.length; |
| List<List<int>> codeBlockRanges = _getCodeBlockRanges(comment); |
| @@ -6017,41 +6018,23 @@ class Parser { |
| * @return the documentation comment that was parsed, or `null` if there was no comment |
| */ |
| Comment _parseDocumentationComment() { |
| - List<CommentToken> commentTokens = <CommentToken>[]; |
| + List<DocumentationCommentToken> documentationTokens = |
| + <DocumentationCommentToken>[ |
| + ]; |
| CommentToken commentToken = _currentToken.precedingComments; |
| while (commentToken != null) { |
| - if (commentToken.type == TokenType.SINGLE_LINE_COMMENT) { |
| - if (StringUtilities.startsWith3( |
| - commentToken.lexeme, |
| - 0, |
| - 0x2F, |
| - 0x2F, |
| - 0x2F)) { |
| - if (commentTokens.length == 1 && |
| - StringUtilities.startsWith3(commentTokens[0].lexeme, 0, 0x2F, 0x2A, 0x2A)) { |
| - commentTokens.clear(); |
| - } |
| - commentTokens.add(commentToken); |
| - } |
| - } else { |
| - if (StringUtilities.startsWith3( |
| - commentToken.lexeme, |
| - 0, |
| - 0x2F, |
| - 0x2A, |
| - 0x2A)) { |
| - commentTokens.clear(); |
| - commentTokens.add(commentToken); |
| - } |
| + if (commentToken is DocumentationCommentToken) { |
| + documentationTokens.add(commentToken); |
|
Brian Wilkerson
2014/12/01 23:08:43
This doesn't give us the semantics we want (obviou
scheglov
2014/12/01 23:27:53
Done.
|
| } |
| commentToken = commentToken.next; |
| } |
| - if (commentTokens.isEmpty) { |
| + if (documentationTokens.isEmpty) { |
| return null; |
| } |
| - List<CommentReference> references = _parseCommentReferences(commentTokens); |
| + List<CommentReference> references = |
| + _parseCommentReferences(documentationTokens); |
| return Comment.createDocumentationCommentWithReferences( |
| - commentTokens, |
| + documentationTokens, |
| references); |
| } |