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 import '../../scanner/token.dart' show TokenType; | 8 import '../../scanner/token.dart' show TokenType; |
9 | 9 |
10 import 'token_constants.dart' show IDENTIFIER_TOKEN; | 10 import 'token_constants.dart' show IDENTIFIER_TOKEN; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 @override | 295 @override |
296 Token copyWithoutComments() => isEof | 296 Token copyWithoutComments() => isEof |
297 ? new SymbolToken.eof(charOffset) | 297 ? new SymbolToken.eof(charOffset) |
298 : new SyntheticSymbolToken(info, charOffset); | 298 : new SyntheticSymbolToken(info, charOffset); |
299 } | 299 } |
300 | 300 |
301 /** | 301 /** |
302 * A [BeginGroupToken] represents a symbol that may be the beginning of | 302 * A [BeginGroupToken] represents a symbol that may be the beginning of |
303 * a pair of brackets, i.e., ( { [ < or ${ | 303 * a pair of brackets, i.e., ( { [ < or ${ |
304 * The [endGroup] token points to the matching closing bracked in case | 304 * The [endGroup] token points to the matching closing bracket in case |
305 * it can be identified during scanning. | 305 * it can be identified during scanning. |
306 */ | 306 */ |
307 class BeginGroupToken extends SymbolToken | 307 class BeginGroupToken extends SymbolToken |
308 implements analyzer.BeginTokenWithComment { | 308 implements analyzer.BeginTokenWithComment { |
309 Token endGroup; | 309 Token endGroup; |
310 | 310 |
311 BeginGroupToken(TokenType info, int charOffset) : super(info, charOffset); | 311 BeginGroupToken(TokenType info, int charOffset) : super(info, charOffset); |
312 | 312 |
313 @override | 313 @override |
314 analyzer.Token get endToken => endGroup; | 314 analyzer.Token get endToken => endGroup; |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 identical(value, "<=") || | 682 identical(value, "<=") || |
683 identical(value, "<") || | 683 identical(value, "<") || |
684 identical(value, "&") || | 684 identical(value, "&") || |
685 identical(value, "^") || | 685 identical(value, "^") || |
686 identical(value, "|"); | 686 identical(value, "|"); |
687 } | 687 } |
688 | 688 |
689 bool isTernaryOperator(String value) => identical(value, "[]="); | 689 bool isTernaryOperator(String value) => identical(value, "[]="); |
690 | 690 |
691 bool isMinusOperator(String value) => identical(value, "-"); | 691 bool isMinusOperator(String value) => identical(value, "-"); |
OLD | NEW |