OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |