Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1944)

Side by Side Diff: pkg/front_end/lib/src/scanner/token.dart

Issue 2795243002: fix fasta/analyzer KeywordToken.value() (Closed)
Patch Set: remove unused import Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/token.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Defines the tokens that are produced by the scanner, used by the parser, and 6 * Defines the tokens that are produced by the scanner, used by the parser, and
7 * referenced from the [AST structure](ast.dart). 7 * referenced from the [AST structure](ast.dart).
8 */ 8 */
9 import 'dart:collection'; 9 import 'dart:collection';
10 10
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 */ 351 */
352 KeywordToken(this.keyword, int offset) : super(TokenType.KEYWORD, offset); 352 KeywordToken(this.keyword, int offset) : super(TokenType.KEYWORD, offset);
353 353
354 @override 354 @override
355 String get lexeme => keyword.syntax; 355 String get lexeme => keyword.syntax;
356 356
357 @override 357 @override
358 Token copy() => new KeywordToken(keyword, offset); 358 Token copy() => new KeywordToken(keyword, offset);
359 359
360 @override 360 @override
361 Keyword value() => keyword; 361 // Changed return type from Keyword to Object because
362 // fasta considers pseudo-keywords to be keywords rather than identifiers
363 Object value() => keyword;
362 } 364 }
363 365
364 /** 366 /**
365 * A keyword token that is preceded by comments. 367 * A keyword token that is preceded by comments.
366 */ 368 */
367 class KeywordTokenWithComment extends KeywordToken implements TokenWithComment { 369 class KeywordTokenWithComment extends KeywordToken implements TokenWithComment {
368 /** 370 /**
369 * The first comment in the list of comments that precede this token. 371 * The first comment in the list of comments that precede this token.
370 */ 372 */
371 @override 373 @override
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 1190
1189 void set precedingComments(CommentToken comment) { 1191 void set precedingComments(CommentToken comment) {
1190 _precedingComment = comment; 1192 _precedingComment = comment;
1191 _setCommentParent(_precedingComment); 1193 _setCommentParent(_precedingComment);
1192 } 1194 }
1193 1195
1194 @override 1196 @override
1195 Token copy() => 1197 Token copy() =>
1196 new TokenWithComment(type, offset, copyComments(precedingComments)); 1198 new TokenWithComment(type, offset, copyComments(precedingComments));
1197 } 1199 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/token.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698