| 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 'keyword.dart' show Keyword; | 7 import 'keyword.dart' show Keyword; |
| 8 | 8 |
| 9 import 'precedence.dart' show BAD_INPUT_INFO, EOF_INFO, PrecedenceInfo; | 9 import 'precedence.dart' show BAD_INPUT_INFO, EOF_INFO, PrecedenceInfo; |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } else { | 117 } else { |
| 118 return lexeme.length; | 118 return lexeme.length; |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 /// The character offset of the end of this token within the source text. | 122 /// The character offset of the end of this token within the source text. |
| 123 int get charEnd => charOffset + charCount; | 123 int get charEnd => charOffset + charCount; |
| 124 | 124 |
| 125 bool get isEof => false; | 125 bool get isEof => false; |
| 126 | 126 |
| 127 @override | |
| 128 bool get isOperator => info.isOperator; | 127 bool get isOperator => info.isOperator; |
| 129 } | 128 } |
| 130 | 129 |
| 131 /** | 130 /** |
| 132 * A [SymbolToken] represents the symbol in its precedence info. | 131 * A [SymbolToken] represents the symbol in its precedence info. |
| 133 * Also used for end of file with EOF_INFO. | 132 * Also used for end of file with EOF_INFO. |
| 134 */ | 133 */ |
| 135 class SymbolToken extends Token { | 134 class SymbolToken extends Token { |
| 136 final PrecedenceInfo info; | 135 final PrecedenceInfo info; |
| 137 | 136 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 identical(value, "<=") || | 370 identical(value, "<=") || |
| 372 identical(value, "<") || | 371 identical(value, "<") || |
| 373 identical(value, "&") || | 372 identical(value, "&") || |
| 374 identical(value, "^") || | 373 identical(value, "^") || |
| 375 identical(value, "|"); | 374 identical(value, "|"); |
| 376 } | 375 } |
| 377 | 376 |
| 378 bool isTernaryOperator(String value) => identical(value, "[]="); | 377 bool isTernaryOperator(String value) => identical(value, "[]="); |
| 379 | 378 |
| 380 bool isMinusOperator(String value) => identical(value, "-"); | 379 bool isMinusOperator(String value) => identical(value, "-"); |
| OLD | NEW |