| 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 import 'package:front_end/src/base/errors.dart'; | 5 import 'package:front_end/src/base/errors.dart'; |
| 6 import 'package:front_end/src/base/jenkins_smi_hash.dart'; | 6 import 'package:front_end/src/base/jenkins_smi_hash.dart'; |
| 7 import 'package:front_end/src/scanner/errors.dart'; | 7 import 'package:front_end/src/scanner/errors.dart'; |
| 8 import 'package:front_end/src/scanner/reader.dart'; | 8 import 'package:front_end/src/scanner/reader.dart'; |
| 9 import 'package:front_end/src/scanner/scanner.dart'; | 9 import 'package:front_end/src/scanner/scanner.dart'; |
| 10 import 'package:front_end/src/scanner/token.dart'; | 10 import 'package:front_end/src/scanner/token.dart'; |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 } | 534 } |
| 535 | 535 |
| 536 void test_keyword_for() { | 536 void test_keyword_for() { |
| 537 _assertKeywordToken("for"); | 537 _assertKeywordToken("for"); |
| 538 } | 538 } |
| 539 | 539 |
| 540 void test_keyword_get() { | 540 void test_keyword_get() { |
| 541 _assertKeywordToken("get"); | 541 _assertKeywordToken("get"); |
| 542 } | 542 } |
| 543 | 543 |
| 544 void test_keyword_hide() { |
| 545 _assertIdentifierToken("hide"); |
| 546 } |
| 547 |
| 544 void test_keyword_if() { | 548 void test_keyword_if() { |
| 545 _assertKeywordToken("if"); | 549 _assertKeywordToken("if"); |
| 546 } | 550 } |
| 547 | 551 |
| 548 void test_keyword_implements() { | 552 void test_keyword_implements() { |
| 549 _assertKeywordToken("implements"); | 553 _assertKeywordToken("implements"); |
| 550 } | 554 } |
| 551 | 555 |
| 552 void test_keyword_import() { | 556 void test_keyword_import() { |
| 553 _assertKeywordToken("import"); | 557 _assertKeywordToken("import"); |
| 554 } | 558 } |
| 555 | 559 |
| 556 void test_keyword_in() { | 560 void test_keyword_in() { |
| 557 _assertKeywordToken("in"); | 561 _assertKeywordToken("in"); |
| 558 } | 562 } |
| 559 | 563 |
| 560 void test_keyword_is() { | 564 void test_keyword_is() { |
| 561 _assertKeywordToken("is"); | 565 _assertKeywordToken("is"); |
| 562 } | 566 } |
| 563 | 567 |
| 564 void test_keyword_library() { | 568 void test_keyword_library() { |
| 565 _assertKeywordToken("library"); | 569 _assertKeywordToken("library"); |
| 566 } | 570 } |
| 567 | 571 |
| 572 void test_keyword_native() { |
| 573 _assertIdentifierToken("native"); |
| 574 } |
| 575 |
| 568 void test_keyword_new() { | 576 void test_keyword_new() { |
| 569 _assertKeywordToken("new"); | 577 _assertKeywordToken("new"); |
| 570 } | 578 } |
| 571 | 579 |
| 572 void test_keyword_null() { | 580 void test_keyword_null() { |
| 573 _assertKeywordToken("null"); | 581 _assertKeywordToken("null"); |
| 574 } | 582 } |
| 575 | 583 |
| 584 void test_keyword_of() { |
| 585 _assertIdentifierToken("of"); |
| 586 } |
| 587 |
| 588 void test_keyword_on() { |
| 589 _assertIdentifierToken("on"); |
| 590 } |
| 591 |
| 576 void test_keyword_operator() { | 592 void test_keyword_operator() { |
| 577 _assertKeywordToken("operator"); | 593 _assertKeywordToken("operator"); |
| 578 } | 594 } |
| 579 | 595 |
| 580 void test_keyword_part() { | 596 void test_keyword_part() { |
| 581 _assertKeywordToken("part"); | 597 _assertKeywordToken("part"); |
| 582 } | 598 } |
| 583 | 599 |
| 600 void test_keyword_patch() { |
| 601 _assertIdentifierToken("patch"); |
| 602 } |
| 603 |
| 584 void test_keyword_rethrow() { | 604 void test_keyword_rethrow() { |
| 585 _assertKeywordToken("rethrow"); | 605 _assertKeywordToken("rethrow"); |
| 586 } | 606 } |
| 587 | 607 |
| 588 void test_keyword_return() { | 608 void test_keyword_return() { |
| 589 _assertKeywordToken("return"); | 609 _assertKeywordToken("return"); |
| 590 } | 610 } |
| 591 | 611 |
| 592 void test_keyword_set() { | 612 void test_keyword_set() { |
| 593 _assertKeywordToken("set"); | 613 _assertKeywordToken("set"); |
| 594 } | 614 } |
| 595 | 615 |
| 616 void test_keyword_show() { |
| 617 _assertIdentifierToken("show"); |
| 618 } |
| 619 |
| 620 void test_keyword_source() { |
| 621 _assertIdentifierToken("source"); |
| 622 } |
| 623 |
| 596 void test_keyword_static() { | 624 void test_keyword_static() { |
| 597 _assertKeywordToken("static"); | 625 _assertKeywordToken("static"); |
| 598 } | 626 } |
| 599 | 627 |
| 600 void test_keyword_super() { | 628 void test_keyword_super() { |
| 601 _assertKeywordToken("super"); | 629 _assertKeywordToken("super"); |
| 602 } | 630 } |
| 603 | 631 |
| 604 void test_keyword_switch() { | 632 void test_keyword_switch() { |
| 605 _assertKeywordToken("switch"); | 633 _assertKeywordToken("switch"); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 } | 666 } |
| 639 | 667 |
| 640 void test_keyword_while() { | 668 void test_keyword_while() { |
| 641 _assertKeywordToken("while"); | 669 _assertKeywordToken("while"); |
| 642 } | 670 } |
| 643 | 671 |
| 644 void test_keyword_with() { | 672 void test_keyword_with() { |
| 645 _assertKeywordToken("with"); | 673 _assertKeywordToken("with"); |
| 646 } | 674 } |
| 647 | 675 |
| 676 void test_keyword_yield() { |
| 677 _assertIdentifierToken("yield"); |
| 678 } |
| 679 |
| 648 void test_lt() { | 680 void test_lt() { |
| 649 _assertToken(TokenType.LT, "<"); | 681 _assertToken(TokenType.LT, "<"); |
| 650 } | 682 } |
| 651 | 683 |
| 652 void test_lt_eq() { | 684 void test_lt_eq() { |
| 653 _assertToken(TokenType.LT_EQ, "<="); | 685 _assertToken(TokenType.LT_EQ, "<="); |
| 654 } | 686 } |
| 655 | 687 |
| 656 void test_lt_lt() { | 688 void test_lt_lt() { |
| 657 _assertToken(TokenType.LT_LT, "<<"); | 689 _assertToken(TokenType.LT_LT, "<<"); |
| (...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 _TestScanner(CharacterReader reader, [this.listener]) : super(reader); | 1411 _TestScanner(CharacterReader reader, [this.listener]) : super(reader); |
| 1380 | 1412 |
| 1381 @override | 1413 @override |
| 1382 void reportError( | 1414 void reportError( |
| 1383 ScannerErrorCode errorCode, int offset, List<Object> arguments) { | 1415 ScannerErrorCode errorCode, int offset, List<Object> arguments) { |
| 1384 if (listener != null) { | 1416 if (listener != null) { |
| 1385 listener.errors.add(new TestError(offset, 1, errorCode, arguments)); | 1417 listener.errors.add(new TestError(offset, 1, errorCode, arguments)); |
| 1386 } | 1418 } |
| 1387 } | 1419 } |
| 1388 } | 1420 } |
| OLD | NEW |