| 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 library engine.parser_test; | 5 library engine.parser_test; |
| 6 | 6 |
| 7 import 'package:analyzer/src/generated/ast.dart'; | 7 import 'package:analyzer/src/generated/ast.dart'; |
| 8 import 'package:analyzer/src/generated/element.dart'; | 8 import 'package:analyzer/src/generated/element.dart'; |
| 9 import 'package:analyzer/src/generated/error.dart'; | 9 import 'package:analyzer/src/generated/error.dart'; |
| 10 import 'package:analyzer/src/generated/incremental_scanner.dart'; | 10 import 'package:analyzer/src/generated/incremental_scanner.dart'; |
| (...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2701 // "f() => a + b; " | 2701 // "f() => a + b; " |
| 2702 _assertParse("f() => a + b;", "", " ", ""); | 2702 _assertParse("f() => a + b;", "", " ", ""); |
| 2703 } | 2703 } |
| 2704 | 2704 |
| 2705 void test_insert_whitespace_middle() { | 2705 void test_insert_whitespace_middle() { |
| 2706 // "f() => a + b;" | 2706 // "f() => a + b;" |
| 2707 // "f() => a + b;" | 2707 // "f() => a + b;" |
| 2708 _assertParse("f() => a", "", " ", " + b;"); | 2708 _assertParse("f() => a", "", " ", " + b;"); |
| 2709 } | 2709 } |
| 2710 | 2710 |
| 2711 void test_rename_class_withConstructor() { |
| 2712 // "class C { C() {} }" |
| 2713 // "class D { C() {} }" |
| 2714 _assertParse('class ', 'C', 'D', ' { C() {} }'); |
| 2715 } |
| 2716 |
| 2711 void test_replace_field_type_with_void() { | 2717 void test_replace_field_type_with_void() { |
| 2712 // Note: this produces an error, but we still need the parser to produce a | 2718 // Note: this produces an error, but we still need the parser to produce a |
| 2713 // consistent parse tree for it. | 2719 // consistent parse tree for it. |
| 2714 _assertParse('class C { ', 'int', 'void', ' x; }'); | 2720 _assertParse('class C { ', 'int', 'void', ' x; }'); |
| 2715 } | 2721 } |
| 2716 | 2722 |
| 2717 void test_replace_identifier_beginning() { | 2723 void test_replace_identifier_beginning() { |
| 2718 // "f() => bell + b;" | 2724 // "f() => bell + b;" |
| 2719 // "f() => fell + b;" | 2725 // "f() => fell + b;" |
| 2720 _assertParse("f() => ", "b", "f", "ell + b;"); | 2726 _assertParse("f() => ", "b", "f", "ell + b;"); |
| (...skipping 8117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10838 // Parse the source. | 10844 // Parse the source. |
| 10839 // | 10845 // |
| 10840 Parser parser = new Parser(null, listener); | 10846 Parser parser = new Parser(null, listener); |
| 10841 return invokeParserMethodImpl( | 10847 return invokeParserMethodImpl( |
| 10842 parser, | 10848 parser, |
| 10843 methodName, | 10849 methodName, |
| 10844 <Object>[tokenStream], | 10850 <Object>[tokenStream], |
| 10845 tokenStream) as Token; | 10851 tokenStream) as Token; |
| 10846 } | 10852 } |
| 10847 } | 10853 } |
| OLD | NEW |