| Index: pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
|
| diff --git a/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart b/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
|
| index 7df6a6e3e397fffed04af3fe4081f9a22cd5c2d6..302accc17ceb11103a17604727f8e1d462fb6236 100644
|
| --- a/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
|
| +++ b/pkg/front_end/lib/src/fasta/analyzer/token_utils.dart
|
| @@ -110,22 +110,13 @@ class ToAnalyzerTokenStreamConverter {
|
| /// Translates a sequence of fasta comment tokens to the corresponding
|
| /// analyzer tokens.
|
| analyzer.CommentToken translateCommentTokens(Token token) {
|
| - analyzer.CommentToken translateOneComment(Token token) {
|
| - // TODO(paulberry,ahe): It would be nice if the scanner gave us an
|
| - // easier way to distinguish between the two types of comment.
|
| - var type = token.value.startsWith('/*')
|
| - ? TokenType.MULTI_LINE_COMMENT
|
| - : TokenType.SINGLE_LINE_COMMENT;
|
| - return new analyzer.CommentToken(type, token.value, token.charOffset);
|
| - }
|
| -
|
| analyzer.CommentToken head;
|
| if (token != null) {
|
| - head = translateOneComment(token);
|
| + head = toAnalyzerCommentToken(token);
|
| analyzer.CommentToken tail = head;
|
| token = token.next;
|
| while (token != null) {
|
| - tail = tail.setNext(translateOneComment(token));
|
| + tail = tail.setNext(toAnalyzerCommentToken(token));
|
| token = token.next;
|
| }
|
| }
|
| @@ -221,6 +212,16 @@ class ToAnalyzerTokenStreamConverter {
|
| }
|
| }
|
|
|
| +/// Converts a single Fasta comment token to an analyzer comment token.
|
| +analyzer.CommentToken toAnalyzerCommentToken(Token token) {
|
| + // TODO(paulberry,ahe): It would be nice if the scanner gave us an
|
| + // easier way to distinguish between the two types of comment.
|
| + var type = token.value.startsWith('/*')
|
| + ? TokenType.MULTI_LINE_COMMENT
|
| + : TokenType.SINGLE_LINE_COMMENT;
|
| + return new analyzer.CommentToken(type, token.value, token.charOffset);
|
| +}
|
| +
|
| /// Converts a stream of Analyzer tokens (starting with [token] and continuing
|
| /// to EOF) to a stream of Fasta tokens.
|
| ///
|
|
|