Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2009)

Side by Side Diff: pkg/analysis_server/test/services/completion/completion_target_test.dart

Issue 1033333003: improve parser recovery for incomplete prefixed identifier in method/function parameter list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 test.services.completion.target; 5 library test.services.completion.target;
6 6
7 import 'package:analysis_server/src/services/completion/completion_target.dart'; 7 import 'package:analysis_server/src/services/completion/completion_target.dart';
8 import 'package:analyzer/src/generated/ast.dart'; 8 import 'package:analyzer/src/generated/ast.dart';
9 import 'package:analyzer/src/generated/source.dart'; 9 import 'package:analyzer/src/generated/source.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 addTestSource('class A {var b; X _c; foo() {var a; (a as ^String).foo();}'); 131 addTestSource('class A {var b; X _c; foo() {var a; (a as ^String).foo();}');
132 assertTarget('String', 'a as String'); 132 assertTarget('String', 'a as String');
133 } 133 }
134 134
135 test_Block() { 135 test_Block() {
136 // Block 136 // Block
137 addTestSource('main() {^}'); 137 addTestSource('main() {^}');
138 assertTarget('}', '{}'); 138 assertTarget('}', '{}');
139 } 139 }
140 140
141 test_FormalParameter_partialType() {
142 // SimpleIdentifier PrefixedIdentifier TypeName
143 addTestSource('foo(b.^ f) { }');
144 assertTarget('f', 'b.f');
145 }
146
147 test_FormalParameter_partialType2() {
148 // SimpleIdentifier PrefixedIdentifier TypeName
149 addTestSource('foo(b.z^ f) { }');
150 assertTarget('z', 'b.z');
151 }
152
153 test_FormalParameter_partialType3() {
154 // SimpleIdentifier PrefixedIdentifier TypeName
155 addTestSource('foo(b.^) { }');
156 assertTarget('', 'b.');
157 }
158
159 test_FormalParameterList() {
160 // Token FormalParameterList FunctionExpression
161 addTestSource('foo(^) { }');
162 assertTarget(')', '()');
163 }
164
141 test_FunctionDeclaration_inLineComment() { 165 test_FunctionDeclaration_inLineComment() {
142 // Comment CompilationUnit 166 // Comment CompilationUnit
143 addTestSource(''' 167 addTestSource('''
144 // normal comment ^ 168 // normal comment ^
145 zoo(z) { } String name;'''); 169 zoo(z) { } String name;''');
146 assertTarget('// normal comment ', 'zoo(z) {} String name;'); 170 assertTarget('// normal comment ', 'zoo(z) {} String name;');
147 } 171 }
148 172
149 test_FunctionDeclaration_inLineComment2() { 173 test_FunctionDeclaration_inLineComment2() {
150 // Comment CompilationUnit 174 // Comment CompilationUnit
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 addTestSource('main() {int b^ = 1;}'); 515 addTestSource('main() {int b^ = 1;}');
492 assertTarget('b = 1', 'int b = 1'); 516 assertTarget('b = 1', 'int b = 1');
493 } 517 }
494 518
495 test_VariableDeclaration_lhs_identifier_before() { 519 test_VariableDeclaration_lhs_identifier_before() {
496 // VariableDeclaration VariableDeclarationList 520 // VariableDeclaration VariableDeclarationList
497 addTestSource('main() {int ^b = 1;}'); 521 addTestSource('main() {int ^b = 1;}');
498 assertTarget('b = 1', 'int b = 1'); 522 assertTarget('b = 1', 'int b = 1');
499 } 523 }
500 } 524 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698