OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 library fasta.scanner.token; | 5 library fasta.scanner.token; |
6 | 6 |
7 import '../../scanner/token.dart' as analyzer; | 7 import '../../scanner/token.dart' as analyzer; |
8 | 8 |
9 import 'keyword.dart' show Keyword; | 9 import 'keyword.dart' show Keyword; |
10 | 10 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 bool get isBuiltInIdentifier => keyword.isBuiltIn; | 353 bool get isBuiltInIdentifier => keyword.isBuiltIn; |
354 | 354 |
355 String toString() => "KeywordToken($lexeme)"; | 355 String toString() => "KeywordToken($lexeme)"; |
356 | 356 |
357 @override | 357 @override |
358 Token copyWithoutComments() => new KeywordToken(keyword, charOffset); | 358 Token copyWithoutComments() => new KeywordToken(keyword, charOffset); |
359 | 359 |
360 @override | 360 @override |
361 // Analyzer considers pseudo-keywords to have a different value | 361 // Analyzer considers pseudo-keywords to have a different value |
362 Keyword value() => isPseudo ? lexeme : keyword; | 362 Object value() => isPseudo ? lexeme : keyword; |
363 | 363 |
364 @override | 364 @override |
365 // Analyzer considers pseudo-keywords to be identifiers | 365 // Analyzer considers pseudo-keywords to be identifiers |
366 analyzer.TokenType get type => isPseudo ? IDENTIFIER_INFO : KEYWORD_INFO; | 366 analyzer.TokenType get type => isPseudo ? IDENTIFIER_INFO : KEYWORD_INFO; |
367 } | 367 } |
368 | 368 |
369 /** | 369 /** |
370 * A synthetic keyword token. | 370 * A synthetic keyword token. |
371 */ | 371 */ |
372 class SyntheticKeywordToken extends KeywordToken | 372 class SyntheticKeywordToken extends KeywordToken |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 identical(value, "<=") || | 693 identical(value, "<=") || |
694 identical(value, "<") || | 694 identical(value, "<") || |
695 identical(value, "&") || | 695 identical(value, "&") || |
696 identical(value, "^") || | 696 identical(value, "^") || |
697 identical(value, "|"); | 697 identical(value, "|"); |
698 } | 698 } |
699 | 699 |
700 bool isTernaryOperator(String value) => identical(value, "[]="); | 700 bool isTernaryOperator(String value) => identical(value, "[]="); |
701 | 701 |
702 bool isMinusOperator(String value) => identical(value, "-"); | 702 bool isMinusOperator(String value) => identical(value, "-"); |
OLD | NEW |