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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 189803004: Translate private Java members to private Dart members. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks Created 6 years, 9 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
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 // 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/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 23 matching lines...) Expand all
34 // This fails because we are returning null from the method and asserting th at the return value 34 // This fails because we are returning null from the method and asserting th at the return value
35 // is not null. 35 // is not null.
36 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["this", 5], ""); 36 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["this", 5], "");
37 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj i s SimpleIdentifier, SimpleIdentifier, reference.identifier); 37 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf((obj) => obj i s SimpleIdentifier, SimpleIdentifier, reference.identifier);
38 JUnitTestCase.assertNotNull(identifier.token); 38 JUnitTestCase.assertNotNull(identifier.token);
39 JUnitTestCase.assertEquals("a", identifier.name); 39 JUnitTestCase.assertEquals("a", identifier.name);
40 JUnitTestCase.assertEquals(5, identifier.offset); 40 JUnitTestCase.assertEquals(5, identifier.offset);
41 } 41 }
42 42
43 void test_computeStringValue_emptyInterpolationPrefix() { 43 void test_computeStringValue_emptyInterpolationPrefix() {
44 JUnitTestCase.assertEquals("", computeStringValue("'''", true, false)); 44 JUnitTestCase.assertEquals("", _computeStringValue("'''", true, false));
45 } 45 }
46 46
47 void test_computeStringValue_escape_b() { 47 void test_computeStringValue_escape_b() {
48 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'", true, true)); 48 JUnitTestCase.assertEquals("\b", _computeStringValue("'\\b'", true, true));
49 } 49 }
50 50
51 void test_computeStringValue_escape_f() { 51 void test_computeStringValue_escape_f() {
52 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'", true, true)); 52 JUnitTestCase.assertEquals("\f", _computeStringValue("'\\f'", true, true));
53 } 53 }
54 54
55 void test_computeStringValue_escape_n() { 55 void test_computeStringValue_escape_n() {
56 JUnitTestCase.assertEquals("\n", computeStringValue("'\\n'", true, true)); 56 JUnitTestCase.assertEquals("\n", _computeStringValue("'\\n'", true, true));
57 } 57 }
58 58
59 void test_computeStringValue_escape_notSpecial() { 59 void test_computeStringValue_escape_notSpecial() {
60 JUnitTestCase.assertEquals(":", computeStringValue("'\\:'", true, true)); 60 JUnitTestCase.assertEquals(":", _computeStringValue("'\\:'", true, true));
61 } 61 }
62 62
63 void test_computeStringValue_escape_r() { 63 void test_computeStringValue_escape_r() {
64 JUnitTestCase.assertEquals("\r", computeStringValue("'\\r'", true, true)); 64 JUnitTestCase.assertEquals("\r", _computeStringValue("'\\r'", true, true));
65 } 65 }
66 66
67 void test_computeStringValue_escape_t() { 67 void test_computeStringValue_escape_t() {
68 JUnitTestCase.assertEquals("\t", computeStringValue("'\\t'", true, true)); 68 JUnitTestCase.assertEquals("\t", _computeStringValue("'\\t'", true, true));
69 } 69 }
70 70
71 void test_computeStringValue_escape_u_fixed() { 71 void test_computeStringValue_escape_u_fixed() {
72 JUnitTestCase.assertEquals("\u4321", computeStringValue("'\\u4321'", true, t rue)); 72 JUnitTestCase.assertEquals("\u4321", _computeStringValue("'\\u4321'", true, true));
73 } 73 }
74 74
75 void test_computeStringValue_escape_u_variable() { 75 void test_computeStringValue_escape_u_variable() {
76 JUnitTestCase.assertEquals("\u0123", computeStringValue("'\\u{123}'", true, true)); 76 JUnitTestCase.assertEquals("\u0123", _computeStringValue("'\\u{123}'", true, true));
77 } 77 }
78 78
79 void test_computeStringValue_escape_v() { 79 void test_computeStringValue_escape_v() {
80 JUnitTestCase.assertEquals("\u000B", computeStringValue("'\\v'", true, true) ); 80 JUnitTestCase.assertEquals("\u000B", _computeStringValue("'\\v'", true, true ));
81 } 81 }
82 82
83 void test_computeStringValue_escape_x() { 83 void test_computeStringValue_escape_x() {
84 JUnitTestCase.assertEquals("\u00FF", computeStringValue("'\\xFF'", true, tru e)); 84 JUnitTestCase.assertEquals("\u00FF", _computeStringValue("'\\xFF'", true, tr ue));
85 } 85 }
86 86
87 void test_computeStringValue_noEscape_single() { 87 void test_computeStringValue_noEscape_single() {
88 JUnitTestCase.assertEquals("text", computeStringValue("'text'", true, true)) ; 88 JUnitTestCase.assertEquals("text", _computeStringValue("'text'", true, true) );
89 } 89 }
90 90
91 void test_computeStringValue_noEscape_triple() { 91 void test_computeStringValue_noEscape_triple() {
92 JUnitTestCase.assertEquals("text", computeStringValue("'''text'''", true, tr ue)); 92 JUnitTestCase.assertEquals("text", _computeStringValue("'''text'''", true, t rue));
93 } 93 }
94 94
95 void test_computeStringValue_raw_single() { 95 void test_computeStringValue_raw_single() {
96 JUnitTestCase.assertEquals("text", computeStringValue("r'text'", true, true) ); 96 JUnitTestCase.assertEquals("text", _computeStringValue("r'text'", true, true ));
97 } 97 }
98 98
99 void test_computeStringValue_raw_triple() { 99 void test_computeStringValue_raw_triple() {
100 JUnitTestCase.assertEquals("text", computeStringValue("r'''text'''", true, t rue)); 100 JUnitTestCase.assertEquals("text", _computeStringValue("r'''text'''", true, true));
101 } 101 }
102 102
103 void test_computeStringValue_raw_withEscape() { 103 void test_computeStringValue_raw_withEscape() {
104 JUnitTestCase.assertEquals("two\\nlines", computeStringValue("r'two\\nlines' ", true, true)); 104 JUnitTestCase.assertEquals("two\\nlines", _computeStringValue("r'two\\nlines '", true, true));
105 } 105 }
106 106
107 void test_computeStringValue_triple_internalQuote_first_empty() { 107 void test_computeStringValue_triple_internalQuote_first_empty() {
108 JUnitTestCase.assertEquals("'", computeStringValue("''''", true, false)); 108 JUnitTestCase.assertEquals("'", _computeStringValue("''''", true, false));
109 } 109 }
110 110
111 void test_computeStringValue_triple_internalQuote_first_nonEmpty() { 111 void test_computeStringValue_triple_internalQuote_first_nonEmpty() {
112 JUnitTestCase.assertEquals("'text", computeStringValue("''''text", true, fal se)); 112 JUnitTestCase.assertEquals("'text", _computeStringValue("''''text", true, fa lse));
113 } 113 }
114 114
115 void test_computeStringValue_triple_internalQuote_last_empty() { 115 void test_computeStringValue_triple_internalQuote_last_empty() {
116 JUnitTestCase.assertEquals("", computeStringValue("'''", false, true)); 116 JUnitTestCase.assertEquals("", _computeStringValue("'''", false, true));
117 } 117 }
118 118
119 void test_computeStringValue_triple_internalQuote_last_nonEmpty() { 119 void test_computeStringValue_triple_internalQuote_last_nonEmpty() {
120 JUnitTestCase.assertEquals("text", computeStringValue("text'''", false, true )); 120 JUnitTestCase.assertEquals("text", _computeStringValue("text'''", false, tru e));
121 } 121 }
122 122
123 void test_constFactory() { 123 void test_constFactory() {
124 ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C() = A;"); 124 ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C() = A;");
125 } 125 }
126 126
127 void test_createSyntheticIdentifier() { 127 void test_createSyntheticIdentifier() {
128 SimpleIdentifier identifier = createSyntheticIdentifier(); 128 SimpleIdentifier identifier = _createSyntheticIdentifier();
129 JUnitTestCase.assertTrue(identifier.isSynthetic); 129 JUnitTestCase.assertTrue(identifier.isSynthetic);
130 } 130 }
131 131
132 void test_createSyntheticStringLiteral() { 132 void test_createSyntheticStringLiteral() {
133 SimpleStringLiteral literal = createSyntheticStringLiteral(); 133 SimpleStringLiteral literal = _createSyntheticStringLiteral();
134 JUnitTestCase.assertTrue(literal.isSynthetic); 134 JUnitTestCase.assertTrue(literal.isSynthetic);
135 } 135 }
136 136
137 void test_isFunctionDeclaration_nameButNoReturn_block() { 137 void test_isFunctionDeclaration_nameButNoReturn_block() {
138 JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}")); 138 JUnitTestCase.assertTrue(_isFunctionDeclaration("f() {}"));
139 } 139 }
140 140
141 void test_isFunctionDeclaration_nameButNoReturn_expression() { 141 void test_isFunctionDeclaration_nameButNoReturn_expression() {
142 JUnitTestCase.assertTrue(isFunctionDeclaration("f() => e")); 142 JUnitTestCase.assertTrue(_isFunctionDeclaration("f() => e"));
143 } 143 }
144 144
145 void test_isFunctionDeclaration_normalReturn_block() { 145 void test_isFunctionDeclaration_normalReturn_block() {
146 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() {}")); 146 JUnitTestCase.assertTrue(_isFunctionDeclaration("C f() {}"));
147 } 147 }
148 148
149 void test_isFunctionDeclaration_normalReturn_expression() { 149 void test_isFunctionDeclaration_normalReturn_expression() {
150 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() => e")); 150 JUnitTestCase.assertTrue(_isFunctionDeclaration("C f() => e"));
151 } 151 }
152 152
153 void test_isFunctionDeclaration_voidReturn_block() { 153 void test_isFunctionDeclaration_voidReturn_block() {
154 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() {}")); 154 JUnitTestCase.assertTrue(_isFunctionDeclaration("void f() {}"));
155 } 155 }
156 156
157 void test_isFunctionDeclaration_voidReturn_expression() { 157 void test_isFunctionDeclaration_voidReturn_expression() {
158 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() => e")); 158 JUnitTestCase.assertTrue(_isFunctionDeclaration("void f() => e"));
159 } 159 }
160 160
161 void test_isFunctionExpression_false_noBody() { 161 void test_isFunctionExpression_false_noBody() {
162 JUnitTestCase.assertFalse(isFunctionExpression("f();")); 162 JUnitTestCase.assertFalse(_isFunctionExpression("f();"));
163 } 163 }
164 164
165 void test_isFunctionExpression_false_notParameters() { 165 void test_isFunctionExpression_false_notParameters() {
166 JUnitTestCase.assertFalse(isFunctionExpression("(a + b) {")); 166 JUnitTestCase.assertFalse(_isFunctionExpression("(a + b) {"));
167 } 167 }
168 168
169 void test_isFunctionExpression_noName_block() { 169 void test_isFunctionExpression_noName_block() {
170 JUnitTestCase.assertTrue(isFunctionExpression("() {}")); 170 JUnitTestCase.assertTrue(_isFunctionExpression("() {}"));
171 } 171 }
172 172
173 void test_isFunctionExpression_noName_expression() { 173 void test_isFunctionExpression_noName_expression() {
174 JUnitTestCase.assertTrue(isFunctionExpression("() => e")); 174 JUnitTestCase.assertTrue(_isFunctionExpression("() => e"));
175 } 175 }
176 176
177 void test_isFunctionExpression_parameter_final() { 177 void test_isFunctionExpression_parameter_final() {
178 JUnitTestCase.assertTrue(isFunctionExpression("(final a) {}")); 178 JUnitTestCase.assertTrue(_isFunctionExpression("(final a) {}"));
179 JUnitTestCase.assertTrue(isFunctionExpression("(final a, b) {}")); 179 JUnitTestCase.assertTrue(_isFunctionExpression("(final a, b) {}"));
180 JUnitTestCase.assertTrue(isFunctionExpression("(final a, final b) {}")); 180 JUnitTestCase.assertTrue(_isFunctionExpression("(final a, final b) {}"));
181 } 181 }
182 182
183 void test_isFunctionExpression_parameter_final_typed() { 183 void test_isFunctionExpression_parameter_final_typed() {
184 JUnitTestCase.assertTrue(isFunctionExpression("(final int a) {}")); 184 JUnitTestCase.assertTrue(_isFunctionExpression("(final int a) {}"));
185 JUnitTestCase.assertTrue(isFunctionExpression("(final prefix.List a) {}")); 185 JUnitTestCase.assertTrue(_isFunctionExpression("(final prefix.List a) {}"));
186 JUnitTestCase.assertTrue(isFunctionExpression("(final List<int> a) {}")); 186 JUnitTestCase.assertTrue(_isFunctionExpression("(final List<int> a) {}"));
187 JUnitTestCase.assertTrue(isFunctionExpression("(final prefix.List<int> a) {} ")); 187 JUnitTestCase.assertTrue(_isFunctionExpression("(final prefix.List<int> a) { }"));
188 } 188 }
189 189
190 void test_isFunctionExpression_parameter_multiple() { 190 void test_isFunctionExpression_parameter_multiple() {
191 JUnitTestCase.assertTrue(isFunctionExpression("(a, b) {}")); 191 JUnitTestCase.assertTrue(_isFunctionExpression("(a, b) {}"));
192 } 192 }
193 193
194 void test_isFunctionExpression_parameter_named() { 194 void test_isFunctionExpression_parameter_named() {
195 JUnitTestCase.assertTrue(isFunctionExpression("({a}) {}")); 195 JUnitTestCase.assertTrue(_isFunctionExpression("({a}) {}"));
196 } 196 }
197 197
198 void test_isFunctionExpression_parameter_optional() { 198 void test_isFunctionExpression_parameter_optional() {
199 JUnitTestCase.assertTrue(isFunctionExpression("([a]) {}")); 199 JUnitTestCase.assertTrue(_isFunctionExpression("([a]) {}"));
200 } 200 }
201 201
202 void test_isFunctionExpression_parameter_single() { 202 void test_isFunctionExpression_parameter_single() {
203 JUnitTestCase.assertTrue(isFunctionExpression("(a) {}")); 203 JUnitTestCase.assertTrue(_isFunctionExpression("(a) {}"));
204 } 204 }
205 205
206 void test_isFunctionExpression_parameter_typed() { 206 void test_isFunctionExpression_parameter_typed() {
207 JUnitTestCase.assertTrue(isFunctionExpression("(int a, int b) {}")); 207 JUnitTestCase.assertTrue(_isFunctionExpression("(int a, int b) {}"));
208 } 208 }
209 209
210 void test_isInitializedVariableDeclaration_assignment() { 210 void test_isInitializedVariableDeclaration_assignment() {
211 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a = null;")); 211 JUnitTestCase.assertFalse(_isInitializedVariableDeclaration("a = null;"));
212 } 212 }
213 213
214 void test_isInitializedVariableDeclaration_comparison() { 214 void test_isInitializedVariableDeclaration_comparison() {
215 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a < 0;")); 215 JUnitTestCase.assertFalse(_isInitializedVariableDeclaration("a < 0;"));
216 } 216 }
217 217
218 void test_isInitializedVariableDeclaration_conditional() { 218 void test_isInitializedVariableDeclaration_conditional() {
219 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a == null ? init () : update();")); 219 JUnitTestCase.assertFalse(_isInitializedVariableDeclaration("a == null ? ini t() : update();"));
220 } 220 }
221 221
222 void test_isInitializedVariableDeclaration_const_noType_initialized() { 222 void test_isInitializedVariableDeclaration_const_noType_initialized() {
223 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a = 0;")); 223 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("const a = 0;"));
224 } 224 }
225 225
226 void test_isInitializedVariableDeclaration_const_noType_uninitialized() { 226 void test_isInitializedVariableDeclaration_const_noType_uninitialized() {
227 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a;")); 227 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("const a;"));
228 } 228 }
229 229
230 void test_isInitializedVariableDeclaration_const_simpleType_uninitialized() { 230 void test_isInitializedVariableDeclaration_const_simpleType_uninitialized() {
231 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const A a;")); 231 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("const A a;"));
232 } 232 }
233 233
234 void test_isInitializedVariableDeclaration_final_noType_initialized() { 234 void test_isInitializedVariableDeclaration_final_noType_initialized() {
235 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a = 0;")); 235 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("final a = 0;"));
236 } 236 }
237 237
238 void test_isInitializedVariableDeclaration_final_noType_uninitialized() { 238 void test_isInitializedVariableDeclaration_final_noType_uninitialized() {
239 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a;")); 239 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("final a;"));
240 } 240 }
241 241
242 void test_isInitializedVariableDeclaration_final_simpleType_initialized() { 242 void test_isInitializedVariableDeclaration_final_simpleType_initialized() {
243 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final A a = 0;")) ; 243 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("final A a = 0;") );
244 } 244 }
245 245
246 void test_isInitializedVariableDeclaration_functionDeclaration_typed() { 246 void test_isInitializedVariableDeclaration_functionDeclaration_typed() {
247 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("A f() {};")); 247 JUnitTestCase.assertFalse(_isInitializedVariableDeclaration("A f() {};"));
248 } 248 }
249 249
250 void test_isInitializedVariableDeclaration_functionDeclaration_untyped() { 250 void test_isInitializedVariableDeclaration_functionDeclaration_untyped() {
251 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("f() {};")); 251 JUnitTestCase.assertFalse(_isInitializedVariableDeclaration("f() {};"));
252 } 252 }
253 253
254 void test_isInitializedVariableDeclaration_noType_initialized() { 254 void test_isInitializedVariableDeclaration_noType_initialized() {
255 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a = 0;")); 255 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("var a = 0;"));
256 } 256 }
257 257
258 void test_isInitializedVariableDeclaration_noType_uninitialized() { 258 void test_isInitializedVariableDeclaration_noType_uninitialized() {
259 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a;")); 259 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("var a;"));
260 } 260 }
261 261
262 void test_isInitializedVariableDeclaration_parameterizedType_initialized() { 262 void test_isInitializedVariableDeclaration_parameterizedType_initialized() {
263 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a = nul l;")); 263 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("List<int> a = nu ll;"));
264 } 264 }
265 265
266 void test_isInitializedVariableDeclaration_parameterizedType_uninitialized() { 266 void test_isInitializedVariableDeclaration_parameterizedType_uninitialized() {
267 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a;")); 267 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("List<int> a;"));
268 } 268 }
269 269
270 void test_isInitializedVariableDeclaration_simpleType_initialized() { 270 void test_isInitializedVariableDeclaration_simpleType_initialized() {
271 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a = 0;")); 271 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("A a = 0;"));
272 } 272 }
273 273
274 void test_isInitializedVariableDeclaration_simpleType_uninitialized() { 274 void test_isInitializedVariableDeclaration_simpleType_uninitialized() {
275 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a;")); 275 JUnitTestCase.assertTrue(_isInitializedVariableDeclaration("A a;"));
276 } 276 }
277 277
278 void test_isSwitchMember_case_labeled() { 278 void test_isSwitchMember_case_labeled() {
279 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: case")); 279 JUnitTestCase.assertTrue(_isSwitchMember("l1: l2: case"));
280 } 280 }
281 281
282 void test_isSwitchMember_case_unlabeled() { 282 void test_isSwitchMember_case_unlabeled() {
283 JUnitTestCase.assertTrue(isSwitchMember("case")); 283 JUnitTestCase.assertTrue(_isSwitchMember("case"));
284 } 284 }
285 285
286 void test_isSwitchMember_default_labeled() { 286 void test_isSwitchMember_default_labeled() {
287 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); 287 JUnitTestCase.assertTrue(_isSwitchMember("l1: l2: default"));
288 } 288 }
289 289
290 void test_isSwitchMember_default_unlabeled() { 290 void test_isSwitchMember_default_unlabeled() {
291 JUnitTestCase.assertTrue(isSwitchMember("default")); 291 JUnitTestCase.assertTrue(_isSwitchMember("default"));
292 } 292 }
293 293
294 void test_isSwitchMember_false() { 294 void test_isSwitchMember_false() {
295 JUnitTestCase.assertFalse(isSwitchMember("break;")); 295 JUnitTestCase.assertFalse(_isSwitchMember("break;"));
296 } 296 }
297 297
298 void test_parseAdditiveExpression_normal() { 298 void test_parseAdditiveExpression_normal() {
299 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression ", "x + y", []); 299 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression ", "x + y", []);
300 JUnitTestCase.assertNotNull(expression.leftOperand); 300 JUnitTestCase.assertNotNull(expression.leftOperand);
301 JUnitTestCase.assertNotNull(expression.operator); 301 JUnitTestCase.assertNotNull(expression.operator);
302 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); 302 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
303 JUnitTestCase.assertNotNull(expression.rightOperand); 303 JUnitTestCase.assertNotNull(expression.rightOperand);
304 } 304 }
305 305
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1527 } 1527 }
1528 1528
1529 void test_parseCompilationUnit_script() { 1529 void test_parseCompilationUnit_script() {
1530 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bi n/dart", []); 1530 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bi n/dart", []);
1531 JUnitTestCase.assertNotNull(unit.scriptTag); 1531 JUnitTestCase.assertNotNull(unit.scriptTag);
1532 EngineTestCase.assertSizeOfList(0, unit.directives); 1532 EngineTestCase.assertSizeOfList(0, unit.directives);
1533 EngineTestCase.assertSizeOfList(0, unit.declarations); 1533 EngineTestCase.assertSizeOfList(0, unit.declarations);
1534 } 1534 }
1535 1535
1536 void test_parseCompilationUnit_skipFunctionBody_withInterpolation() { 1536 void test_parseCompilationUnit_skipFunctionBody_withInterpolation() {
1537 ParserTestCase._parseFunctionBodies = false; 1537 ParserTestCase.parseFunctionBodies = false;
1538 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }", []); 1538 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }", []);
1539 JUnitTestCase.assertNull(unit.scriptTag); 1539 JUnitTestCase.assertNull(unit.scriptTag);
1540 EngineTestCase.assertSizeOfList(1, unit.declarations); 1540 EngineTestCase.assertSizeOfList(1, unit.declarations);
1541 } 1541 }
1542 1542
1543 void test_parseCompilationUnit_topLevelDeclaration() { 1543 void test_parseCompilationUnit_topLevelDeclaration() {
1544 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}", []); 1544 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}", []);
1545 JUnitTestCase.assertNull(unit.scriptTag); 1545 JUnitTestCase.assertNull(unit.scriptTag);
1546 EngineTestCase.assertSizeOfList(0, unit.directives); 1546 EngineTestCase.assertSizeOfList(0, unit.directives);
1547 EngineTestCase.assertSizeOfList(1, unit.declarations); 1547 EngineTestCase.assertSizeOfList(1, unit.declarations);
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 } 2560 }
2561 2561
2562 void test_parseFunctionBody_nativeFunctionBody() { 2562 void test_parseFunctionBody_nativeFunctionBody() {
2563 NativeFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "native 'str';"); 2563 NativeFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "native 'str';");
2564 JUnitTestCase.assertNotNull(functionBody.nativeToken); 2564 JUnitTestCase.assertNotNull(functionBody.nativeToken);
2565 JUnitTestCase.assertNotNull(functionBody.stringLiteral); 2565 JUnitTestCase.assertNotNull(functionBody.stringLiteral);
2566 JUnitTestCase.assertNotNull(functionBody.semicolon); 2566 JUnitTestCase.assertNotNull(functionBody.semicolon);
2567 } 2567 }
2568 2568
2569 void test_parseFunctionBody_skip_block() { 2569 void test_parseFunctionBody_skip_block() {
2570 ParserTestCase._parseFunctionBodies = false; 2570 ParserTestCase.parseFunctionBodies = false;
2571 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "{}"); 2571 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "{}");
2572 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody); 2572 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody);
2573 } 2573 }
2574 2574
2575 void test_parseFunctionBody_skip_blocks() { 2575 void test_parseFunctionBody_skip_blocks() {
2576 ParserTestCase._parseFunctionBodies = false; 2576 ParserTestCase.parseFunctionBodies = false;
2577 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "{ {} }"); 2577 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "{ {} }");
2578 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody); 2578 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody);
2579 } 2579 }
2580 2580
2581 void test_parseFunctionBody_skip_expression() { 2581 void test_parseFunctionBody_skip_expression() {
2582 ParserTestCase._parseFunctionBodies = false; 2582 ParserTestCase.parseFunctionBodies = false;
2583 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "=> y;"); 2583 FunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Objec t> [false, null, false], "=> y;");
2584 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody); 2584 EngineTestCase.assertInstanceOf((obj) => obj is EmptyFunctionBody, EmptyFunc tionBody, functionBody);
2585 } 2585 }
2586 2586
2587 void test_parseFunctionDeclaration_function() { 2587 void test_parseFunctionDeclaration_function() {
2588 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 2588 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2589 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); 2589 TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
2590 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara tion", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}"); 2590 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara tion", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}");
2591 JUnitTestCase.assertEquals(comment, declaration.documentationComment); 2591 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2592 JUnitTestCase.assertEquals(returnType, declaration.returnType); 2592 JUnitTestCase.assertEquals(returnType, declaration.returnType);
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after
4345 EngineTestCase.assertSizeOfList(3, clause.mixinTypes); 4345 EngineTestCase.assertSizeOfList(3, clause.mixinTypes);
4346 } 4346 }
4347 4347
4348 void test_parseWithClause_single() { 4348 void test_parseWithClause_single() {
4349 WithClause clause = ParserTestCase.parse4("parseWithClause", "with M", []); 4349 WithClause clause = ParserTestCase.parse4("parseWithClause", "with M", []);
4350 JUnitTestCase.assertNotNull(clause.withKeyword); 4350 JUnitTestCase.assertNotNull(clause.withKeyword);
4351 EngineTestCase.assertSizeOfList(1, clause.mixinTypes); 4351 EngineTestCase.assertSizeOfList(1, clause.mixinTypes);
4352 } 4352 }
4353 4353
4354 void test_skipPrefixedIdentifier_invalid() { 4354 void test_skipPrefixedIdentifier_invalid() {
4355 Token following = skip("skipPrefixedIdentifier", "+"); 4355 Token following = _skip("skipPrefixedIdentifier", "+");
4356 JUnitTestCase.assertNull(following); 4356 JUnitTestCase.assertNull(following);
4357 } 4357 }
4358 4358
4359 void test_skipPrefixedIdentifier_notPrefixed() { 4359 void test_skipPrefixedIdentifier_notPrefixed() {
4360 Token following = skip("skipPrefixedIdentifier", "a +"); 4360 Token following = _skip("skipPrefixedIdentifier", "a +");
4361 JUnitTestCase.assertNotNull(following); 4361 JUnitTestCase.assertNotNull(following);
4362 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4362 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4363 } 4363 }
4364 4364
4365 void test_skipPrefixedIdentifier_prefixed() { 4365 void test_skipPrefixedIdentifier_prefixed() {
4366 Token following = skip("skipPrefixedIdentifier", "a.b +"); 4366 Token following = _skip("skipPrefixedIdentifier", "a.b +");
4367 JUnitTestCase.assertNotNull(following); 4367 JUnitTestCase.assertNotNull(following);
4368 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4368 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4369 } 4369 }
4370 4370
4371 void test_skipReturnType_invalid() { 4371 void test_skipReturnType_invalid() {
4372 Token following = skip("skipReturnType", "+"); 4372 Token following = _skip("skipReturnType", "+");
4373 JUnitTestCase.assertNull(following); 4373 JUnitTestCase.assertNull(following);
4374 } 4374 }
4375 4375
4376 void test_skipReturnType_type() { 4376 void test_skipReturnType_type() {
4377 Token following = skip("skipReturnType", "C +"); 4377 Token following = _skip("skipReturnType", "C +");
4378 JUnitTestCase.assertNotNull(following); 4378 JUnitTestCase.assertNotNull(following);
4379 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4379 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4380 } 4380 }
4381 4381
4382 void test_skipReturnType_void() { 4382 void test_skipReturnType_void() {
4383 Token following = skip("skipReturnType", "void +"); 4383 Token following = _skip("skipReturnType", "void +");
4384 JUnitTestCase.assertNotNull(following); 4384 JUnitTestCase.assertNotNull(following);
4385 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4385 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4386 } 4386 }
4387 4387
4388 void test_skipSimpleIdentifier_identifier() { 4388 void test_skipSimpleIdentifier_identifier() {
4389 Token following = skip("skipSimpleIdentifier", "i +"); 4389 Token following = _skip("skipSimpleIdentifier", "i +");
4390 JUnitTestCase.assertNotNull(following); 4390 JUnitTestCase.assertNotNull(following);
4391 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4391 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4392 } 4392 }
4393 4393
4394 void test_skipSimpleIdentifier_invalid() { 4394 void test_skipSimpleIdentifier_invalid() {
4395 Token following = skip("skipSimpleIdentifier", "9 +"); 4395 Token following = _skip("skipSimpleIdentifier", "9 +");
4396 JUnitTestCase.assertNull(following); 4396 JUnitTestCase.assertNull(following);
4397 } 4397 }
4398 4398
4399 void test_skipSimpleIdentifier_pseudoKeyword() { 4399 void test_skipSimpleIdentifier_pseudoKeyword() {
4400 Token following = skip("skipSimpleIdentifier", "as +"); 4400 Token following = _skip("skipSimpleIdentifier", "as +");
4401 JUnitTestCase.assertNotNull(following); 4401 JUnitTestCase.assertNotNull(following);
4402 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4402 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4403 } 4403 }
4404 4404
4405 void test_skipStringLiteral_adjacent() { 4405 void test_skipStringLiteral_adjacent() {
4406 Token following = skip("skipStringLiteral", "'a' 'b' +"); 4406 Token following = _skip("skipStringLiteral", "'a' 'b' +");
4407 JUnitTestCase.assertNotNull(following); 4407 JUnitTestCase.assertNotNull(following);
4408 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4408 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4409 } 4409 }
4410 4410
4411 void test_skipStringLiteral_interpolated() { 4411 void test_skipStringLiteral_interpolated() {
4412 Token following = skip("skipStringLiteral", "'a\${b}c' +"); 4412 Token following = _skip("skipStringLiteral", "'a\${b}c' +");
4413 JUnitTestCase.assertNotNull(following); 4413 JUnitTestCase.assertNotNull(following);
4414 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4414 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4415 } 4415 }
4416 4416
4417 void test_skipStringLiteral_invalid() { 4417 void test_skipStringLiteral_invalid() {
4418 Token following = skip("skipStringLiteral", "a"); 4418 Token following = _skip("skipStringLiteral", "a");
4419 JUnitTestCase.assertNull(following); 4419 JUnitTestCase.assertNull(following);
4420 } 4420 }
4421 4421
4422 void test_skipStringLiteral_single() { 4422 void test_skipStringLiteral_single() {
4423 Token following = skip("skipStringLiteral", "'a' +"); 4423 Token following = _skip("skipStringLiteral", "'a' +");
4424 JUnitTestCase.assertNotNull(following); 4424 JUnitTestCase.assertNotNull(following);
4425 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4425 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4426 } 4426 }
4427 4427
4428 void test_skipTypeArgumentList_invalid() { 4428 void test_skipTypeArgumentList_invalid() {
4429 Token following = skip("skipTypeArgumentList", "+"); 4429 Token following = _skip("skipTypeArgumentList", "+");
4430 JUnitTestCase.assertNull(following); 4430 JUnitTestCase.assertNull(following);
4431 } 4431 }
4432 4432
4433 void test_skipTypeArgumentList_multiple() { 4433 void test_skipTypeArgumentList_multiple() {
4434 Token following = skip("skipTypeArgumentList", "<E, F, G> +"); 4434 Token following = _skip("skipTypeArgumentList", "<E, F, G> +");
4435 JUnitTestCase.assertNotNull(following); 4435 JUnitTestCase.assertNotNull(following);
4436 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4436 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4437 } 4437 }
4438 4438
4439 void test_skipTypeArgumentList_single() { 4439 void test_skipTypeArgumentList_single() {
4440 Token following = skip("skipTypeArgumentList", "<E> +"); 4440 Token following = _skip("skipTypeArgumentList", "<E> +");
4441 JUnitTestCase.assertNotNull(following); 4441 JUnitTestCase.assertNotNull(following);
4442 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4442 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4443 } 4443 }
4444 4444
4445 void test_skipTypeName_invalid() { 4445 void test_skipTypeName_invalid() {
4446 Token following = skip("skipTypeName", "+"); 4446 Token following = _skip("skipTypeName", "+");
4447 JUnitTestCase.assertNull(following); 4447 JUnitTestCase.assertNull(following);
4448 } 4448 }
4449 4449
4450 void test_skipTypeName_parameterized() { 4450 void test_skipTypeName_parameterized() {
4451 Token following = skip("skipTypeName", "C<E<F<G>>> +"); 4451 Token following = _skip("skipTypeName", "C<E<F<G>>> +");
4452 JUnitTestCase.assertNotNull(following); 4452 JUnitTestCase.assertNotNull(following);
4453 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4453 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4454 } 4454 }
4455 4455
4456 void test_skipTypeName_simple() { 4456 void test_skipTypeName_simple() {
4457 Token following = skip("skipTypeName", "C +"); 4457 Token following = _skip("skipTypeName", "C +");
4458 JUnitTestCase.assertNotNull(following); 4458 JUnitTestCase.assertNotNull(following);
4459 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 4459 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
4460 } 4460 }
4461 4461
4462 /** 4462 /**
4463 * Invoke the method [Parser#computeStringValue] with the given argument. 4463 * Invoke the method [Parser#computeStringValue] with the given argument.
4464 * 4464 *
4465 * @param lexeme the argument to the method 4465 * @param lexeme the argument to the method
4466 * @param first `true` if this is the first token in a string literal 4466 * @param first `true` if this is the first token in a string literal
4467 * @param last `true` if this is the last token in a string literal 4467 * @param last `true` if this is the last token in a string literal
4468 * @return the result of invoking the method 4468 * @return the result of invoking the method
4469 * @throws Exception if the method could not be invoked or throws an exception 4469 * @throws Exception if the method could not be invoked or throws an exception
4470 */ 4470 */
4471 String computeStringValue(String lexeme, bool first, bool last) { 4471 String _computeStringValue(String lexeme, bool first, bool last) {
4472 AnalysisErrorListener listener = new AnalysisErrorListener_SimpleParserTest_ computeStringValue(); 4472 AnalysisErrorListener listener = new AnalysisErrorListener_SimpleParserTest_ computeStringValue();
4473 Parser parser = new Parser(null, listener); 4473 Parser parser = new Parser(null, listener);
4474 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme , first, last], null) as String; 4474 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme , first, last], null) as String;
4475 } 4475 }
4476 4476
4477 /** 4477 /**
4478 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token 4478 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
4479 * stream produced by scanning the given source. 4479 * stream produced by scanning the given source.
4480 * 4480 *
4481 * @param source the source to be scanned to produce the token stream being te sted 4481 * @param source the source to be scanned to produce the token stream being te sted
4482 * @return the result of invoking the method 4482 * @return the result of invoking the method
4483 * @throws Exception if the method could not be invoked or throws an exception 4483 * @throws Exception if the method could not be invoked or throws an exception
4484 */ 4484 */
4485 SimpleIdentifier createSyntheticIdentifier() { 4485 SimpleIdentifier _createSyntheticIdentifier() {
4486 GatheringErrorListener listener = new GatheringErrorListener(); 4486 GatheringErrorListener listener = new GatheringErrorListener();
4487 return ParserTestCase.invokeParserMethod2("createSyntheticIdentifier", "", l istener); 4487 return ParserTestCase.invokeParserMethod2("createSyntheticIdentifier", "", l istener);
4488 } 4488 }
4489 4489
4490 /** 4490 /**
4491 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token 4491 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
4492 * stream produced by scanning the given source. 4492 * stream produced by scanning the given source.
4493 * 4493 *
4494 * @param source the source to be scanned to produce the token stream being te sted 4494 * @param source the source to be scanned to produce the token stream being te sted
4495 * @return the result of invoking the method 4495 * @return the result of invoking the method
4496 * @throws Exception if the method could not be invoked or throws an exception 4496 * @throws Exception if the method could not be invoked or throws an exception
4497 */ 4497 */
4498 SimpleStringLiteral createSyntheticStringLiteral() { 4498 SimpleStringLiteral _createSyntheticStringLiteral() {
4499 GatheringErrorListener listener = new GatheringErrorListener(); 4499 GatheringErrorListener listener = new GatheringErrorListener();
4500 return ParserTestCase.invokeParserMethod2("createSyntheticStringLiteral", "" , listener); 4500 return ParserTestCase.invokeParserMethod2("createSyntheticStringLiteral", "" , listener);
4501 } 4501 }
4502 4502
4503 /** 4503 /**
4504 * Invoke the method [Parser#isFunctionDeclaration] with the parser set to the token 4504 * Invoke the method [Parser#isFunctionDeclaration] with the parser set to the token
4505 * stream produced by scanning the given source. 4505 * stream produced by scanning the given source.
4506 * 4506 *
4507 * @param source the source to be scanned to produce the token stream being te sted 4507 * @param source the source to be scanned to produce the token stream being te sted
4508 * @return the result of invoking the method 4508 * @return the result of invoking the method
4509 * @throws Exception if the method could not be invoked or throws an exception 4509 * @throws Exception if the method could not be invoked or throws an exception
4510 */ 4510 */
4511 bool isFunctionDeclaration(String source) { 4511 bool _isFunctionDeclaration(String source) {
4512 GatheringErrorListener listener = new GatheringErrorListener(); 4512 GatheringErrorListener listener = new GatheringErrorListener();
4513 return ParserTestCase.invokeParserMethod2("isFunctionDeclaration", source, l istener) as bool; 4513 return ParserTestCase.invokeParserMethod2("isFunctionDeclaration", source, l istener) as bool;
4514 } 4514 }
4515 4515
4516 /** 4516 /**
4517 * Invoke the method [Parser#isFunctionExpression] with the parser set to the token stream 4517 * Invoke the method [Parser#isFunctionExpression] with the parser set to the token stream
4518 * produced by scanning the given source. 4518 * produced by scanning the given source.
4519 * 4519 *
4520 * @param source the source to be scanned to produce the token stream being te sted 4520 * @param source the source to be scanned to produce the token stream being te sted
4521 * @return the result of invoking the method 4521 * @return the result of invoking the method
4522 * @throws Exception if the method could not be invoked or throws an exception 4522 * @throws Exception if the method could not be invoked or throws an exception
4523 */ 4523 */
4524 bool isFunctionExpression(String source) { 4524 bool _isFunctionExpression(String source) {
4525 GatheringErrorListener listener = new GatheringErrorListener(); 4525 GatheringErrorListener listener = new GatheringErrorListener();
4526 // 4526 //
4527 // Scan the source. 4527 // Scan the source.
4528 // 4528 //
4529 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener ); 4529 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener );
4530 Token tokenStream = scanner.tokenize(); 4530 Token tokenStream = scanner.tokenize();
4531 // 4531 //
4532 // Parse the source. 4532 // Parse the source.
4533 // 4533 //
4534 Parser parser = new Parser(null, listener); 4534 Parser parser = new Parser(null, listener);
4535 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke nStream], tokenStream) as bool; 4535 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke nStream], tokenStream) as bool;
4536 } 4536 }
4537 4537
4538 /** 4538 /**
4539 * Invoke the method [Parser#isInitializedVariableDeclaration] with the parser set to the 4539 * Invoke the method [Parser#isInitializedVariableDeclaration] with the parser set to the
4540 * token stream produced by scanning the given source. 4540 * token stream produced by scanning the given source.
4541 * 4541 *
4542 * @param source the source to be scanned to produce the token stream being te sted 4542 * @param source the source to be scanned to produce the token stream being te sted
4543 * @return the result of invoking the method 4543 * @return the result of invoking the method
4544 * @throws Exception if the method could not be invoked or throws an exception 4544 * @throws Exception if the method could not be invoked or throws an exception
4545 */ 4545 */
4546 bool isInitializedVariableDeclaration(String source) { 4546 bool _isInitializedVariableDeclaration(String source) {
4547 GatheringErrorListener listener = new GatheringErrorListener(); 4547 GatheringErrorListener listener = new GatheringErrorListener();
4548 return ParserTestCase.invokeParserMethod2("isInitializedVariableDeclaration" , source, listener) as bool; 4548 return ParserTestCase.invokeParserMethod2("isInitializedVariableDeclaration" , source, listener) as bool;
4549 } 4549 }
4550 4550
4551 /** 4551 /**
4552 * Invoke the method [Parser#isSwitchMember] with the parser set to the token stream 4552 * Invoke the method [Parser#isSwitchMember] with the parser set to the token stream
4553 * produced by scanning the given source. 4553 * produced by scanning the given source.
4554 * 4554 *
4555 * @param source the source to be scanned to produce the token stream being te sted 4555 * @param source the source to be scanned to produce the token stream being te sted
4556 * @return the result of invoking the method 4556 * @return the result of invoking the method
4557 * @throws Exception if the method could not be invoked or throws an exception 4557 * @throws Exception if the method could not be invoked or throws an exception
4558 */ 4558 */
4559 bool isSwitchMember(String source) { 4559 bool _isSwitchMember(String source) {
4560 GatheringErrorListener listener = new GatheringErrorListener(); 4560 GatheringErrorListener listener = new GatheringErrorListener();
4561 return ParserTestCase.invokeParserMethod2("isSwitchMember", source, listener ) as bool; 4561 return ParserTestCase.invokeParserMethod2("isSwitchMember", source, listener ) as bool;
4562 } 4562 }
4563 4563
4564 /** 4564 /**
4565 * Invoke a "skip" method in [Parser]. The method is assumed to take a token a s it's 4565 * Invoke a "skip" method in [Parser]. The method is assumed to take a token a s it's
4566 * parameter and is given the first token in the scanned source. 4566 * parameter and is given the first token in the scanned source.
4567 * 4567 *
4568 * @param methodName the name of the method that should be invoked 4568 * @param methodName the name of the method that should be invoked
4569 * @param source the source to be processed by the method 4569 * @param source the source to be processed by the method
4570 * @return the result of invoking the method 4570 * @return the result of invoking the method
4571 * @throws Exception if the method could not be invoked or throws an exception 4571 * @throws Exception if the method could not be invoked or throws an exception
4572 * @throws AssertionFailedError if the result is `null` 4572 * @throws AssertionFailedError if the result is `null`
4573 */ 4573 */
4574 Token skip(String methodName, String source) { 4574 Token _skip(String methodName, String source) {
4575 GatheringErrorListener listener = new GatheringErrorListener(); 4575 GatheringErrorListener listener = new GatheringErrorListener();
4576 // 4576 //
4577 // Scan the source. 4577 // Scan the source.
4578 // 4578 //
4579 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener ); 4579 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener );
4580 Token tokenStream = scanner.tokenize(); 4580 Token tokenStream = scanner.tokenize();
4581 // 4581 //
4582 // Parse the source. 4582 // Parse the source.
4583 // 4583 //
4584 Parser parser = new Parser(null, listener); 4584 Parser parser = new Parser(null, listener);
(...skipping 2692 matching lines...) Expand 10 before | Expand all | Expand 10 after
7277 7277
7278 class ParserTestCase extends EngineTestCase { 7278 class ParserTestCase extends EngineTestCase {
7279 /** 7279 /**
7280 * An empty array of objects used as arguments to zero-argument methods. 7280 * An empty array of objects used as arguments to zero-argument methods.
7281 */ 7281 */
7282 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0); 7282 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0);
7283 7283
7284 /** 7284 /**
7285 * A flag indicating whether parser is to parse function bodies. 7285 * A flag indicating whether parser is to parse function bodies.
7286 */ 7286 */
7287 static bool _parseFunctionBodies = true; 7287 static bool parseFunctionBodies = true;
7288 7288
7289 /** 7289 /**
7290 * Invoke a parse method in [Parser]. The method is assumed to have the given number and 7290 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
7291 * type of parameters and will be invoked with the given arguments. 7291 * type of parameters and will be invoked with the given arguments.
7292 * 7292 *
7293 * The given source is scanned and the parser is initialized to start with the first token in the 7293 * The given source is scanned and the parser is initialized to start with the first token in the
7294 * source before the parse method is invoked. 7294 * source before the parse method is invoked.
7295 * 7295 *
7296 * @param methodName the name of the parse method that should be invoked to pa rse the source 7296 * @param methodName the name of the parse method that should be invoked to pa rse the source
7297 * @param objects the values of the arguments to the method 7297 * @param objects the values of the arguments to the method
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
7470 // 7470 //
7471 // Scan the source. 7471 // Scan the source.
7472 // 7472 //
7473 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener ); 7473 Scanner scanner = new Scanner(null, new CharSequenceReader(source), listener );
7474 Token tokenStream = scanner.tokenize(); 7474 Token tokenStream = scanner.tokenize();
7475 listener.setLineInfo(new TestSource(), scanner.lineStarts); 7475 listener.setLineInfo(new TestSource(), scanner.lineStarts);
7476 // 7476 //
7477 // Parse the source. 7477 // Parse the source.
7478 // 7478 //
7479 Parser parser = new Parser(null, listener); 7479 Parser parser = new Parser(null, listener);
7480 parser.parseFunctionBodies = _parseFunctionBodies; 7480 parser.parseFunctionBodies = parseFunctionBodies;
7481 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr eam); 7481 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr eam);
7482 // 7482 //
7483 // Partially test the results. 7483 // Partially test the results.
7484 // 7484 //
7485 if (!listener.hasErrors) { 7485 if (!listener.hasErrors) {
7486 JUnitTestCase.assertNotNull(result); 7486 JUnitTestCase.assertNotNull(result);
7487 } 7487 }
7488 return result; 7488 return result;
7489 } 7489 }
7490 7490
(...skipping 30 matching lines...) Expand all
7521 7521
7522 /** 7522 /**
7523 * Return an empty CommentAndMetadata object that can be used for testing. 7523 * Return an empty CommentAndMetadata object that can be used for testing.
7524 * 7524 *
7525 * @return an empty CommentAndMetadata object that can be used for testing 7525 * @return an empty CommentAndMetadata object that can be used for testing
7526 */ 7526 */
7527 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n ew List<Annotation>()); 7527 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n ew List<Annotation>());
7528 7528
7529 void setUp() { 7529 void setUp() {
7530 super.setUp(); 7530 super.setUp();
7531 _parseFunctionBodies = true; 7531 parseFunctionBodies = true;
7532 } 7532 }
7533 7533
7534 static dartSuite() { 7534 static dartSuite() {
7535 _ut.group('ParserTestCase', () { 7535 _ut.group('ParserTestCase', () {
7536 }); 7536 });
7537 } 7537 }
7538 } 7538 }
7539 7539
7540 /** 7540 /**
7541 * Instances of the class `AstValidator` are used to validate the correct constr uction of an 7541 * Instances of the class `AstValidator` are used to validate the correct constr uction of an
(...skipping 15 matching lines...) Expand all
7557 builder.append("Invalid AST structure:"); 7557 builder.append("Invalid AST structure:");
7558 for (String message in _errors) { 7558 for (String message in _errors) {
7559 builder.append("\r\n "); 7559 builder.append("\r\n ");
7560 builder.append(message); 7560 builder.append(message);
7561 } 7561 }
7562 JUnitTestCase.fail(builder.toString()); 7562 JUnitTestCase.fail(builder.toString());
7563 } 7563 }
7564 } 7564 }
7565 7565
7566 Object visitNode(AstNode node) { 7566 Object visitNode(AstNode node) {
7567 validate(node); 7567 _validate(node);
7568 return super.visitNode(node); 7568 return super.visitNode(node);
7569 } 7569 }
7570 7570
7571 /** 7571 /**
7572 * Validate that the given AST node is correctly constructed. 7572 * Validate that the given AST node is correctly constructed.
7573 * 7573 *
7574 * @param node the AST node being validated 7574 * @param node the AST node being validated
7575 */ 7575 */
7576 void validate(AstNode node) { 7576 void _validate(AstNode node) {
7577 AstNode parent = node.parent; 7577 AstNode parent = node.parent;
7578 if (node is CompilationUnit) { 7578 if (node is CompilationUnit) {
7579 if (parent != null) { 7579 if (parent != null) {
7580 _errors.add("Compilation units should not have a parent"); 7580 _errors.add("Compilation units should not have a parent");
7581 } 7581 }
7582 } else { 7582 } else {
7583 if (parent == null) { 7583 if (parent == null) {
7584 _errors.add("No parent for ${node.runtimeType.toString()}"); 7584 _errors.add("No parent for ${node.runtimeType.toString()}");
7585 } 7585 }
7586 } 7586 }
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after
9270 runJUnitTest(__test, __test.test_typedef_eof); 9270 runJUnitTest(__test, __test.test_typedef_eof);
9271 }); 9271 });
9272 }); 9272 });
9273 } 9273 }
9274 } 9274 }
9275 9275
9276 class IncrementalParserTest extends EngineTestCase { 9276 class IncrementalParserTest extends EngineTestCase {
9277 void test_delete_everything() { 9277 void test_delete_everything() {
9278 // "f() => a + b;" 9278 // "f() => a + b;"
9279 // "" 9279 // ""
9280 assertParse("", "f() => a + b;", "", ""); 9280 _assertParse("", "f() => a + b;", "", "");
9281 } 9281 }
9282 9282
9283 void test_delete_identifier_beginning() { 9283 void test_delete_identifier_beginning() {
9284 // "f() => abs + b;" 9284 // "f() => abs + b;"
9285 // "f() => s + b;" 9285 // "f() => s + b;"
9286 assertParse("f() => ", "ab", "", "s + b;"); 9286 _assertParse("f() => ", "ab", "", "s + b;");
9287 } 9287 }
9288 9288
9289 void test_delete_identifier_end() { 9289 void test_delete_identifier_end() {
9290 // "f() => abs + b;" 9290 // "f() => abs + b;"
9291 // "f() => a + b;" 9291 // "f() => a + b;"
9292 assertParse("f() => a", "bs", "", " + b;"); 9292 _assertParse("f() => a", "bs", "", " + b;");
9293 } 9293 }
9294 9294
9295 void test_delete_identifier_middle() { 9295 void test_delete_identifier_middle() {
9296 // "f() => abs + b;" 9296 // "f() => abs + b;"
9297 // "f() => as + b;" 9297 // "f() => as + b;"
9298 assertParse("f() => a", "b", "", "s + b;"); 9298 _assertParse("f() => a", "b", "", "s + b;");
9299 } 9299 }
9300 9300
9301 void test_delete_mergeTokens() { 9301 void test_delete_mergeTokens() {
9302 // "f() => a + b + c;" 9302 // "f() => a + b + c;"
9303 // "f() => ac;" 9303 // "f() => ac;"
9304 assertParse("f() => a", " + b + ", "", "c;"); 9304 _assertParse("f() => a", " + b + ", "", "c;");
9305 } 9305 }
9306 9306
9307 void test_insert_afterIdentifier1() { 9307 void test_insert_afterIdentifier1() {
9308 // "f() => a + b;" 9308 // "f() => a + b;"
9309 // "f() => abs + b;" 9309 // "f() => abs + b;"
9310 assertParse("f() => a", "", "bs", " + b;"); 9310 _assertParse("f() => a", "", "bs", " + b;");
9311 } 9311 }
9312 9312
9313 void test_insert_afterIdentifier2() { 9313 void test_insert_afterIdentifier2() {
9314 // "f() => a + b;" 9314 // "f() => a + b;"
9315 // "f() => a + bar;" 9315 // "f() => a + bar;"
9316 assertParse("f() => a + b", "", "ar", ";"); 9316 _assertParse("f() => a + b", "", "ar", ";");
9317 } 9317 }
9318 9318
9319 void test_insert_beforeIdentifier1() { 9319 void test_insert_beforeIdentifier1() {
9320 // "f() => a + b;" 9320 // "f() => a + b;"
9321 // "f() => xa + b;" 9321 // "f() => xa + b;"
9322 assertParse("f() => ", "", "x", "a + b;"); 9322 _assertParse("f() => ", "", "x", "a + b;");
9323 } 9323 }
9324 9324
9325 void test_insert_beforeIdentifier2() { 9325 void test_insert_beforeIdentifier2() {
9326 // "f() => a + b;" 9326 // "f() => a + b;"
9327 // "f() => a + xb;" 9327 // "f() => a + xb;"
9328 assertParse("f() => a + ", "", "x", "b;"); 9328 _assertParse("f() => a + ", "", "x", "b;");
9329 } 9329 }
9330 9330
9331 void test_insert_convertOneFunctionToTwo() { 9331 void test_insert_convertOneFunctionToTwo() {
9332 // "f() {}" 9332 // "f() {}"
9333 // "f() => 0; g() {}" 9333 // "f() => 0; g() {}"
9334 assertParse("f()", "", " => 0; g()", " {}"); 9334 _assertParse("f()", "", " => 0; g()", " {}");
9335 } 9335 }
9336 9336
9337 void test_insert_end() { 9337 void test_insert_end() {
9338 // "class A {}" 9338 // "class A {}"
9339 // "class A {} class B {}" 9339 // "class A {} class B {}"
9340 assertParse("class A {}", "", " class B {}", ""); 9340 _assertParse("class A {}", "", " class B {}", "");
9341 } 9341 }
9342 9342
9343 void test_insert_insideClassBody() { 9343 void test_insert_insideClassBody() {
9344 // "class C {C(); }" 9344 // "class C {C(); }"
9345 // "class C { C(); }" 9345 // "class C { C(); }"
9346 assertParse("class C {", "", " ", "C(); }"); 9346 _assertParse("class C {", "", " ", "C(); }");
9347 } 9347 }
9348 9348
9349 void test_insert_insideIdentifier() { 9349 void test_insert_insideIdentifier() {
9350 // "f() => cob;" 9350 // "f() => cob;"
9351 // "f() => cow.b;" 9351 // "f() => cow.b;"
9352 assertParse("f() => co", "", "w.", "b;"); 9352 _assertParse("f() => co", "", "w.", "b;");
9353 } 9353 }
9354 9354
9355 void test_insert_newIdentifier1() { 9355 void test_insert_newIdentifier1() {
9356 // "f() => a; c;" 9356 // "f() => a; c;"
9357 // "f() => a; b c;" 9357 // "f() => a; b c;"
9358 assertParse("f() => a;", "", " b", " c;"); 9358 _assertParse("f() => a;", "", " b", " c;");
9359 } 9359 }
9360 9360
9361 void test_insert_newIdentifier2() { 9361 void test_insert_newIdentifier2() {
9362 // "f() => a; c;" 9362 // "f() => a; c;"
9363 // "f() => a;b c;" 9363 // "f() => a;b c;"
9364 assertParse("f() => a;", "", "b", " c;"); 9364 _assertParse("f() => a;", "", "b", " c;");
9365 } 9365 }
9366 9366
9367 void test_insert_newIdentifier3() { 9367 void test_insert_newIdentifier3() {
9368 // "/** A simple function. */ f() => a; c;" 9368 // "/** A simple function. */ f() => a; c;"
9369 // "/** A simple function. */ f() => a; b c;" 9369 // "/** A simple function. */ f() => a; b c;"
9370 assertParse("/** A simple function. */ f() => a;", "", " b", " c;"); 9370 _assertParse("/** A simple function. */ f() => a;", "", " b", " c;");
9371 } 9371 }
9372 9372
9373 void test_insert_newIdentifier4() { 9373 void test_insert_newIdentifier4() {
9374 // "/** An [A]. */ class A {} class B { m() { return 1; } }" 9374 // "/** An [A]. */ class A {} class B { m() { return 1; } }"
9375 // "/** An [A]. */ class A {} class B { m() { return 1 + 2; } }" 9375 // "/** An [A]. */ class A {} class B { m() { return 1 + 2; } }"
9376 assertParse("/** An [A]. */ class A {} class B { m() { return 1", "", " + 2" , "; } }"); 9376 _assertParse("/** An [A]. */ class A {} class B { m() { return 1", "", " + 2 ", "; } }");
9377 } 9377 }
9378 9378
9379 void test_insert_period() { 9379 void test_insert_period() {
9380 // "f() => a + b;" 9380 // "f() => a + b;"
9381 // "f() => a + b.;" 9381 // "f() => a + b.;"
9382 assertParse("f() => a + b", "", ".", ";"); 9382 _assertParse("f() => a + b", "", ".", ";");
9383 } 9383 }
9384 9384
9385 void test_insert_period_betweenIdentifiers1() { 9385 void test_insert_period_betweenIdentifiers1() {
9386 // "f() => a b;" 9386 // "f() => a b;"
9387 // "f() => a. b;" 9387 // "f() => a. b;"
9388 assertParse("f() => a", "", ".", " b;"); 9388 _assertParse("f() => a", "", ".", " b;");
9389 } 9389 }
9390 9390
9391 void test_insert_period_betweenIdentifiers2() { 9391 void test_insert_period_betweenIdentifiers2() {
9392 // "f() => a b;" 9392 // "f() => a b;"
9393 // "f() => a .b;" 9393 // "f() => a .b;"
9394 assertParse("f() => a ", "", ".", "b;"); 9394 _assertParse("f() => a ", "", ".", "b;");
9395 } 9395 }
9396 9396
9397 void test_insert_period_betweenIdentifiers3() { 9397 void test_insert_period_betweenIdentifiers3() {
9398 // "f() => a b;" 9398 // "f() => a b;"
9399 // "f() => a . b;" 9399 // "f() => a . b;"
9400 assertParse("f() => a ", "", ".", " b;"); 9400 _assertParse("f() => a ", "", ".", " b;");
9401 } 9401 }
9402 9402
9403 void test_insert_period_insideExistingIdentifier() { 9403 void test_insert_period_insideExistingIdentifier() {
9404 // "f() => ab;" 9404 // "f() => ab;"
9405 // "f() => a.b;" 9405 // "f() => a.b;"
9406 assertParse("f() => a", "", ".", "b;"); 9406 _assertParse("f() => a", "", ".", "b;");
9407 } 9407 }
9408 9408
9409 void test_insert_periodAndIdentifier() { 9409 void test_insert_periodAndIdentifier() {
9410 // "f() => a + b;" 9410 // "f() => a + b;"
9411 // "f() => a + b.x;" 9411 // "f() => a + b.x;"
9412 assertParse("f() => a + b", "", ".x", ";"); 9412 _assertParse("f() => a + b", "", ".x", ";");
9413 } 9413 }
9414 9414
9415 void test_insert_simpleToComplexExression() { 9415 void test_insert_simpleToComplexExression() {
9416 // "/** An [A]. */ class A {} class B { m() => 1; }" 9416 // "/** An [A]. */ class A {} class B { m() => 1; }"
9417 // "/** An [A]. */ class A {} class B { m() => 1 + 2; }" 9417 // "/** An [A]. */ class A {} class B { m() => 1 + 2; }"
9418 assertParse("/** An [A]. */ class A {} class B { m() => 1", "", " + 2", "; } "); 9418 _assertParse("/** An [A]. */ class A {} class B { m() => 1", "", " + 2", "; }");
9419 } 9419 }
9420 9420
9421 void test_insert_whitespace_end() { 9421 void test_insert_whitespace_end() {
9422 // "f() => a + b;" 9422 // "f() => a + b;"
9423 // "f() => a + b; " 9423 // "f() => a + b; "
9424 assertParse("f() => a + b;", "", " ", ""); 9424 _assertParse("f() => a + b;", "", " ", "");
9425 } 9425 }
9426 9426
9427 void test_insert_whitespace_end_multiple() { 9427 void test_insert_whitespace_end_multiple() {
9428 // "f() => a + b;" 9428 // "f() => a + b;"
9429 // "f() => a + b; " 9429 // "f() => a + b; "
9430 assertParse("f() => a + b;", "", " ", ""); 9430 _assertParse("f() => a + b;", "", " ", "");
9431 } 9431 }
9432 9432
9433 void test_insert_whitespace_middle() { 9433 void test_insert_whitespace_middle() {
9434 // "f() => a + b;" 9434 // "f() => a + b;"
9435 // "f() => a + b;" 9435 // "f() => a + b;"
9436 assertParse("f() => a", "", " ", " + b;"); 9436 _assertParse("f() => a", "", " ", " + b;");
9437 } 9437 }
9438 9438
9439 void test_replace_identifier_beginning() { 9439 void test_replace_identifier_beginning() {
9440 // "f() => bell + b;" 9440 // "f() => bell + b;"
9441 // "f() => fell + b;" 9441 // "f() => fell + b;"
9442 assertParse("f() => ", "b", "f", "ell + b;"); 9442 _assertParse("f() => ", "b", "f", "ell + b;");
9443 } 9443 }
9444 9444
9445 void test_replace_identifier_end() { 9445 void test_replace_identifier_end() {
9446 // "f() => bell + b;" 9446 // "f() => bell + b;"
9447 // "f() => belt + b;" 9447 // "f() => belt + b;"
9448 assertParse("f() => bel", "l", "t", " + b;"); 9448 _assertParse("f() => bel", "l", "t", " + b;");
9449 } 9449 }
9450 9450
9451 void test_replace_identifier_middle() { 9451 void test_replace_identifier_middle() {
9452 // "f() => first + b;" 9452 // "f() => first + b;"
9453 // "f() => frost + b;" 9453 // "f() => frost + b;"
9454 assertParse("f() => f", "ir", "ro", "st + b;"); 9454 _assertParse("f() => f", "ir", "ro", "st + b;");
9455 } 9455 }
9456 9456
9457 void test_replace_multiple_partialFirstAndLast() { 9457 void test_replace_multiple_partialFirstAndLast() {
9458 // "f() => aa + bb;" 9458 // "f() => aa + bb;"
9459 // "f() => ab * ab;" 9459 // "f() => ab * ab;"
9460 assertParse("f() => a", "a + b", "b * a", "b;"); 9460 _assertParse("f() => a", "a + b", "b * a", "b;");
9461 } 9461 }
9462 9462
9463 void test_replace_operator_oneForMany() { 9463 void test_replace_operator_oneForMany() {
9464 // "f() => a + b;" 9464 // "f() => a + b;"
9465 // "f() => a * c - b;" 9465 // "f() => a * c - b;"
9466 assertParse("f() => a ", "+", "* c -", " b;"); 9466 _assertParse("f() => a ", "+", "* c -", " b;");
9467 } 9467 }
9468 9468
9469 void test_replace_operator_oneForOne() { 9469 void test_replace_operator_oneForOne() {
9470 // "f() => a + b;" 9470 // "f() => a + b;"
9471 // "f() => a * b;" 9471 // "f() => a * b;"
9472 assertParse("f() => a ", "+", "*", " b;"); 9472 _assertParse("f() => a ", "+", "*", " b;");
9473 } 9473 }
9474 9474
9475 /** 9475 /**
9476 * Given a description of the original and modified contents, perform an incre mental scan of the 9476 * Given a description of the original and modified contents, perform an incre mental scan of the
9477 * two pieces of text. 9477 * two pieces of text.
9478 * 9478 *
9479 * @param prefix the unchanged text before the edit region 9479 * @param prefix the unchanged text before the edit region
9480 * @param removed the text that was removed from the original contents 9480 * @param removed the text that was removed from the original contents
9481 * @param added the text that was added to the modified contents 9481 * @param added the text that was added to the modified contents
9482 * @param suffix the unchanged text after the edit region 9482 * @param suffix the unchanged text after the edit region
9483 */ 9483 */
9484 void assertParse(String prefix, String removed, String added, String suffix) { 9484 void _assertParse(String prefix, String removed, String added, String suffix) {
9485 // 9485 //
9486 // Compute the information needed to perform the test. 9486 // Compute the information needed to perform the test.
9487 // 9487 //
9488 String originalContents = "${prefix}${removed}${suffix}"; 9488 String originalContents = "${prefix}${removed}${suffix}";
9489 String modifiedContents = "${prefix}${added}${suffix}"; 9489 String modifiedContents = "${prefix}${added}${suffix}";
9490 int replaceStart = prefix.length; 9490 int replaceStart = prefix.length;
9491 Source source = new TestSource(); 9491 Source source = new TestSource();
9492 // 9492 //
9493 // Parse the original contents. 9493 // Parse the original contents.
9494 // 9494 //
(...skipping 2226 matching lines...) Expand 10 before | Expand all | Expand 10 after
11721 } 11721 }
11722 11722
11723 main() { 11723 main() {
11724 ComplexParserTest.dartSuite(); 11724 ComplexParserTest.dartSuite();
11725 ErrorParserTest.dartSuite(); 11725 ErrorParserTest.dartSuite();
11726 IncrementalParserTest.dartSuite(); 11726 IncrementalParserTest.dartSuite();
11727 NonErrorParserTest.dartSuite(); 11727 NonErrorParserTest.dartSuite();
11728 RecoveryParserTest.dartSuite(); 11728 RecoveryParserTest.dartSuite();
11729 ResolutionCopierTest.dartSuite(); 11729 ResolutionCopierTest.dartSuite();
11730 SimpleParserTest.dartSuite(); 11730 SimpleParserTest.dartSuite();
11731 } 11731 }
11732 Map<String, MethodTrampoline> _methodTable_Parser = <String, MethodTrampoline> {
11733 'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseCompilationUnit(arg0)),
11734 'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseExpression(arg0)),
11735 'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseStatement(arg0)),
11736 'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseStatements(arg0)),
11737 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn notation()),
11738 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu ment()),
11739 'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parse ArgumentList()),
11740 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseBitwiseOrExpression()),
11741 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock() ),
11742 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target. parseClassMember(arg0)),
11743 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()),
11744 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar get.parseConditionalExpression()),
11745 'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstructorName()),
11746 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx pression2()),
11747 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target.parseExpressionWithoutCascade()),
11748 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars eExtendsClause()),
11749 'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => targe t.parseFormalParameterList()),
11750 'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target .parseFunctionExpression()),
11751 'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.p arseImplementsClause()),
11752 'parseLabel_0': new MethodTrampoline(0, (Parser target) => target.parseLabel() ),
11753 'parseLibraryIdentifier_0': new MethodTrampoline(0, (Parser target) => target. parseLibraryIdentifier()),
11754 'parseLogicalOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseLogicalOrExpression()),
11755 'parseMapLiteralEntry_0': new MethodTrampoline(0, (Parser target) => target.pa rseMapLiteralEntry()),
11756 'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => tar get.parseNormalFormalParameter()),
11757 'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target .parsePrefixedIdentifier()),
11758 'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseRe turnType()),
11759 'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.p arseSimpleIdentifier()),
11760 'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseSta tement2()),
11761 'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eStringLiteral()),
11762 'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.p arseTypeArgumentList()),
11763 'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseType Name()),
11764 'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.pars eTypeParameter()),
11765 'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target. parseTypeParameterList()),
11766 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi thClause()),
11767 'advance_0': new MethodTrampoline(0, (Parser target) => target.advance()),
11768 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg 2, arg3, arg4) => target.appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
11769 'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.computeStringValue(arg0, arg1, arg2)),
11770 'convertToFunctionDeclaration_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.convertToFunctionDeclaration(arg0)),
11771 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe t) => target.couldBeStartOfCompilationUnitMember()),
11772 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ et.createSyntheticIdentifier()),
11773 'createSyntheticKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.createSyntheticKeyword(arg0)),
11774 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t arget.createSyntheticStringLiteral()),
11775 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.createSyntheticToken(arg0)),
11776 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target. ensureAssignable(arg0)),
11777 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg 0)),
11778 'expectKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => target.exp ectKeyword(arg0)),
11779 'expectSemicolon_0': new MethodTrampoline(0, (Parser target) => target.expectS emicolon()),
11780 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f indRange(arg0, arg1)),
11781 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.getCodeBlockRanges(arg0)),
11782 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn dToken(arg0)),
11783 'injectToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.injec tToken(arg0)),
11784 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i sFunctionDeclaration()),
11785 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.isFunctionExpression(arg0)),
11786 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD igit(arg0)),
11787 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isInitializedVariableDeclaration()),
11788 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. isLinkText(arg0, arg1)),
11789 'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target.isOper ator(arg0)),
11790 'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target.isSwitch Member()),
11791 'isTypedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target .isTypedIdentifier(arg0)),
11792 'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.le xicallyFirst(arg0)),
11793 'lockErrorListener_0': new MethodTrampoline(0, (Parser target) => target.lockE rrorListener()),
11794 'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(a rg0)),
11795 'matchesAny_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. matchesAny(arg0, arg1)),
11796 'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target.match esIdentifier()),
11797 'matchesKeyword_1': new MethodTrampoline(1, (Parser target, arg0) => target.ma tchesKeyword(arg0)),
11798 'matchesString_1': new MethodTrampoline(1, (Parser target, arg0) => target.mat chesString(arg0)),
11799 'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target.optional (arg0)),
11800 'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target .parseAdditiveExpression()),
11801 'parseArgumentDefinitionTest_0': new MethodTrampoline(0, (Parser target) => ta rget.parseArgumentDefinitionTest()),
11802 'parseAssertStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseAssertStatement()),
11803 'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) = > target.parseAssignableExpression(arg0)),
11804 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg 1) => target.parseAssignableSelector(arg0, arg1)),
11805 'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseBitwiseAndExpression()),
11806 'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseBitwiseXorExpression()),
11807 'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target.par seBreakStatement()),
11808 'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target.par seCascadeSection()),
11809 'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseClassDeclaration(arg0, arg1)),
11810 'parseClassMembers_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseClassMembers(arg0, arg1)),
11811 'parseClassTypeAlias_3': new MethodTrampoline(3, (Parser target, arg0, arg1, a rg2) => target.parseClassTypeAlias(arg0, arg1, arg2)),
11812 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target.parseC ombinators()),
11813 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target .parseCommentAndMetadata()),
11814 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseCommentReference(arg0, arg1)),
11815 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.parseCommentReferences(arg0)),
11816 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseCompilationUnitMember(arg0)),
11817 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstExpression()),
11818 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2 , arg3, arg4, arg5, arg6, arg7) => target.parseConstructor(arg0, arg1, arg2, arg 3, arg4, arg5, arg6, arg7)),
11819 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target.parseConstructorFieldInitializer()),
11820 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. parseContinueStatement()),
11821 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseDirective(arg0)),
11822 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et.parseDocumentationComment()),
11823 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target.parseD oStatement()),
11824 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target.par seEmptyStatement()),
11825 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target .parseEqualityExpression()),
11826 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseExportDirective(arg0)),
11827 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par seExpressionList()),
11828 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseFinalConstVarOrType(arg0)),
11829 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseFormalParameter(arg0)),
11830 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target.parse ForStatement()),
11831 'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg 2) => target.parseFunctionBody(arg0, arg1, arg2)),
11832 'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0, ar g1, arg2) => target.parseFunctionDeclaration(arg0, arg1, arg2)),
11833 'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target) => target.parseFunctionDeclarationStatement()),
11834 'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseFunctionDeclarationStatementAfterRetu rnType(arg0, arg1)),
11835 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1 ) => target.parseFunctionTypeAlias(arg0, arg1)),
11836 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseGetter(arg0, arg1, arg2, arg3)),
11837 'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target.par seIdentifierList()),
11838 'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target.parseI fStatement()),
11839 'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseImportDirective(arg0)),
11840 'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, ar g0, arg1, arg2, arg3) => target.parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
11841 'parseInstanceCreationExpression_1': new MethodTrampoline(1, (Parser target, a rg0) => target.parseInstanceCreationExpression(arg0)),
11842 'parseLibraryDirective_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.parseLibraryDirective(arg0)),
11843 'parseLibraryName_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t arget.parseLibraryName(arg0, arg1)),
11844 'parseListLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t arget.parseListLiteral(arg0, arg1)),
11845 'parseListOrMapLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.parseListOrMapLiteral(arg0)),
11846 'parseLogicalAndExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseLogicalAndExpression()),
11847 'parseMapLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => ta rget.parseMapLiteral(arg0, arg1)),
11848 'parseMethodDeclarationAfterParameters_6': new MethodTrampoline(6, (Parser tar get, arg0, arg1, arg2, arg3, arg4, arg5) => target.parseMethodDeclarationAfterPa rameters(arg0, arg1, arg2, arg3, arg4, arg5)),
11849 'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(4, (Parser tar get, arg0, arg1, arg2, arg3) => target.parseMethodDeclarationAfterReturnType(arg 0, arg1, arg2, arg3)),
11850 'parseModifiers_0': new MethodTrampoline(0, (Parser target) => target.parseMod ifiers()),
11851 'parseMultiplicativeExpression_0': new MethodTrampoline(0, (Parser target) => target.parseMultiplicativeExpression()),
11852 'parseNativeClause_0': new MethodTrampoline(0, (Parser target) => target.parse NativeClause()),
11853 'parseNewExpression_0': new MethodTrampoline(0, (Parser target) => target.pars eNewExpression()),
11854 'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => targe t.parseNonLabeledStatement()),
11855 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) = > target.parseOperator(arg0, arg1, arg2)),
11856 'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target .parseOptionalReturnType()),
11857 'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.parsePartDirective(arg0)),
11858 'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePostfixExpression()),
11859 'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePrimaryExpression()),
11860 'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser tar get) => target.parseRedirectingConstructorInvocation()),
11861 'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseRelationalExpression()),
11862 'parseRethrowExpression_0': new MethodTrampoline(0, (Parser target) => target. parseRethrowExpression()),
11863 'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseReturnStatement()),
11864 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseSetter(arg0, arg1, arg2, arg3)),
11865 'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseShiftExpression()),
11866 'parseStatementList_0': new MethodTrampoline(0, (Parser target) => target.pars eStatementList()),
11867 'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStringInterpolation(arg0)),
11868 'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) = > target.parseSuperConstructorInvocation()),
11869 'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseSwitchStatement()),
11870 'parseSymbolLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eSymbolLiteral()),
11871 'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseThrowExpression()),
11872 'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target ) => target.parseThrowExpressionWithoutCascade()),
11873 'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target.parse TryStatement()),
11874 'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseTypeAlias(arg0)),
11875 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseUnaryExpression()),
11876 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe t.parseVariableDeclaration()),
11877 'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseVariableDeclarationListAfterMetadata(arg0)),
11878 'parseVariableDeclarationListAfterType_3': new MethodTrampoline(3, (Parser tar get, arg0, arg1, arg2) => target.parseVariableDeclarationListAfterType(arg0, arg 1, arg2)),
11879 'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(1, (P arser target, arg0) => target.parseVariableDeclarationStatementAfterMetadata(arg 0)),
11880 'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(3, (Parse r target, arg0, arg1, arg2) => target.parseVariableDeclarationStatementAfterType (arg0, arg1, arg2)),
11881 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par seWhileStatement()),
11882 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()),
11883 'peekAt_1': new MethodTrampoline(1, (Parser target, arg0) => target.peekAt(arg 0)),
11884 'reportError_1': new MethodTrampoline(1, (Parser target, arg0) => target.repor tError(arg0)),
11885 'reportErrorForCurrentToken_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.reportErrorForCurrentToken(arg0, arg1)),
11886 'reportErrorForNode_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.reportErrorForNode(arg0, arg1, arg2)),
11887 'reportErrorForToken_3': new MethodTrampoline(3, (Parser target, arg0, arg1, a rg2) => target.reportErrorForToken(arg0, arg1, arg2)),
11888 'skipBlock_0': new MethodTrampoline(0, (Parser target) => target.skipBlock()),
11889 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFinalConstVarOrType(arg0)),
11890 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFormalParameterList(arg0)),
11891 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipPastMatchingToken(arg0)),
11892 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.skipPrefixedIdentifier(arg0)),
11893 'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target.sk ipReturnType(arg0)),
11894 'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.skipSimpleIdentifier(arg0)),
11895 'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipStringInterpolation(arg0)),
11896 'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target .skipStringLiteral(arg0)),
11897 'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.skipTypeArgumentList(arg0)),
11898 'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target.skip TypeName(arg0)),
11899 'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipTypeParameterList(arg0)),
11900 'tokenMatches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => targe t.tokenMatches(arg0, arg1)),
11901 'tokenMatchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.tokenMatchesIdentifier(arg0)),
11902 'tokenMatchesKeyword_2': new MethodTrampoline(2, (Parser target, arg0, arg1) = > target.tokenMatchesKeyword(arg0, arg1)),
11903 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.translateCharacter(arg0, arg1, arg2)),
11904 'unlockErrorListener_0': new MethodTrampoline(0, (Parser target) => target.unl ockErrorListener()),
11905 'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateFormalParameterList(arg0)),
11906 'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) = > target.validateModifiersForClass(arg0)),
11907 'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, a rg0) => target.validateModifiersForConstructor(arg0)),
11908 'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) = > target.validateModifiersForField(arg0)),
11909 'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForFunctionDeclarationStatement (arg0)),
11910 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parse r target, arg0) => target.validateModifiersForGetterOrSetterOrMethod(arg0)),
11911 'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.validateModifiersForOperator(arg0)),
11912 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser t arget, arg0) => target.validateModifiersForTopLevelDeclaration(arg0)),
11913 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)),
11914 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)),
11915 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),};
11916
11917
11918 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) {
11919 parser.currentToken = tokenStream;
11920 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} '];
11921 return method.invoke(parser, objects);
11922 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/ast_test.dart ('k') | pkg/analyzer/test/generated/resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698