| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:front_end/src/fasta/scanner/precedence.dart'; | 5 import 'package:front_end/src/fasta/scanner/precedence.dart'; |
| 6 import 'package:front_end/src/fasta/scanner/string_scanner.dart'; | 6 import 'package:front_end/src/fasta/scanner/string_scanner.dart'; |
| 7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; | 7 import 'package:front_end/src/fasta/scanner/token.dart' as fasta; |
| 8 import 'package:front_end/src/scanner/token.dart'; | 8 import 'package:front_end/src/scanner/token.dart'; |
| 9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 5: const <String>['||'], | 450 5: const <String>['||'], |
| 451 4: const <String>['??'], | 451 4: const <String>['??'], |
| 452 3: const <String>['? :'], | 452 3: const <String>['? :'], |
| 453 2: const <String>['..'], | 453 2: const <String>['..'], |
| 454 1: const <String>['=', '*=', '/=', '+=', '-=', '&=', '^='], | 454 1: const <String>['=', '*=', '/=', '+=', '-=', '&=', '^='], |
| 455 }; | 455 }; |
| 456 precedenceTable.forEach((precedence, lexemes) { | 456 precedenceTable.forEach((precedence, lexemes) { |
| 457 for (String source in lexemes) { | 457 for (String source in lexemes) { |
| 458 var scanner = new StringScanner(source, includeComments: true); | 458 var scanner = new StringScanner(source, includeComments: true); |
| 459 var token = scanner.tokenize(); | 459 var token = scanner.tokenize(); |
| 460 expect(token.type.precedence, precedence, reason: source); | 460 expect(token.info.precedence, precedence, reason: source); |
| 461 } | 461 } |
| 462 }); | 462 }); |
| 463 } | 463 } |
| 464 | 464 |
| 465 void test_identity() { | 465 void test_identity() { |
| 466 var exceptions = <TokenType>[ | 466 var exceptions = <TokenType>[ |
| 467 // Null lexeme - no corresponding PrecedenceInfo | 467 // Null lexeme - no corresponding PrecedenceInfo |
| 468 TokenType.MULTI_LINE_COMMENT, | 468 TokenType.MULTI_LINE_COMMENT, |
| 469 TokenType.SINGLE_LINE_COMMENT, | 469 TokenType.SINGLE_LINE_COMMENT, |
| 470 TokenType.GENERIC_METHOD_TYPE_LIST, | 470 TokenType.GENERIC_METHOD_TYPE_LIST, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 assertLexeme('var', TokenType.KEYWORD); | 505 assertLexeme('var', TokenType.KEYWORD); |
| 506 assertLexeme('#!/', TokenType.SCRIPT_TAG); | 506 assertLexeme('#!/', TokenType.SCRIPT_TAG); |
| 507 assertLexeme('"foo"', TokenType.STRING); | 507 assertLexeme('"foo"', TokenType.STRING); |
| 508 | 508 |
| 509 expect(STRING_INTERPOLATION_INFO, | 509 expect(STRING_INTERPOLATION_INFO, |
| 510 same(TokenType.STRING_INTERPOLATION_EXPRESSION)); | 510 same(TokenType.STRING_INTERPOLATION_EXPRESSION)); |
| 511 expect(STRING_INTERPOLATION_IDENTIFIER_INFO, | 511 expect(STRING_INTERPOLATION_IDENTIFIER_INFO, |
| 512 same(TokenType.STRING_INTERPOLATION_IDENTIFIER)); | 512 same(TokenType.STRING_INTERPOLATION_IDENTIFIER)); |
| 513 } | 513 } |
| 514 } | 514 } |
| OLD | NEW |