| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.parser_test; | 8 library engine.parser_test; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 2580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2591 // "f() => 0; g() {}" | 2591 // "f() => 0; g() {}" |
| 2592 _assertParse("f()", "", " => 0; g()", " {}"); | 2592 _assertParse("f()", "", " => 0; g()", " {}"); |
| 2593 } | 2593 } |
| 2594 | 2594 |
| 2595 void test_insert_end() { | 2595 void test_insert_end() { |
| 2596 // "class A {}" | 2596 // "class A {}" |
| 2597 // "class A {} class B {}" | 2597 // "class A {} class B {}" |
| 2598 _assertParse("class A {}", "", " class B {}", ""); | 2598 _assertParse("class A {}", "", " class B {}", ""); |
| 2599 } | 2599 } |
| 2600 | 2600 |
| 2601 void test_insert_final_before_field_declaration() { |
| 2602 _assertParse('class C { ', '', 'final ', 'int x; }'); |
| 2603 } |
| 2604 |
| 2601 void test_insert_insideClassBody() { | 2605 void test_insert_insideClassBody() { |
| 2602 // "class C {C(); }" | 2606 // "class C {C(); }" |
| 2603 // "class C { C(); }" | 2607 // "class C { C(); }" |
| 2604 _assertParse("class C {", "", " ", "C(); }"); | 2608 _assertParse("class C {", "", " ", "C(); }"); |
| 2605 } | 2609 } |
| 2606 | 2610 |
| 2607 void test_insert_insideIdentifier() { | 2611 void test_insert_insideIdentifier() { |
| 2608 // "f() => cob;" | 2612 // "f() => cob;" |
| 2609 // "f() => cow.b;" | 2613 // "f() => cow.b;" |
| 2610 _assertParse("f() => co", "", "w.", "b;"); | 2614 _assertParse("f() => co", "", "w.", "b;"); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2695 // "f() => a + b; " | 2699 // "f() => a + b; " |
| 2696 _assertParse("f() => a + b;", "", " ", ""); | 2700 _assertParse("f() => a + b;", "", " ", ""); |
| 2697 } | 2701 } |
| 2698 | 2702 |
| 2699 void test_insert_whitespace_middle() { | 2703 void test_insert_whitespace_middle() { |
| 2700 // "f() => a + b;" | 2704 // "f() => a + b;" |
| 2701 // "f() => a + b;" | 2705 // "f() => a + b;" |
| 2702 _assertParse("f() => a", "", " ", " + b;"); | 2706 _assertParse("f() => a", "", " ", " + b;"); |
| 2703 } | 2707 } |
| 2704 | 2708 |
| 2709 void test_replace_field_type_with_void() { |
| 2710 // Note: this produces an error, but we still need the parser to produce a |
| 2711 // consistent parse tree for it. |
| 2712 _assertParse('class C { ', 'int', 'void', ' x; }'); |
| 2713 } |
| 2714 |
| 2705 void test_replace_identifier_beginning() { | 2715 void test_replace_identifier_beginning() { |
| 2706 // "f() => bell + b;" | 2716 // "f() => bell + b;" |
| 2707 // "f() => fell + b;" | 2717 // "f() => fell + b;" |
| 2708 _assertParse("f() => ", "b", "f", "ell + b;"); | 2718 _assertParse("f() => ", "b", "f", "ell + b;"); |
| 2709 } | 2719 } |
| 2710 | 2720 |
| 2711 void test_replace_identifier_end() { | 2721 void test_replace_identifier_end() { |
| 2712 // "f() => bell + b;" | 2722 // "f() => bell + b;" |
| 2713 // "f() => belt + b;" | 2723 // "f() => belt + b;" |
| 2714 _assertParse("f() => bel", "l", "t", " + b;"); | 2724 _assertParse("f() => bel", "l", "t", " + b;"); |
| (...skipping 8111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10826 // Parse the source. | 10836 // Parse the source. |
| 10827 // | 10837 // |
| 10828 Parser parser = new Parser(null, listener); | 10838 Parser parser = new Parser(null, listener); |
| 10829 return invokeParserMethodImpl( | 10839 return invokeParserMethodImpl( |
| 10830 parser, | 10840 parser, |
| 10831 methodName, | 10841 methodName, |
| 10832 <Object>[tokenStream], | 10842 <Object>[tokenStream], |
| 10833 tokenStream) as Token; | 10843 tokenStream) as Token; |
| 10834 } | 10844 } |
| 10835 } | 10845 } |
| OLD | NEW |