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

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

Issue 45573002: Rename analyzer_experimental to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks before publishing. Created 7 years, 1 month 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
(Empty)
1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information.
3 library engine.parser_test;
4 import 'package:analyzer_experimental/src/generated/java_core.dart';
5 import 'package:analyzer_experimental/src/generated/java_junit.dart';
6 import 'package:analyzer_experimental/src/generated/error.dart';
7 import 'package:analyzer_experimental/src/generated/scanner.dart';
8 import 'package:analyzer_experimental/src/generated/ast.dart';
9 import 'package:analyzer_experimental/src/generated/parser.dart';
10 import 'package:analyzer_experimental/src/generated/utilities_dart.dart';
11 import 'package:unittest/unittest.dart' as _ut;
12 import 'test_support.dart';
13 import 'scanner_test.dart' show TokenFactory;
14 import 'ast_test.dart' show ASTFactory;
15 /**
16 * The class `SimpleParserTest` defines parser tests that test individual parsin g method. The
17 * code fragments should be as minimal as possible in order to test the method, but should not test
18 * the interactions between the method under test and other methods.
19 *
20 * More complex tests should be defined in the class [ComplexParserTest].
21 */
22 class SimpleParserTest extends ParserTestCase {
23 void fail_parseCommentReference_this() {
24 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["this", 5], "");
25 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier);
26 JUnitTestCase.assertNotNull(identifier.token);
27 JUnitTestCase.assertEquals("a", identifier.name);
28 JUnitTestCase.assertEquals(5, identifier.offset);
29 }
30 void test_computeStringValue_emptyInterpolationPrefix() {
31 JUnitTestCase.assertEquals("", computeStringValue("'''", true, false));
32 }
33 void test_computeStringValue_escape_b() {
34 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'", true, true));
35 }
36 void test_computeStringValue_escape_f() {
37 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'", true, true));
38 }
39 void test_computeStringValue_escape_n() {
40 JUnitTestCase.assertEquals("\n", computeStringValue("'\\n'", true, true));
41 }
42 void test_computeStringValue_escape_notSpecial() {
43 JUnitTestCase.assertEquals(":", computeStringValue("'\\:'", true, true));
44 }
45 void test_computeStringValue_escape_r() {
46 JUnitTestCase.assertEquals("\r", computeStringValue("'\\r'", true, true));
47 }
48 void test_computeStringValue_escape_t() {
49 JUnitTestCase.assertEquals("\t", computeStringValue("'\\t'", true, true));
50 }
51 void test_computeStringValue_escape_u_fixed() {
52 JUnitTestCase.assertEquals("\u4321", computeStringValue("'\\u4321'", true, t rue));
53 }
54 void test_computeStringValue_escape_u_variable() {
55 JUnitTestCase.assertEquals("\u0123", computeStringValue("'\\u{123}'", true, true));
56 }
57 void test_computeStringValue_escape_v() {
58 JUnitTestCase.assertEquals("\u000B", computeStringValue("'\\v'", true, true) );
59 }
60 void test_computeStringValue_escape_x() {
61 JUnitTestCase.assertEquals("\u00FF", computeStringValue("'\\xFF'", true, tru e));
62 }
63 void test_computeStringValue_noEscape_single() {
64 JUnitTestCase.assertEquals("text", computeStringValue("'text'", true, true)) ;
65 }
66 void test_computeStringValue_noEscape_triple() {
67 JUnitTestCase.assertEquals("text", computeStringValue("'''text'''", true, tr ue));
68 }
69 void test_computeStringValue_raw_single() {
70 JUnitTestCase.assertEquals("text", computeStringValue("r'text'", true, true) );
71 }
72 void test_computeStringValue_raw_triple() {
73 JUnitTestCase.assertEquals("text", computeStringValue("r'''text'''", true, t rue));
74 }
75 void test_computeStringValue_raw_withEscape() {
76 JUnitTestCase.assertEquals("two\\nlines", computeStringValue("r'two\\nlines' ", true, true));
77 }
78 void test_computeStringValue_triple_internalQuote_first_empty() {
79 JUnitTestCase.assertEquals("'", computeStringValue("''''", true, false));
80 }
81 void test_computeStringValue_triple_internalQuote_first_nonEmpty() {
82 JUnitTestCase.assertEquals("'text", computeStringValue("''''text", true, fal se));
83 }
84 void test_computeStringValue_triple_internalQuote_last_empty() {
85 JUnitTestCase.assertEquals("", computeStringValue("'''", false, true));
86 }
87 void test_computeStringValue_triple_internalQuote_last_nonEmpty() {
88 JUnitTestCase.assertEquals("text", computeStringValue("text'''", false, true ));
89 }
90 void test_constFactory() {
91 ParserTestCase.parse("parseClassMember", <Object> ["C"], "const factory C() = A;");
92 }
93 void test_createSyntheticIdentifier() {
94 SimpleIdentifier identifier = createSyntheticIdentifier();
95 JUnitTestCase.assertTrue(identifier.isSynthetic);
96 }
97 void test_createSyntheticStringLiteral() {
98 SimpleStringLiteral literal = createSyntheticStringLiteral();
99 JUnitTestCase.assertTrue(literal.isSynthetic);
100 }
101 void test_isFunctionDeclaration_nameButNoReturn_block() {
102 JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}"));
103 }
104 void test_isFunctionDeclaration_nameButNoReturn_expression() {
105 JUnitTestCase.assertTrue(isFunctionDeclaration("f() => e"));
106 }
107 void test_isFunctionDeclaration_normalReturn_block() {
108 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() {}"));
109 }
110 void test_isFunctionDeclaration_normalReturn_expression() {
111 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() => e"));
112 }
113 void test_isFunctionDeclaration_voidReturn_block() {
114 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() {}"));
115 }
116 void test_isFunctionDeclaration_voidReturn_expression() {
117 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() => e"));
118 }
119 void test_isFunctionExpression_false_noBody() {
120 JUnitTestCase.assertFalse(isFunctionExpression("f();"));
121 }
122 void test_isFunctionExpression_false_notParameters() {
123 JUnitTestCase.assertFalse(isFunctionExpression("(a + b) {"));
124 }
125 void test_isFunctionExpression_noName_block() {
126 JUnitTestCase.assertTrue(isFunctionExpression("() {}"));
127 }
128 void test_isFunctionExpression_noName_expression() {
129 JUnitTestCase.assertTrue(isFunctionExpression("() => e"));
130 }
131 void test_isFunctionExpression_parameter_multiple() {
132 JUnitTestCase.assertTrue(isFunctionExpression("(a, b) {}"));
133 }
134 void test_isFunctionExpression_parameter_named() {
135 JUnitTestCase.assertTrue(isFunctionExpression("({a}) {}"));
136 }
137 void test_isFunctionExpression_parameter_optional() {
138 JUnitTestCase.assertTrue(isFunctionExpression("([a]) {}"));
139 }
140 void test_isFunctionExpression_parameter_single() {
141 JUnitTestCase.assertTrue(isFunctionExpression("(a) {}"));
142 }
143 void test_isFunctionExpression_parameter_typed() {
144 JUnitTestCase.assertTrue(isFunctionExpression("(int a, int b) {}"));
145 }
146 void test_isInitializedVariableDeclaration_assignment() {
147 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a = null;"));
148 }
149 void test_isInitializedVariableDeclaration_comparison() {
150 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a < 0;"));
151 }
152 void test_isInitializedVariableDeclaration_conditional() {
153 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a == null ? init () : update();"));
154 }
155 void test_isInitializedVariableDeclaration_const_noType_initialized() {
156 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a = 0;"));
157 }
158 void test_isInitializedVariableDeclaration_const_noType_uninitialized() {
159 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a;"));
160 }
161 void test_isInitializedVariableDeclaration_const_simpleType_uninitialized() {
162 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const A a;"));
163 }
164 void test_isInitializedVariableDeclaration_final_noType_initialized() {
165 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a = 0;"));
166 }
167 void test_isInitializedVariableDeclaration_final_noType_uninitialized() {
168 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a;"));
169 }
170 void test_isInitializedVariableDeclaration_final_simpleType_initialized() {
171 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final A a = 0;")) ;
172 }
173 void test_isInitializedVariableDeclaration_functionDeclaration_typed() {
174 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("A f() {};"));
175 }
176 void test_isInitializedVariableDeclaration_functionDeclaration_untyped() {
177 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("f() {};"));
178 }
179 void test_isInitializedVariableDeclaration_noType_initialized() {
180 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a = 0;"));
181 }
182 void test_isInitializedVariableDeclaration_noType_uninitialized() {
183 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a;"));
184 }
185 void test_isInitializedVariableDeclaration_parameterizedType_initialized() {
186 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a = nul l;"));
187 }
188 void test_isInitializedVariableDeclaration_parameterizedType_uninitialized() {
189 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a;"));
190 }
191 void test_isInitializedVariableDeclaration_simpleType_initialized() {
192 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a = 0;"));
193 }
194 void test_isInitializedVariableDeclaration_simpleType_uninitialized() {
195 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a;"));
196 }
197 void test_isSwitchMember_case_labeled() {
198 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: case"));
199 }
200 void test_isSwitchMember_case_unlabeled() {
201 JUnitTestCase.assertTrue(isSwitchMember("case"));
202 }
203 void test_isSwitchMember_default_labeled() {
204 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default"));
205 }
206 void test_isSwitchMember_default_unlabeled() {
207 JUnitTestCase.assertTrue(isSwitchMember("default"));
208 }
209 void test_isSwitchMember_false() {
210 JUnitTestCase.assertFalse(isSwitchMember("break;"));
211 }
212 void test_parseAdditiveExpression_normal() {
213 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "x + y", []);
214 JUnitTestCase.assertNotNull(expression.leftOperand);
215 JUnitTestCase.assertNotNull(expression.operator);
216 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
217 JUnitTestCase.assertNotNull(expression.rightOperand);
218 }
219 void test_parseAdditiveExpression_super() {
220 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "super + y", []);
221 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
222 JUnitTestCase.assertNotNull(expression.operator);
223 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
224 JUnitTestCase.assertNotNull(expression.rightOperand);
225 }
226 void test_parseAnnotation_n1() {
227 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A", []);
228 JUnitTestCase.assertNotNull(annotation.atSign);
229 JUnitTestCase.assertNotNull(annotation.name);
230 JUnitTestCase.assertNull(annotation.period);
231 JUnitTestCase.assertNull(annotation.constructorName);
232 JUnitTestCase.assertNull(annotation.arguments);
233 }
234 void test_parseAnnotation_n1_a() {
235 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A(x,y)", []);
236 JUnitTestCase.assertNotNull(annotation.atSign);
237 JUnitTestCase.assertNotNull(annotation.name);
238 JUnitTestCase.assertNull(annotation.period);
239 JUnitTestCase.assertNull(annotation.constructorName);
240 JUnitTestCase.assertNotNull(annotation.arguments);
241 }
242 void test_parseAnnotation_n2() {
243 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B", []) ;
244 JUnitTestCase.assertNotNull(annotation.atSign);
245 JUnitTestCase.assertNotNull(annotation.name);
246 JUnitTestCase.assertNull(annotation.period);
247 JUnitTestCase.assertNull(annotation.constructorName);
248 JUnitTestCase.assertNull(annotation.arguments);
249 }
250 void test_parseAnnotation_n2_a() {
251 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B(x,y)" , []);
252 JUnitTestCase.assertNotNull(annotation.atSign);
253 JUnitTestCase.assertNotNull(annotation.name);
254 JUnitTestCase.assertNull(annotation.period);
255 JUnitTestCase.assertNull(annotation.constructorName);
256 JUnitTestCase.assertNotNull(annotation.arguments);
257 }
258 void test_parseAnnotation_n3() {
259 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C", [ ]);
260 JUnitTestCase.assertNotNull(annotation.atSign);
261 JUnitTestCase.assertNotNull(annotation.name);
262 JUnitTestCase.assertNotNull(annotation.period);
263 JUnitTestCase.assertNotNull(annotation.constructorName);
264 JUnitTestCase.assertNull(annotation.arguments);
265 }
266 void test_parseAnnotation_n3_a() {
267 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C(x,y )", []);
268 JUnitTestCase.assertNotNull(annotation.atSign);
269 JUnitTestCase.assertNotNull(annotation.name);
270 JUnitTestCase.assertNotNull(annotation.period);
271 JUnitTestCase.assertNotNull(annotation.constructorName);
272 JUnitTestCase.assertNotNull(annotation.arguments);
273 }
274 void test_parseArgument_named() {
275 NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x", []);
276 Label name = expression.name;
277 JUnitTestCase.assertNotNull(name);
278 JUnitTestCase.assertNotNull(name.label);
279 JUnitTestCase.assertNotNull(name.colon);
280 JUnitTestCase.assertNotNull(expression.expression);
281 }
282 void test_parseArgument_unnamed() {
283 String lexeme = "x";
284 SimpleIdentifier identifier = ParserTestCase.parse5("parseArgument", lexeme, []);
285 JUnitTestCase.assertEquals(lexeme, identifier.name);
286 }
287 void test_parseArgumentDefinitionTest() {
288 ArgumentDefinitionTest test = ParserTestCase.parse5("parseArgumentDefinition Test", "?x", [ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST]);
289 JUnitTestCase.assertNotNull(test.question);
290 JUnitTestCase.assertNotNull(test.identifier);
291 }
292 void test_parseArgumentList_empty() {
293 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()", []);
294 NodeList<Expression> arguments = argumentList.arguments;
295 EngineTestCase.assertSize(0, arguments);
296 }
297 void test_parseArgumentList_mixed() {
298 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w, x, y: y, z: z)", []);
299 NodeList<Expression> arguments = argumentList.arguments;
300 EngineTestCase.assertSize(4, arguments);
301 }
302 void test_parseArgumentList_noNamed() {
303 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x, y, z)", []);
304 NodeList<Expression> arguments = argumentList.arguments;
305 EngineTestCase.assertSize(3, arguments);
306 }
307 void test_parseArgumentList_onlyNamed() {
308 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x: x, y: y)", []);
309 NodeList<Expression> arguments = argumentList.arguments;
310 EngineTestCase.assertSize(2, arguments);
311 }
312 void test_parseAssertStatement() {
313 AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "a ssert (x);", []);
314 JUnitTestCase.assertNotNull(statement.keyword);
315 JUnitTestCase.assertNotNull(statement.leftParenthesis);
316 JUnitTestCase.assertNotNull(statement.condition);
317 JUnitTestCase.assertNotNull(statement.rightParenthesis);
318 JUnitTestCase.assertNotNull(statement.semicolon);
319 }
320 void test_parseAssignableExpression_expression_args_dot() {
321 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x)(y).z");
322 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE xpressionInvocation;
323 JUnitTestCase.assertNotNull(invocation.function);
324 ArgumentList argumentList = invocation.argumentList;
325 JUnitTestCase.assertNotNull(argumentList);
326 EngineTestCase.assertSize(1, argumentList.arguments);
327 JUnitTestCase.assertNotNull(propertyAccess.operator);
328 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
329 }
330 void test_parseAssignableExpression_expression_dot() {
331 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x).y");
332 JUnitTestCase.assertNotNull(propertyAccess.target);
333 JUnitTestCase.assertNotNull(propertyAccess.operator);
334 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
335 }
336 void test_parseAssignableExpression_expression_index() {
337 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression ", <Object> [false], "(x)[y]");
338 JUnitTestCase.assertNotNull(expression.target);
339 JUnitTestCase.assertNotNull(expression.leftBracket);
340 JUnitTestCase.assertNotNull(expression.index);
341 JUnitTestCase.assertNotNull(expression.rightBracket);
342 }
343 void test_parseAssignableExpression_identifier() {
344 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio n", <Object> [false], "x");
345 JUnitTestCase.assertNotNull(identifier);
346 }
347 void test_parseAssignableExpression_identifier_args_dot() {
348 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "x(y).z");
349 MethodInvocation invocation = propertyAccess.target as MethodInvocation;
350 JUnitTestCase.assertEquals("x", invocation.methodName.name);
351 ArgumentList argumentList = invocation.argumentList;
352 JUnitTestCase.assertNotNull(argumentList);
353 EngineTestCase.assertSize(1, argumentList.arguments);
354 JUnitTestCase.assertNotNull(propertyAccess.operator);
355 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
356 }
357 void test_parseAssignableExpression_identifier_dot() {
358 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "x.y");
359 JUnitTestCase.assertNotNull(propertyAccess.target);
360 JUnitTestCase.assertNotNull(propertyAccess.operator);
361 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
362 }
363 void test_parseAssignableExpression_identifier_index() {
364 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression ", <Object> [false], "x[y]");
365 JUnitTestCase.assertNotNull(expression.target);
366 JUnitTestCase.assertNotNull(expression.leftBracket);
367 JUnitTestCase.assertNotNull(expression.index);
368 JUnitTestCase.assertNotNull(expression.rightBracket);
369 }
370 void test_parseAssignableExpression_super_dot() {
371 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "super.y");
372 EngineTestCase.assertInstanceOf(SuperExpression, propertyAccess.target);
373 JUnitTestCase.assertNotNull(propertyAccess.operator);
374 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
375 }
376 void test_parseAssignableExpression_super_index() {
377 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression ", <Object> [false], "super[y]");
378 EngineTestCase.assertInstanceOf(SuperExpression, expression.target);
379 JUnitTestCase.assertNotNull(expression.leftBracket);
380 JUnitTestCase.assertNotNull(expression.index);
381 JUnitTestCase.assertNotNull(expression.rightBracket);
382 }
383 void test_parseAssignableSelector_dot() {
384 PropertyAccess selector = ParserTestCase.parse("parseAssignableSelector", <O bject> [null, true], ".x");
385 JUnitTestCase.assertNotNull(selector.operator);
386 JUnitTestCase.assertNotNull(selector.propertyName);
387 }
388 void test_parseAssignableSelector_index() {
389 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", < Object> [null, true], "[x]");
390 JUnitTestCase.assertNotNull(selector.leftBracket);
391 JUnitTestCase.assertNotNull(selector.index);
392 JUnitTestCase.assertNotNull(selector.rightBracket);
393 }
394 void test_parseAssignableSelector_none() {
395 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier.full(null), true], ";");
396 JUnitTestCase.assertNotNull(selector);
397 }
398 void test_parseBitwiseAndExpression_normal() {
399 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "x & y", []);
400 JUnitTestCase.assertNotNull(expression.leftOperand);
401 JUnitTestCase.assertNotNull(expression.operator);
402 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
403 JUnitTestCase.assertNotNull(expression.rightOperand);
404 }
405 void test_parseBitwiseAndExpression_super() {
406 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "super & y", []);
407 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
408 JUnitTestCase.assertNotNull(expression.operator);
409 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
410 JUnitTestCase.assertNotNull(expression.rightOperand);
411 }
412 void test_parseBitwiseOrExpression_normal() {
413 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "x | y", []);
414 JUnitTestCase.assertNotNull(expression.leftOperand);
415 JUnitTestCase.assertNotNull(expression.operator);
416 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
417 JUnitTestCase.assertNotNull(expression.rightOperand);
418 }
419 void test_parseBitwiseOrExpression_super() {
420 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "super | y", []);
421 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
422 JUnitTestCase.assertNotNull(expression.operator);
423 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
424 JUnitTestCase.assertNotNull(expression.rightOperand);
425 }
426 void test_parseBitwiseXorExpression_normal() {
427 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "x ^ y", []);
428 JUnitTestCase.assertNotNull(expression.leftOperand);
429 JUnitTestCase.assertNotNull(expression.operator);
430 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
431 JUnitTestCase.assertNotNull(expression.rightOperand);
432 }
433 void test_parseBitwiseXorExpression_super() {
434 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "super ^ y", []);
435 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
436 JUnitTestCase.assertNotNull(expression.operator);
437 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
438 JUnitTestCase.assertNotNull(expression.rightOperand);
439 }
440 void test_parseBlock_empty() {
441 Block block = ParserTestCase.parse5("parseBlock", "{}", []);
442 JUnitTestCase.assertNotNull(block.leftBracket);
443 EngineTestCase.assertSize(0, block.statements);
444 JUnitTestCase.assertNotNull(block.rightBracket);
445 }
446 void test_parseBlock_nonEmpty() {
447 Block block = ParserTestCase.parse5("parseBlock", "{;}", []);
448 JUnitTestCase.assertNotNull(block.leftBracket);
449 EngineTestCase.assertSize(1, block.statements);
450 JUnitTestCase.assertNotNull(block.rightBracket);
451 }
452 void test_parseBreakStatement_label() {
453 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak foo;", []);
454 JUnitTestCase.assertNotNull(statement.keyword);
455 JUnitTestCase.assertNotNull(statement.label);
456 JUnitTestCase.assertNotNull(statement.semicolon);
457 }
458 void test_parseBreakStatement_noLabel() {
459 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
460 JUnitTestCase.assertNotNull(statement.keyword);
461 JUnitTestCase.assertNull(statement.label);
462 JUnitTestCase.assertNotNull(statement.semicolon);
463 }
464 void test_parseCascadeSection_i() {
465 IndexExpression section = ParserTestCase.parse5("parseCascadeSection", "..[i ]", []);
466 JUnitTestCase.assertNull(section.target);
467 JUnitTestCase.assertNotNull(section.leftBracket);
468 JUnitTestCase.assertNotNull(section.index);
469 JUnitTestCase.assertNotNull(section.rightBracket);
470 }
471 void test_parseCascadeSection_ia() {
472 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..[i](b)", []);
473 EngineTestCase.assertInstanceOf(IndexExpression, section.function);
474 JUnitTestCase.assertNotNull(section.argumentList);
475 }
476 void test_parseCascadeSection_p() {
477 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a", []);
478 JUnitTestCase.assertNull(section.target);
479 JUnitTestCase.assertNotNull(section.operator);
480 JUnitTestCase.assertNotNull(section.propertyName);
481 }
482 void test_parseCascadeSection_p_assign() {
483 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3", []);
484 JUnitTestCase.assertNotNull(section.leftHandSide);
485 JUnitTestCase.assertNotNull(section.operator);
486 Expression rhs = section.rightHandSide;
487 JUnitTestCase.assertNotNull(rhs);
488 }
489 void test_parseCascadeSection_p_assign_withCascade() {
490 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3..m()", []);
491 JUnitTestCase.assertNotNull(section.leftHandSide);
492 JUnitTestCase.assertNotNull(section.operator);
493 Expression rhs = section.rightHandSide;
494 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs);
495 }
496 void test_parseCascadeSection_p_builtIn() {
497 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..as" , []);
498 JUnitTestCase.assertNull(section.target);
499 JUnitTestCase.assertNotNull(section.operator);
500 JUnitTestCase.assertNotNull(section.propertyName);
501 }
502 void test_parseCascadeSection_pa() {
503 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a (b)", []);
504 JUnitTestCase.assertNull(section.target);
505 JUnitTestCase.assertNotNull(section.period);
506 JUnitTestCase.assertNotNull(section.methodName);
507 JUnitTestCase.assertNotNull(section.argumentList);
508 EngineTestCase.assertSize(1, section.argumentList.arguments);
509 }
510 void test_parseCascadeSection_paa() {
511 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c)", []);
512 EngineTestCase.assertInstanceOf(MethodInvocation, section.function);
513 JUnitTestCase.assertNotNull(section.argumentList);
514 EngineTestCase.assertSize(1, section.argumentList.arguments);
515 }
516 void test_parseCascadeSection_paapaa() {
517 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c).d(e)(f)", []);
518 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi on);
519 JUnitTestCase.assertNotNull(section.argumentList);
520 EngineTestCase.assertSize(1, section.argumentList.arguments);
521 }
522 void test_parseCascadeSection_pap() {
523 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a(b ).c", []);
524 JUnitTestCase.assertNotNull(section.target);
525 JUnitTestCase.assertNotNull(section.operator);
526 JUnitTestCase.assertNotNull(section.propertyName);
527 }
528 void test_parseClassDeclaration_abstract() {
529 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [
530 emptyCommentAndMetadata(),
531 TokenFactory.token(Keyword.ABSTRACT)], "class A {}");
532 JUnitTestCase.assertNull(declaration.documentationComment);
533 JUnitTestCase.assertNotNull(declaration.abstractKeyword);
534 JUnitTestCase.assertNull(declaration.extendsClause);
535 JUnitTestCase.assertNull(declaration.implementsClause);
536 JUnitTestCase.assertNotNull(declaration.classKeyword);
537 JUnitTestCase.assertNotNull(declaration.leftBracket);
538 JUnitTestCase.assertNotNull(declaration.name);
539 EngineTestCase.assertSize(0, declaration.members);
540 JUnitTestCase.assertNotNull(declaration.rightBracket);
541 JUnitTestCase.assertNull(declaration.typeParameters);
542 }
543 void test_parseClassDeclaration_empty() {
544 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A {}");
545 JUnitTestCase.assertNull(declaration.documentationComment);
546 JUnitTestCase.assertNull(declaration.abstractKeyword);
547 JUnitTestCase.assertNull(declaration.extendsClause);
548 JUnitTestCase.assertNull(declaration.implementsClause);
549 JUnitTestCase.assertNotNull(declaration.classKeyword);
550 JUnitTestCase.assertNotNull(declaration.leftBracket);
551 JUnitTestCase.assertNotNull(declaration.name);
552 EngineTestCase.assertSize(0, declaration.members);
553 JUnitTestCase.assertNotNull(declaration.rightBracket);
554 JUnitTestCase.assertNull(declaration.typeParameters);
555 }
556 void test_parseClassDeclaration_extends() {
557 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B {}");
558 JUnitTestCase.assertNull(declaration.documentationComment);
559 JUnitTestCase.assertNull(declaration.abstractKeyword);
560 JUnitTestCase.assertNotNull(declaration.extendsClause);
561 JUnitTestCase.assertNull(declaration.implementsClause);
562 JUnitTestCase.assertNotNull(declaration.classKeyword);
563 JUnitTestCase.assertNotNull(declaration.leftBracket);
564 JUnitTestCase.assertNotNull(declaration.name);
565 EngineTestCase.assertSize(0, declaration.members);
566 JUnitTestCase.assertNotNull(declaration.rightBracket);
567 JUnitTestCase.assertNull(declaration.typeParameters);
568 }
569 void test_parseClassDeclaration_extendsAndImplements() {
570 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B implements C {}" );
571 JUnitTestCase.assertNull(declaration.documentationComment);
572 JUnitTestCase.assertNull(declaration.abstractKeyword);
573 JUnitTestCase.assertNotNull(declaration.extendsClause);
574 JUnitTestCase.assertNotNull(declaration.implementsClause);
575 JUnitTestCase.assertNotNull(declaration.classKeyword);
576 JUnitTestCase.assertNotNull(declaration.leftBracket);
577 JUnitTestCase.assertNotNull(declaration.name);
578 EngineTestCase.assertSize(0, declaration.members);
579 JUnitTestCase.assertNotNull(declaration.rightBracket);
580 JUnitTestCase.assertNull(declaration.typeParameters);
581 }
582 void test_parseClassDeclaration_extendsAndWith() {
583 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B with C {}");
584 JUnitTestCase.assertNull(declaration.documentationComment);
585 JUnitTestCase.assertNull(declaration.abstractKeyword);
586 JUnitTestCase.assertNotNull(declaration.classKeyword);
587 JUnitTestCase.assertNotNull(declaration.name);
588 JUnitTestCase.assertNull(declaration.typeParameters);
589 JUnitTestCase.assertNotNull(declaration.extendsClause);
590 JUnitTestCase.assertNotNull(declaration.withClause);
591 JUnitTestCase.assertNull(declaration.implementsClause);
592 JUnitTestCase.assertNotNull(declaration.leftBracket);
593 EngineTestCase.assertSize(0, declaration.members);
594 JUnitTestCase.assertNotNull(declaration.rightBracket);
595 }
596 void test_parseClassDeclaration_extendsAndWithAndImplements() {
597 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A extends B with C implement s D {}");
598 JUnitTestCase.assertNull(declaration.documentationComment);
599 JUnitTestCase.assertNull(declaration.abstractKeyword);
600 JUnitTestCase.assertNotNull(declaration.classKeyword);
601 JUnitTestCase.assertNotNull(declaration.name);
602 JUnitTestCase.assertNull(declaration.typeParameters);
603 JUnitTestCase.assertNotNull(declaration.extendsClause);
604 JUnitTestCase.assertNotNull(declaration.withClause);
605 JUnitTestCase.assertNotNull(declaration.implementsClause);
606 JUnitTestCase.assertNotNull(declaration.leftBracket);
607 EngineTestCase.assertSize(0, declaration.members);
608 JUnitTestCase.assertNotNull(declaration.rightBracket);
609 }
610 void test_parseClassDeclaration_implements() {
611 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A implements C {}");
612 JUnitTestCase.assertNull(declaration.documentationComment);
613 JUnitTestCase.assertNull(declaration.abstractKeyword);
614 JUnitTestCase.assertNull(declaration.extendsClause);
615 JUnitTestCase.assertNotNull(declaration.implementsClause);
616 JUnitTestCase.assertNotNull(declaration.classKeyword);
617 JUnitTestCase.assertNotNull(declaration.leftBracket);
618 JUnitTestCase.assertNotNull(declaration.name);
619 EngineTestCase.assertSize(0, declaration.members);
620 JUnitTestCase.assertNotNull(declaration.rightBracket);
621 JUnitTestCase.assertNull(declaration.typeParameters);
622 }
623 void test_parseClassDeclaration_native() {
624 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A native 'nativeValue' {}");
625 NativeClause nativeClause = declaration.nativeClause;
626 JUnitTestCase.assertNotNull(nativeClause);
627 JUnitTestCase.assertNotNull(nativeClause.keyword);
628 JUnitTestCase.assertEquals("nativeValue", nativeClause.name.stringValue);
629 JUnitTestCase.assertSame(nativeClause.keyword, nativeClause.beginToken);
630 JUnitTestCase.assertSame(nativeClause.name.endToken, nativeClause.endToken);
631 }
632 void test_parseClassDeclaration_nonEmpty() {
633 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A {var f;}");
634 JUnitTestCase.assertNull(declaration.documentationComment);
635 JUnitTestCase.assertNull(declaration.abstractKeyword);
636 JUnitTestCase.assertNull(declaration.extendsClause);
637 JUnitTestCase.assertNull(declaration.implementsClause);
638 JUnitTestCase.assertNotNull(declaration.classKeyword);
639 JUnitTestCase.assertNotNull(declaration.leftBracket);
640 JUnitTestCase.assertNotNull(declaration.name);
641 EngineTestCase.assertSize(1, declaration.members);
642 JUnitTestCase.assertNotNull(declaration.rightBracket);
643 JUnitTestCase.assertNull(declaration.typeParameters);
644 }
645 void test_parseClassDeclaration_typeAlias_implementsC() {
646 ClassTypeAlias typeAlias = ParserTestCase.parse("parseClassDeclaration", <Ob ject> [emptyCommentAndMetadata(), null], "class A = Object with B implements C;" );
647 JUnitTestCase.assertNotNull(typeAlias.keyword);
648 JUnitTestCase.assertNotNull(typeAlias.name);
649 JUnitTestCase.assertNull(typeAlias.typeParameters);
650 JUnitTestCase.assertNotNull(typeAlias.withClause);
651 JUnitTestCase.assertNotNull(typeAlias.implementsClause);
652 JUnitTestCase.assertNotNull(typeAlias.implementsClause.keyword);
653 JUnitTestCase.assertEquals(1, typeAlias.implementsClause.interfaces.length);
654 JUnitTestCase.assertNotNull(typeAlias.semicolon);
655 }
656 void test_parseClassDeclaration_typeAlias_withB() {
657 ClassTypeAlias typeAlias = ParserTestCase.parse("parseClassDeclaration", <Ob ject> [emptyCommentAndMetadata(), null], "class A = Object with B;");
658 JUnitTestCase.assertNotNull(typeAlias.keyword);
659 JUnitTestCase.assertNotNull(typeAlias.name);
660 JUnitTestCase.assertNull(typeAlias.typeParameters);
661 JUnitTestCase.assertNotNull(typeAlias.withClause);
662 JUnitTestCase.assertNotNull(typeAlias.withClause.withKeyword);
663 JUnitTestCase.assertEquals(1, typeAlias.withClause.mixinTypes.length);
664 JUnitTestCase.assertNull(typeAlias.implementsClause);
665 JUnitTestCase.assertNotNull(typeAlias.semicolon);
666 }
667 void test_parseClassDeclaration_typeParameters() {
668 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), null], "class A<B> {}");
669 JUnitTestCase.assertNull(declaration.documentationComment);
670 JUnitTestCase.assertNull(declaration.abstractKeyword);
671 JUnitTestCase.assertNull(declaration.extendsClause);
672 JUnitTestCase.assertNull(declaration.implementsClause);
673 JUnitTestCase.assertNotNull(declaration.classKeyword);
674 JUnitTestCase.assertNotNull(declaration.leftBracket);
675 JUnitTestCase.assertNotNull(declaration.name);
676 EngineTestCase.assertSize(0, declaration.members);
677 JUnitTestCase.assertNotNull(declaration.rightBracket);
678 JUnitTestCase.assertNotNull(declaration.typeParameters);
679 EngineTestCase.assertSize(1, declaration.typeParameters.typeParameters);
680 }
681 void test_parseClassMember_constructor_withInitializers() {
682 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember" , <Object> ["C"], "C(_, _\$, this.__) : _a = _ + _\$ {}");
683 JUnitTestCase.assertNotNull(constructor.body);
684 JUnitTestCase.assertNotNull(constructor.separator);
685 JUnitTestCase.assertNull(constructor.externalKeyword);
686 JUnitTestCase.assertNull(constructor.constKeyword);
687 JUnitTestCase.assertNull(constructor.factoryKeyword);
688 JUnitTestCase.assertNull(constructor.name);
689 JUnitTestCase.assertNotNull(constructor.parameters);
690 JUnitTestCase.assertNull(constructor.period);
691 JUnitTestCase.assertNotNull(constructor.returnType);
692 EngineTestCase.assertSize(1, constructor.initializers);
693 }
694 void test_parseClassMember_field_instance_prefixedType() {
695 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [ "C"], "p.A f;");
696 JUnitTestCase.assertNull(field.documentationComment);
697 EngineTestCase.assertSize(0, field.metadata);
698 JUnitTestCase.assertNull(field.staticKeyword);
699 VariableDeclarationList list = field.fields;
700 JUnitTestCase.assertNotNull(list);
701 NodeList<VariableDeclaration> variables = list.variables;
702 EngineTestCase.assertSize(1, variables);
703 VariableDeclaration variable = variables[0];
704 JUnitTestCase.assertNotNull(variable.name);
705 }
706 void test_parseClassMember_field_namedGet() {
707 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [ "C"], "var get;");
708 JUnitTestCase.assertNull(field.documentationComment);
709 EngineTestCase.assertSize(0, field.metadata);
710 JUnitTestCase.assertNull(field.staticKeyword);
711 VariableDeclarationList list = field.fields;
712 JUnitTestCase.assertNotNull(list);
713 NodeList<VariableDeclaration> variables = list.variables;
714 EngineTestCase.assertSize(1, variables);
715 VariableDeclaration variable = variables[0];
716 JUnitTestCase.assertNotNull(variable.name);
717 }
718 void test_parseClassMember_field_namedOperator() {
719 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [ "C"], "var operator;");
720 JUnitTestCase.assertNull(field.documentationComment);
721 EngineTestCase.assertSize(0, field.metadata);
722 JUnitTestCase.assertNull(field.staticKeyword);
723 VariableDeclarationList list = field.fields;
724 JUnitTestCase.assertNotNull(list);
725 NodeList<VariableDeclaration> variables = list.variables;
726 EngineTestCase.assertSize(1, variables);
727 VariableDeclaration variable = variables[0];
728 JUnitTestCase.assertNotNull(variable.name);
729 }
730 void test_parseClassMember_field_namedSet() {
731 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [ "C"], "var set;");
732 JUnitTestCase.assertNull(field.documentationComment);
733 EngineTestCase.assertSize(0, field.metadata);
734 JUnitTestCase.assertNull(field.staticKeyword);
735 VariableDeclarationList list = field.fields;
736 JUnitTestCase.assertNotNull(list);
737 NodeList<VariableDeclaration> variables = list.variables;
738 EngineTestCase.assertSize(1, variables);
739 VariableDeclaration variable = variables[0];
740 JUnitTestCase.assertNotNull(variable.name);
741 }
742 void test_parseClassMember_getter_void() {
743 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void get g {}");
744 JUnitTestCase.assertNull(method.documentationComment);
745 JUnitTestCase.assertNull(method.externalKeyword);
746 JUnitTestCase.assertNull(method.modifierKeyword);
747 JUnitTestCase.assertNotNull(method.propertyKeyword);
748 JUnitTestCase.assertNotNull(method.returnType);
749 JUnitTestCase.assertNotNull(method.name);
750 JUnitTestCase.assertNull(method.operatorKeyword);
751 JUnitTestCase.assertNotNull(method.body);
752 }
753 void test_parseClassMember_method_external() {
754 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "external m();");
755 JUnitTestCase.assertNotNull(method.body);
756 JUnitTestCase.assertNull(method.documentationComment);
757 JUnitTestCase.assertNotNull(method.externalKeyword);
758 JUnitTestCase.assertNull(method.modifierKeyword);
759 JUnitTestCase.assertNotNull(method.name);
760 JUnitTestCase.assertNull(method.operatorKeyword);
761 JUnitTestCase.assertNotNull(method.parameters);
762 JUnitTestCase.assertNull(method.propertyKeyword);
763 JUnitTestCase.assertNull(method.returnType);
764 }
765 void test_parseClassMember_method_external_withTypeAndArgs() {
766 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "external int m(int a);");
767 JUnitTestCase.assertNotNull(method.body);
768 JUnitTestCase.assertNull(method.documentationComment);
769 JUnitTestCase.assertNotNull(method.externalKeyword);
770 JUnitTestCase.assertNull(method.modifierKeyword);
771 JUnitTestCase.assertNotNull(method.name);
772 JUnitTestCase.assertNull(method.operatorKeyword);
773 JUnitTestCase.assertNotNull(method.parameters);
774 JUnitTestCase.assertNull(method.propertyKeyword);
775 JUnitTestCase.assertNotNull(method.returnType);
776 }
777 void test_parseClassMember_method_get_noType() {
778 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "get() {}");
779 JUnitTestCase.assertNull(method.documentationComment);
780 JUnitTestCase.assertNull(method.externalKeyword);
781 JUnitTestCase.assertNull(method.modifierKeyword);
782 JUnitTestCase.assertNull(method.propertyKeyword);
783 JUnitTestCase.assertNull(method.returnType);
784 JUnitTestCase.assertNotNull(method.name);
785 JUnitTestCase.assertNull(method.operatorKeyword);
786 JUnitTestCase.assertNotNull(method.parameters);
787 JUnitTestCase.assertNotNull(method.body);
788 }
789 void test_parseClassMember_method_get_type() {
790 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int get() {}");
791 JUnitTestCase.assertNull(method.documentationComment);
792 JUnitTestCase.assertNull(method.externalKeyword);
793 JUnitTestCase.assertNull(method.modifierKeyword);
794 JUnitTestCase.assertNull(method.propertyKeyword);
795 JUnitTestCase.assertNotNull(method.returnType);
796 JUnitTestCase.assertNotNull(method.name);
797 JUnitTestCase.assertNull(method.operatorKeyword);
798 JUnitTestCase.assertNotNull(method.parameters);
799 JUnitTestCase.assertNotNull(method.body);
800 }
801 void test_parseClassMember_method_get_void() {
802 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void get() {}");
803 JUnitTestCase.assertNull(method.documentationComment);
804 JUnitTestCase.assertNull(method.externalKeyword);
805 JUnitTestCase.assertNull(method.modifierKeyword);
806 JUnitTestCase.assertNull(method.propertyKeyword);
807 JUnitTestCase.assertNotNull(method.returnType);
808 JUnitTestCase.assertNotNull(method.name);
809 JUnitTestCase.assertNull(method.operatorKeyword);
810 JUnitTestCase.assertNotNull(method.parameters);
811 JUnitTestCase.assertNotNull(method.body);
812 }
813 void test_parseClassMember_method_operator_noType() {
814 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "operator() {}");
815 JUnitTestCase.assertNull(method.documentationComment);
816 JUnitTestCase.assertNull(method.externalKeyword);
817 JUnitTestCase.assertNull(method.modifierKeyword);
818 JUnitTestCase.assertNull(method.propertyKeyword);
819 JUnitTestCase.assertNull(method.returnType);
820 JUnitTestCase.assertNotNull(method.name);
821 JUnitTestCase.assertNull(method.operatorKeyword);
822 JUnitTestCase.assertNotNull(method.parameters);
823 JUnitTestCase.assertNotNull(method.body);
824 }
825 void test_parseClassMember_method_operator_type() {
826 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator() {}");
827 JUnitTestCase.assertNull(method.documentationComment);
828 JUnitTestCase.assertNull(method.externalKeyword);
829 JUnitTestCase.assertNull(method.modifierKeyword);
830 JUnitTestCase.assertNull(method.propertyKeyword);
831 JUnitTestCase.assertNotNull(method.returnType);
832 JUnitTestCase.assertNotNull(method.name);
833 JUnitTestCase.assertNull(method.operatorKeyword);
834 JUnitTestCase.assertNotNull(method.parameters);
835 JUnitTestCase.assertNotNull(method.body);
836 }
837 void test_parseClassMember_method_operator_void() {
838 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void operator() {}");
839 JUnitTestCase.assertNull(method.documentationComment);
840 JUnitTestCase.assertNull(method.externalKeyword);
841 JUnitTestCase.assertNull(method.modifierKeyword);
842 JUnitTestCase.assertNull(method.propertyKeyword);
843 JUnitTestCase.assertNotNull(method.returnType);
844 JUnitTestCase.assertNotNull(method.name);
845 JUnitTestCase.assertNull(method.operatorKeyword);
846 JUnitTestCase.assertNotNull(method.parameters);
847 JUnitTestCase.assertNotNull(method.body);
848 }
849 void test_parseClassMember_method_returnType_parameterized() {
850 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "p.A m() {}");
851 JUnitTestCase.assertNull(method.documentationComment);
852 JUnitTestCase.assertNull(method.externalKeyword);
853 JUnitTestCase.assertNull(method.modifierKeyword);
854 JUnitTestCase.assertNull(method.propertyKeyword);
855 JUnitTestCase.assertNotNull(method.returnType);
856 JUnitTestCase.assertNotNull(method.name);
857 JUnitTestCase.assertNull(method.operatorKeyword);
858 JUnitTestCase.assertNotNull(method.parameters);
859 JUnitTestCase.assertNotNull(method.body);
860 }
861 void test_parseClassMember_method_set_noType() {
862 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "set() {}");
863 JUnitTestCase.assertNull(method.documentationComment);
864 JUnitTestCase.assertNull(method.externalKeyword);
865 JUnitTestCase.assertNull(method.modifierKeyword);
866 JUnitTestCase.assertNull(method.propertyKeyword);
867 JUnitTestCase.assertNull(method.returnType);
868 JUnitTestCase.assertNotNull(method.name);
869 JUnitTestCase.assertNull(method.operatorKeyword);
870 JUnitTestCase.assertNotNull(method.parameters);
871 JUnitTestCase.assertNotNull(method.body);
872 }
873 void test_parseClassMember_method_set_type() {
874 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int set() {}");
875 JUnitTestCase.assertNull(method.documentationComment);
876 JUnitTestCase.assertNull(method.externalKeyword);
877 JUnitTestCase.assertNull(method.modifierKeyword);
878 JUnitTestCase.assertNull(method.propertyKeyword);
879 JUnitTestCase.assertNotNull(method.returnType);
880 JUnitTestCase.assertNotNull(method.name);
881 JUnitTestCase.assertNull(method.operatorKeyword);
882 JUnitTestCase.assertNotNull(method.parameters);
883 JUnitTestCase.assertNotNull(method.body);
884 }
885 void test_parseClassMember_method_set_void() {
886 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "void set() {}");
887 JUnitTestCase.assertNull(method.documentationComment);
888 JUnitTestCase.assertNull(method.externalKeyword);
889 JUnitTestCase.assertNull(method.modifierKeyword);
890 JUnitTestCase.assertNull(method.propertyKeyword);
891 JUnitTestCase.assertNotNull(method.returnType);
892 JUnitTestCase.assertNotNull(method.name);
893 JUnitTestCase.assertNull(method.operatorKeyword);
894 JUnitTestCase.assertNotNull(method.parameters);
895 JUnitTestCase.assertNotNull(method.body);
896 }
897 void test_parseClassMember_operator_index() {
898 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator [](int i) {}");
899 JUnitTestCase.assertNull(method.documentationComment);
900 JUnitTestCase.assertNull(method.externalKeyword);
901 JUnitTestCase.assertNull(method.modifierKeyword);
902 JUnitTestCase.assertNull(method.propertyKeyword);
903 JUnitTestCase.assertNotNull(method.returnType);
904 JUnitTestCase.assertNotNull(method.name);
905 JUnitTestCase.assertNotNull(method.operatorKeyword);
906 JUnitTestCase.assertNotNull(method.parameters);
907 JUnitTestCase.assertNotNull(method.body);
908 }
909 void test_parseClassMember_operator_indexAssign() {
910 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object> ["C"], "int operator []=(int i) {}");
911 JUnitTestCase.assertNull(method.documentationComment);
912 JUnitTestCase.assertNull(method.externalKeyword);
913 JUnitTestCase.assertNull(method.modifierKeyword);
914 JUnitTestCase.assertNull(method.propertyKeyword);
915 JUnitTestCase.assertNotNull(method.returnType);
916 JUnitTestCase.assertNotNull(method.name);
917 JUnitTestCase.assertNotNull(method.operatorKeyword);
918 JUnitTestCase.assertNotNull(method.parameters);
919 JUnitTestCase.assertNotNull(method.body);
920 }
921 void test_parseClassMember_redirectingFactory_const() {
922 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember" , <Object> ["C"], "const factory C() = B;");
923 JUnitTestCase.assertNull(constructor.externalKeyword);
924 JUnitTestCase.assertNotNull(constructor.constKeyword);
925 JUnitTestCase.assertNotNull(constructor.factoryKeyword);
926 JUnitTestCase.assertNotNull(constructor.returnType);
927 JUnitTestCase.assertNull(constructor.period);
928 JUnitTestCase.assertNull(constructor.name);
929 JUnitTestCase.assertNotNull(constructor.parameters);
930 JUnitTestCase.assertNotNull(constructor.separator);
931 EngineTestCase.assertSize(0, constructor.initializers);
932 JUnitTestCase.assertNotNull(constructor.redirectedConstructor);
933 JUnitTestCase.assertNotNull(constructor.body);
934 }
935 void test_parseClassMember_redirectingFactory_nonConst() {
936 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember" , <Object> ["C"], "factory C() = B;");
937 JUnitTestCase.assertNull(constructor.externalKeyword);
938 JUnitTestCase.assertNull(constructor.constKeyword);
939 JUnitTestCase.assertNotNull(constructor.factoryKeyword);
940 JUnitTestCase.assertNotNull(constructor.returnType);
941 JUnitTestCase.assertNull(constructor.period);
942 JUnitTestCase.assertNull(constructor.name);
943 JUnitTestCase.assertNotNull(constructor.parameters);
944 JUnitTestCase.assertNotNull(constructor.separator);
945 EngineTestCase.assertSize(0, constructor.initializers);
946 JUnitTestCase.assertNotNull(constructor.redirectedConstructor);
947 JUnitTestCase.assertNotNull(constructor.body);
948 }
949 void test_parseClassTypeAlias() {
950 Token token = TokenFactory.token(Keyword.CLASS);
951 ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token], "A = B;");
952 JUnitTestCase.assertNotNull(classTypeAlias.keyword);
953 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
954 JUnitTestCase.assertNotNull(classTypeAlias.equals);
955 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
956 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
957 JUnitTestCase.assertNull(classTypeAlias.withClause);
958 JUnitTestCase.assertNull(classTypeAlias.implementsClause);
959 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
960 }
961 void test_parseClassTypeAlias_abstract() {
962 Token token = TokenFactory.token(Keyword.CLASS);
963 ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token], "A = abstract B;");
964 JUnitTestCase.assertNotNull(classTypeAlias.keyword);
965 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
966 JUnitTestCase.assertNotNull(classTypeAlias.equals);
967 JUnitTestCase.assertNotNull(classTypeAlias.abstractKeyword);
968 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
969 JUnitTestCase.assertNull(classTypeAlias.withClause);
970 JUnitTestCase.assertNull(classTypeAlias.implementsClause);
971 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
972 }
973 void test_parseClassTypeAlias_implements() {
974 Token token = TokenFactory.token(Keyword.CLASS);
975 ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token], "A = B implements C;");
976 JUnitTestCase.assertNotNull(classTypeAlias.keyword);
977 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
978 JUnitTestCase.assertNotNull(classTypeAlias.equals);
979 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
980 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
981 JUnitTestCase.assertNull(classTypeAlias.withClause);
982 JUnitTestCase.assertNotNull(classTypeAlias.implementsClause);
983 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
984 }
985 void test_parseClassTypeAlias_with() {
986 Token token = TokenFactory.token(Keyword.CLASS);
987 ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token], "A = B with C;");
988 JUnitTestCase.assertNotNull(classTypeAlias.keyword);
989 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
990 JUnitTestCase.assertNotNull(classTypeAlias.equals);
991 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
992 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
993 JUnitTestCase.assertNotNull(classTypeAlias.withClause);
994 JUnitTestCase.assertNull(classTypeAlias.implementsClause);
995 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
996 }
997 void test_parseClassTypeAlias_with_implements() {
998 Token token = TokenFactory.token(Keyword.CLASS);
999 ClassTypeAlias classTypeAlias = ParserTestCase.parse("parseClassTypeAlias", <Object> [emptyCommentAndMetadata(), token], "A = B with C implements D;");
1000 JUnitTestCase.assertNotNull(classTypeAlias.keyword);
1001 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
1002 JUnitTestCase.assertNotNull(classTypeAlias.equals);
1003 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
1004 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
1005 JUnitTestCase.assertNotNull(classTypeAlias.withClause);
1006 JUnitTestCase.assertNotNull(classTypeAlias.implementsClause);
1007 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
1008 }
1009 void test_parseCombinators_h() {
1010 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a;", []);
1011 EngineTestCase.assertSize(1, combinators);
1012 HideCombinator combinator = combinators[0] as HideCombinator;
1013 JUnitTestCase.assertNotNull(combinator);
1014 JUnitTestCase.assertNotNull(combinator.keyword);
1015 EngineTestCase.assertSize(1, combinator.hiddenNames);
1016 }
1017 void test_parseCombinators_hs() {
1018 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b;", []);
1019 EngineTestCase.assertSize(2, combinators);
1020 HideCombinator hideCombinator = combinators[0] as HideCombinator;
1021 JUnitTestCase.assertNotNull(hideCombinator);
1022 JUnitTestCase.assertNotNull(hideCombinator.keyword);
1023 EngineTestCase.assertSize(1, hideCombinator.hiddenNames);
1024 ShowCombinator showCombinator = combinators[1] as ShowCombinator;
1025 JUnitTestCase.assertNotNull(showCombinator);
1026 JUnitTestCase.assertNotNull(showCombinator.keyword);
1027 EngineTestCase.assertSize(1, showCombinator.shownNames);
1028 }
1029 void test_parseCombinators_hshs() {
1030 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b hide c show d;", []);
1031 EngineTestCase.assertSize(4, combinators);
1032 }
1033 void test_parseCombinators_s() {
1034 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "sh ow a;", []);
1035 EngineTestCase.assertSize(1, combinators);
1036 ShowCombinator combinator = combinators[0] as ShowCombinator;
1037 JUnitTestCase.assertNotNull(combinator);
1038 JUnitTestCase.assertNotNull(combinator.keyword);
1039 EngineTestCase.assertSize(1, combinator.shownNames);
1040 }
1041 void test_parseCommentAndMetadata_c() {
1042 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ void", []);
1043 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1044 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1045 }
1046 void test_parseCommentAndMetadata_cmc() {
1047 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ void", []);
1048 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1049 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
1050 }
1051 void test_parseCommentAndMetadata_cmcm() {
1052 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ @B void", []);
1053 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1054 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1055 }
1056 void test_parseCommentAndMetadata_cmm() {
1057 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A @B void", []);
1058 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1059 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1060 }
1061 void test_parseCommentAndMetadata_m() {
1062 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A void", []);
1063 JUnitTestCase.assertNull(commentAndMetadata.comment);
1064 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
1065 }
1066 void test_parseCommentAndMetadata_mcm() {
1067 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B void", []);
1068 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1069 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1070 }
1071 void test_parseCommentAndMetadata_mcmc() {
1072 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B /** 2 */ void", []);
1073 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1074 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1075 }
1076 void test_parseCommentAndMetadata_mm() {
1077 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A @B(x) void", []);
1078 JUnitTestCase.assertNull(commentAndMetadata.comment);
1079 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1080 }
1081 void test_parseCommentAndMetadata_none() {
1082 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "void", []);
1083 JUnitTestCase.assertNull(commentAndMetadata.comment);
1084 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1085 }
1086 void test_parseCommentAndMetadata_singleLine() {
1087 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", EngineTestCase.createSource(["/// 1", "/// 2", "void"]), []);
1088 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1089 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1090 }
1091 void test_parseCommentReference_new_prefixed() {
1092 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a.b", 7], "");
1093 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier);
1094 SimpleIdentifier prefix = prefixedIdentifier.prefix;
1095 JUnitTestCase.assertNotNull(prefix.token);
1096 JUnitTestCase.assertEquals("a", prefix.name);
1097 JUnitTestCase.assertEquals(11, prefix.offset);
1098 JUnitTestCase.assertNotNull(prefixedIdentifier.period);
1099 SimpleIdentifier identifier = prefixedIdentifier.identifier;
1100 JUnitTestCase.assertNotNull(identifier.token);
1101 JUnitTestCase.assertEquals("b", identifier.name);
1102 JUnitTestCase.assertEquals(13, identifier.offset);
1103 }
1104 void test_parseCommentReference_new_simple() {
1105 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a", 5], "");
1106 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier);
1107 JUnitTestCase.assertNotNull(identifier.token);
1108 JUnitTestCase.assertEquals("a", identifier.name);
1109 JUnitTestCase.assertEquals(9, identifier.offset);
1110 }
1111 void test_parseCommentReference_prefixed() {
1112 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["a.b", 7], "");
1113 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier);
1114 SimpleIdentifier prefix = prefixedIdentifier.prefix;
1115 JUnitTestCase.assertNotNull(prefix.token);
1116 JUnitTestCase.assertEquals("a", prefix.name);
1117 JUnitTestCase.assertEquals(7, prefix.offset);
1118 JUnitTestCase.assertNotNull(prefixedIdentifier.period);
1119 SimpleIdentifier identifier = prefixedIdentifier.identifier;
1120 JUnitTestCase.assertNotNull(identifier.token);
1121 JUnitTestCase.assertEquals("b", identifier.name);
1122 JUnitTestCase.assertEquals(9, identifier.offset);
1123 }
1124 void test_parseCommentReference_simple() {
1125 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["a", 5], "");
1126 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier);
1127 JUnitTestCase.assertNotNull(identifier.token);
1128 JUnitTestCase.assertEquals("a", identifier.name);
1129 JUnitTestCase.assertEquals(5, identifier.offset);
1130 }
1131 void test_parseCommentReferences_multiLine() {
1132 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)];
1133 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1134 EngineTestCase.assertSize(2, references);
1135 CommentReference reference = references[0];
1136 JUnitTestCase.assertNotNull(reference);
1137 JUnitTestCase.assertNotNull(reference.identifier);
1138 JUnitTestCase.assertEquals(12, reference.offset);
1139 reference = references[1];
1140 JUnitTestCase.assertNotNull(reference);
1141 JUnitTestCase.assertNotNull(reference.identifier);
1142 JUnitTestCase.assertEquals(20, reference.offset);
1143 }
1144 void test_parseCommentReferences_singleLine() {
1145 List<Token> tokens = <Token> [
1146 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// xxx [a] yyy [b] zzz" , 3),
1147 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// x [c]", 28)];
1148 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1149 EngineTestCase.assertSize(3, references);
1150 CommentReference reference = references[0];
1151 JUnitTestCase.assertNotNull(reference);
1152 JUnitTestCase.assertNotNull(reference.identifier);
1153 JUnitTestCase.assertEquals(12, reference.offset);
1154 reference = references[1];
1155 JUnitTestCase.assertNotNull(reference);
1156 JUnitTestCase.assertNotNull(reference.identifier);
1157 JUnitTestCase.assertEquals(20, reference.offset);
1158 reference = references[2];
1159 JUnitTestCase.assertNotNull(reference);
1160 JUnitTestCase.assertNotNull(reference.identifier);
1161 JUnitTestCase.assertEquals(35, reference.offset);
1162 }
1163 void test_parseCommentReferences_skipCodeBlock_bracketed() {
1164 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [:xxx [a] yyy:] [b] zzz */", 3)];
1165 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1166 EngineTestCase.assertSize(1, references);
1167 CommentReference reference = references[0];
1168 JUnitTestCase.assertNotNull(reference);
1169 JUnitTestCase.assertNotNull(reference.identifier);
1170 JUnitTestCase.assertEquals(24, reference.offset);
1171 }
1172 void test_parseCommentReferences_skipCodeBlock_spaces() {
1173 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/**\n * a[i]\n * xxx [i] zzz\n */", 3)];
1174 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1175 EngineTestCase.assertSize(1, references);
1176 CommentReference reference = references[0];
1177 JUnitTestCase.assertNotNull(reference);
1178 JUnitTestCase.assertNotNull(reference.identifier);
1179 JUnitTestCase.assertEquals(27, reference.offset);
1180 }
1181 void test_parseCommentReferences_skipLinkDefinition() {
1182 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a]: http://www.google.com (Google) [b] zzz */", 3)];
1183 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1184 EngineTestCase.assertSize(1, references);
1185 CommentReference reference = references[0];
1186 JUnitTestCase.assertNotNull(reference);
1187 JUnitTestCase.assertNotNull(reference.identifier);
1188 JUnitTestCase.assertEquals(44, reference.offset);
1189 }
1190 void test_parseCommentReferences_skipLinked() {
1191 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a](http://www.google.com) [b] zzz */", 3)];
1192 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1193 EngineTestCase.assertSize(1, references);
1194 CommentReference reference = references[0];
1195 JUnitTestCase.assertNotNull(reference);
1196 JUnitTestCase.assertNotNull(reference.identifier);
1197 JUnitTestCase.assertEquals(35, reference.offset);
1198 }
1199 void test_parseCommentReferences_skipReferenceLink() {
1200 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)];
1201 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1202 EngineTestCase.assertSize(1, references);
1203 CommentReference reference = references[0];
1204 JUnitTestCase.assertNotNull(reference);
1205 JUnitTestCase.assertNotNull(reference.identifier);
1206 JUnitTestCase.assertEquals(15, reference.offset);
1207 }
1208 void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
1209 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "abstra ct<dynamic> _abstract = new abstract.A();", []);
1210 JUnitTestCase.assertNull(unit.scriptTag);
1211 EngineTestCase.assertSize(0, unit.directives);
1212 EngineTestCase.assertSize(1, unit.declarations);
1213 }
1214 void test_parseCompilationUnit_directives_multiple() {
1215 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;\npart 'a.dart';", []);
1216 JUnitTestCase.assertNull(unit.scriptTag);
1217 EngineTestCase.assertSize(2, unit.directives);
1218 EngineTestCase.assertSize(0, unit.declarations);
1219 }
1220 void test_parseCompilationUnit_directives_single() {
1221 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;", []);
1222 JUnitTestCase.assertNull(unit.scriptTag);
1223 EngineTestCase.assertSize(1, unit.directives);
1224 EngineTestCase.assertSize(0, unit.declarations);
1225 }
1226 void test_parseCompilationUnit_empty() {
1227 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "", []) ;
1228 JUnitTestCase.assertNull(unit.scriptTag);
1229 EngineTestCase.assertSize(0, unit.directives);
1230 EngineTestCase.assertSize(0, unit.declarations);
1231 }
1232 void test_parseCompilationUnit_exportAsPrefix() {
1233 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export .A _export = new export.A();", []);
1234 JUnitTestCase.assertNull(unit.scriptTag);
1235 EngineTestCase.assertSize(0, unit.directives);
1236 EngineTestCase.assertSize(1, unit.declarations);
1237 }
1238 void test_parseCompilationUnit_exportAsPrefix_parameterized() {
1239 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export <dynamic> _export = new export.A();", []);
1240 JUnitTestCase.assertNull(unit.scriptTag);
1241 EngineTestCase.assertSize(0, unit.directives);
1242 EngineTestCase.assertSize(1, unit.declarations);
1243 }
1244 void test_parseCompilationUnit_operatorAsPrefix_parameterized() {
1245 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "operat or<dynamic> _operator = new operator.A();", []);
1246 JUnitTestCase.assertNull(unit.scriptTag);
1247 EngineTestCase.assertSize(0, unit.directives);
1248 EngineTestCase.assertSize(1, unit.declarations);
1249 }
1250 void test_parseCompilationUnit_script() {
1251 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "#! /bi n/dart", []);
1252 JUnitTestCase.assertNotNull(unit.scriptTag);
1253 EngineTestCase.assertSize(0, unit.directives);
1254 EngineTestCase.assertSize(0, unit.declarations);
1255 }
1256 void test_parseCompilationUnit_topLevelDeclaration() {
1257 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class A {}", []);
1258 JUnitTestCase.assertNull(unit.scriptTag);
1259 EngineTestCase.assertSize(0, unit.directives);
1260 EngineTestCase.assertSize(1, unit.declarations);
1261 }
1262 void test_parseCompilationUnit_typedefAsPrefix() {
1263 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "typede f.A _typedef = new typedef.A();", []);
1264 JUnitTestCase.assertNull(unit.scriptTag);
1265 EngineTestCase.assertSize(0, unit.directives);
1266 EngineTestCase.assertSize(1, unit.declarations);
1267 }
1268 void test_parseCompilationUnitMember_abstractAsPrefix() {
1269 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n ew abstract.A();");
1270 JUnitTestCase.assertNotNull(declaration.semicolon);
1271 JUnitTestCase.assertNotNull(declaration.variables);
1272 }
1273 void test_parseCompilationUnitMember_class() {
1274 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem ber", <Object> [emptyCommentAndMetadata()], "class A {}");
1275 JUnitTestCase.assertEquals("A", declaration.name.name);
1276 EngineTestCase.assertSize(0, declaration.members);
1277 }
1278 void test_parseCompilationUnitMember_constVariable() {
1279 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;");
1280 JUnitTestCase.assertNotNull(declaration.semicolon);
1281 JUnitTestCase.assertNotNull(declaration.variables);
1282 }
1283 void test_parseCompilationUnitMember_finalVariable() {
1284 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "final x = 0;");
1285 JUnitTestCase.assertNotNull(declaration.semicolon);
1286 JUnitTestCase.assertNotNull(declaration.variables);
1287 }
1288 void test_parseCompilationUnitMember_function_external_noType() {
1289 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external f();");
1290 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1291 JUnitTestCase.assertNotNull(declaration.functionExpression);
1292 JUnitTestCase.assertNull(declaration.propertyKeyword);
1293 }
1294 void test_parseCompilationUnitMember_function_external_type() {
1295 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external int f();");
1296 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1297 JUnitTestCase.assertNotNull(declaration.functionExpression);
1298 JUnitTestCase.assertNull(declaration.propertyKeyword);
1299 }
1300 void test_parseCompilationUnitMember_function_noType() {
1301 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "f() {}");
1302 JUnitTestCase.assertNotNull(declaration.functionExpression);
1303 JUnitTestCase.assertNull(declaration.propertyKeyword);
1304 }
1305 void test_parseCompilationUnitMember_function_type() {
1306 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "int f() {}");
1307 JUnitTestCase.assertNotNull(declaration.functionExpression);
1308 JUnitTestCase.assertNull(declaration.propertyKeyword);
1309 }
1310 void test_parseCompilationUnitMember_function_void() {
1311 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "void f() {}");
1312 JUnitTestCase.assertNotNull(declaration.returnType);
1313 }
1314 void test_parseCompilationUnitMember_getter_external_noType() {
1315 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external get p;");
1316 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1317 JUnitTestCase.assertNotNull(declaration.functionExpression);
1318 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1319 }
1320 void test_parseCompilationUnitMember_getter_external_type() {
1321 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external int get p;");
1322 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1323 JUnitTestCase.assertNotNull(declaration.functionExpression);
1324 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1325 }
1326 void test_parseCompilationUnitMember_getter_noType() {
1327 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "get p => 0;");
1328 JUnitTestCase.assertNotNull(declaration.functionExpression);
1329 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1330 }
1331 void test_parseCompilationUnitMember_getter_type() {
1332 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "int get p => 0;");
1333 JUnitTestCase.assertNotNull(declaration.functionExpression);
1334 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1335 }
1336 void test_parseCompilationUnitMember_setter_external_noType() {
1337 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external set p(v);");
1338 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1339 JUnitTestCase.assertNotNull(declaration.functionExpression);
1340 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1341 }
1342 void test_parseCompilationUnitMember_setter_external_type() {
1343 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "external void set p(int v);");
1344 JUnitTestCase.assertNotNull(declaration.externalKeyword);
1345 JUnitTestCase.assertNotNull(declaration.functionExpression);
1346 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1347 }
1348 void test_parseCompilationUnitMember_setter_noType() {
1349 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "set p(v) {}");
1350 JUnitTestCase.assertNotNull(declaration.functionExpression);
1351 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1352 }
1353 void test_parseCompilationUnitMember_setter_type() {
1354 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit Member", <Object> [emptyCommentAndMetadata()], "void set p(int v) {}");
1355 JUnitTestCase.assertNotNull(declaration.functionExpression);
1356 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
1357 }
1358 void test_parseCompilationUnitMember_typeAlias_abstract() {
1359 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember" , <Object> [emptyCommentAndMetadata()], "class C = abstract S with M;");
1360 JUnitTestCase.assertNotNull(typeAlias.keyword);
1361 JUnitTestCase.assertEquals("C", typeAlias.name.name);
1362 JUnitTestCase.assertNull(typeAlias.typeParameters);
1363 JUnitTestCase.assertNotNull(typeAlias.equals);
1364 JUnitTestCase.assertNotNull(typeAlias.abstractKeyword);
1365 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name);
1366 JUnitTestCase.assertNotNull(typeAlias.withClause);
1367 JUnitTestCase.assertNull(typeAlias.implementsClause);
1368 JUnitTestCase.assertNotNull(typeAlias.semicolon);
1369 }
1370 void test_parseCompilationUnitMember_typeAlias_generic() {
1371 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember" , <Object> [emptyCommentAndMetadata()], "class C<E> = S<E> with M<E> implements I<E>;");
1372 JUnitTestCase.assertNotNull(typeAlias.keyword);
1373 JUnitTestCase.assertEquals("C", typeAlias.name.name);
1374 EngineTestCase.assertSize(1, typeAlias.typeParameters.typeParameters);
1375 JUnitTestCase.assertNotNull(typeAlias.equals);
1376 JUnitTestCase.assertNull(typeAlias.abstractKeyword);
1377 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name);
1378 JUnitTestCase.assertNotNull(typeAlias.withClause);
1379 JUnitTestCase.assertNotNull(typeAlias.implementsClause);
1380 JUnitTestCase.assertNotNull(typeAlias.semicolon);
1381 }
1382 void test_parseCompilationUnitMember_typeAlias_implements() {
1383 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember" , <Object> [emptyCommentAndMetadata()], "class C = S with M implements I;");
1384 JUnitTestCase.assertNotNull(typeAlias.keyword);
1385 JUnitTestCase.assertEquals("C", typeAlias.name.name);
1386 JUnitTestCase.assertNull(typeAlias.typeParameters);
1387 JUnitTestCase.assertNotNull(typeAlias.equals);
1388 JUnitTestCase.assertNull(typeAlias.abstractKeyword);
1389 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name);
1390 JUnitTestCase.assertNotNull(typeAlias.withClause);
1391 JUnitTestCase.assertNotNull(typeAlias.implementsClause);
1392 JUnitTestCase.assertNotNull(typeAlias.semicolon);
1393 }
1394 void test_parseCompilationUnitMember_typeAlias_noImplements() {
1395 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember" , <Object> [emptyCommentAndMetadata()], "class C = S with M;");
1396 JUnitTestCase.assertNotNull(typeAlias.keyword);
1397 JUnitTestCase.assertEquals("C", typeAlias.name.name);
1398 JUnitTestCase.assertNull(typeAlias.typeParameters);
1399 JUnitTestCase.assertNotNull(typeAlias.equals);
1400 JUnitTestCase.assertNull(typeAlias.abstractKeyword);
1401 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name);
1402 JUnitTestCase.assertNotNull(typeAlias.withClause);
1403 JUnitTestCase.assertNull(typeAlias.implementsClause);
1404 JUnitTestCase.assertNotNull(typeAlias.semicolon);
1405 }
1406 void test_parseCompilationUnitMember_typedef() {
1407 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb er", <Object> [emptyCommentAndMetadata()], "typedef F();");
1408 JUnitTestCase.assertEquals("F", typeAlias.name.name);
1409 EngineTestCase.assertSize(0, typeAlias.parameters.parameters);
1410 }
1411 void test_parseCompilationUnitMember_variable() {
1412 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;");
1413 JUnitTestCase.assertNotNull(declaration.semicolon);
1414 JUnitTestCase.assertNotNull(declaration.variables);
1415 }
1416 void test_parseCompilationUnitMember_variableGet() {
1417 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "String get = null;");
1418 JUnitTestCase.assertNotNull(declaration.semicolon);
1419 JUnitTestCase.assertNotNull(declaration.variables);
1420 }
1421 void test_parseCompilationUnitMember_variableSet() {
1422 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "String set = null;");
1423 JUnitTestCase.assertNotNull(declaration.semicolon);
1424 JUnitTestCase.assertNotNull(declaration.variables);
1425 }
1426 void test_parseConditionalExpression() {
1427 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y : z", []);
1428 JUnitTestCase.assertNotNull(expression.condition);
1429 JUnitTestCase.assertNotNull(expression.question);
1430 JUnitTestCase.assertNotNull(expression.thenExpression);
1431 JUnitTestCase.assertNotNull(expression.colon);
1432 JUnitTestCase.assertNotNull(expression.elseExpression);
1433 }
1434 void test_parseConstExpression_instanceCreation() {
1435 InstanceCreationExpression expression = ParserTestCase.parse5("parseConstExp ression", "const A()", []);
1436 JUnitTestCase.assertNotNull(expression.keyword);
1437 ConstructorName name = expression.constructorName;
1438 JUnitTestCase.assertNotNull(name);
1439 JUnitTestCase.assertNotNull(name.type);
1440 JUnitTestCase.assertNull(name.period);
1441 JUnitTestCase.assertNull(name.name);
1442 JUnitTestCase.assertNotNull(expression.argumentList);
1443 }
1444 void test_parseConstExpression_listLiteral_typed() {
1445 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const < A> []", []);
1446 JUnitTestCase.assertNotNull(literal.constKeyword);
1447 JUnitTestCase.assertNotNull(literal.typeArguments);
1448 JUnitTestCase.assertNotNull(literal.leftBracket);
1449 EngineTestCase.assertSize(0, literal.elements);
1450 JUnitTestCase.assertNotNull(literal.rightBracket);
1451 }
1452 void test_parseConstExpression_listLiteral_untyped() {
1453 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const [ ]", []);
1454 JUnitTestCase.assertNotNull(literal.constKeyword);
1455 JUnitTestCase.assertNull(literal.typeArguments);
1456 JUnitTestCase.assertNotNull(literal.leftBracket);
1457 EngineTestCase.assertSize(0, literal.elements);
1458 JUnitTestCase.assertNotNull(literal.rightBracket);
1459 }
1460 void test_parseConstExpression_mapLiteral_typed() {
1461 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <A , B> {}", []);
1462 JUnitTestCase.assertNotNull(literal.leftBracket);
1463 EngineTestCase.assertSize(0, literal.entries);
1464 JUnitTestCase.assertNotNull(literal.rightBracket);
1465 JUnitTestCase.assertNotNull(literal.typeArguments);
1466 }
1467 void test_parseConstExpression_mapLiteral_untyped() {
1468 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const {} ", []);
1469 JUnitTestCase.assertNotNull(literal.leftBracket);
1470 EngineTestCase.assertSize(0, literal.entries);
1471 JUnitTestCase.assertNotNull(literal.rightBracket);
1472 JUnitTestCase.assertNull(literal.typeArguments);
1473 }
1474 void test_parseConstructor() {
1475 }
1476 void test_parseConstructorFieldInitializer_qualified() {
1477 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "this.a = b", []);
1478 JUnitTestCase.assertNotNull(invocation.equals);
1479 JUnitTestCase.assertNotNull(invocation.expression);
1480 JUnitTestCase.assertNotNull(invocation.fieldName);
1481 JUnitTestCase.assertNotNull(invocation.keyword);
1482 JUnitTestCase.assertNotNull(invocation.period);
1483 }
1484 void test_parseConstructorFieldInitializer_unqualified() {
1485 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "a = b", []);
1486 JUnitTestCase.assertNotNull(invocation.equals);
1487 JUnitTestCase.assertNotNull(invocation.expression);
1488 JUnitTestCase.assertNotNull(invocation.fieldName);
1489 JUnitTestCase.assertNull(invocation.keyword);
1490 JUnitTestCase.assertNull(invocation.period);
1491 }
1492 void test_parseConstructorName_named_noPrefix() {
1493 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A.n;", []);
1494 JUnitTestCase.assertNotNull(name.type);
1495 JUnitTestCase.assertNull(name.period);
1496 JUnitTestCase.assertNull(name.name);
1497 }
1498 void test_parseConstructorName_named_prefixed() {
1499 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A.n; ", []);
1500 JUnitTestCase.assertNotNull(name.type);
1501 JUnitTestCase.assertNotNull(name.period);
1502 JUnitTestCase.assertNotNull(name.name);
1503 }
1504 void test_parseConstructorName_unnamed_noPrefix() {
1505 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A;", [ ]);
1506 JUnitTestCase.assertNotNull(name.type);
1507 JUnitTestCase.assertNull(name.period);
1508 JUnitTestCase.assertNull(name.name);
1509 }
1510 void test_parseConstructorName_unnamed_prefixed() {
1511 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A;", []);
1512 JUnitTestCase.assertNotNull(name.type);
1513 JUnitTestCase.assertNull(name.period);
1514 JUnitTestCase.assertNull(name.name);
1515 }
1516 void test_parseContinueStatement_label() {
1517 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1518 JUnitTestCase.assertNotNull(statement.keyword);
1519 JUnitTestCase.assertNotNull(statement.label);
1520 JUnitTestCase.assertNotNull(statement.semicolon);
1521 }
1522 void test_parseContinueStatement_noLabel() {
1523 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1524 JUnitTestCase.assertNotNull(statement.keyword);
1525 JUnitTestCase.assertNull(statement.label);
1526 JUnitTestCase.assertNotNull(statement.semicolon);
1527 }
1528 void test_parseDirective_export() {
1529 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
1530 JUnitTestCase.assertNotNull(directive.keyword);
1531 JUnitTestCase.assertNotNull(directive.uri);
1532 EngineTestCase.assertSize(0, directive.combinators);
1533 JUnitTestCase.assertNotNull(directive.semicolon);
1534 }
1535 void test_parseDirective_import() {
1536 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart';");
1537 JUnitTestCase.assertNotNull(directive.keyword);
1538 JUnitTestCase.assertNotNull(directive.uri);
1539 JUnitTestCase.assertNull(directive.asToken);
1540 JUnitTestCase.assertNull(directive.prefix);
1541 EngineTestCase.assertSize(0, directive.combinators);
1542 JUnitTestCase.assertNotNull(directive.semicolon);
1543 }
1544 void test_parseDirective_library() {
1545 LibraryDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "library l;");
1546 JUnitTestCase.assertNotNull(directive.libraryToken);
1547 JUnitTestCase.assertNotNull(directive.name);
1548 JUnitTestCase.assertNotNull(directive.semicolon);
1549 }
1550 void test_parseDirective_part() {
1551 PartDirective directive = ParserTestCase.parse("parseDirective", <Object> [e mptyCommentAndMetadata()], "part 'lib/lib.dart';");
1552 JUnitTestCase.assertNotNull(directive.partToken);
1553 JUnitTestCase.assertNotNull(directive.uri);
1554 JUnitTestCase.assertNotNull(directive.semicolon);
1555 }
1556 void test_parseDirective_partOf() {
1557 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;");
1558 JUnitTestCase.assertNotNull(directive.partToken);
1559 JUnitTestCase.assertNotNull(directive.ofToken);
1560 JUnitTestCase.assertNotNull(directive.libraryName);
1561 JUnitTestCase.assertNotNull(directive.semicolon);
1562 }
1563 void test_parseDocumentationComment_block() {
1564 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */ class", []);
1565 JUnitTestCase.assertFalse(comment.isBlock);
1566 JUnitTestCase.assertTrue(comment.isDocumentation);
1567 JUnitTestCase.assertFalse(comment.isEndOfLine);
1568 }
1569 void test_parseDocumentationComment_block_withReference() {
1570 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a ] */ class", []);
1571 JUnitTestCase.assertFalse(comment.isBlock);
1572 JUnitTestCase.assertTrue(comment.isDocumentation);
1573 JUnitTestCase.assertFalse(comment.isEndOfLine);
1574 NodeList<CommentReference> references = comment.references;
1575 EngineTestCase.assertSize(1, references);
1576 CommentReference reference = references[0];
1577 JUnitTestCase.assertNotNull(reference);
1578 JUnitTestCase.assertEquals(5, reference.offset);
1579 }
1580 void test_parseDocumentationComment_endOfLine() {
1581 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n /// \n class", []);
1582 JUnitTestCase.assertFalse(comment.isBlock);
1583 JUnitTestCase.assertTrue(comment.isDocumentation);
1584 JUnitTestCase.assertFalse(comment.isEndOfLine);
1585 }
1586 void test_parseDoStatement() {
1587 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi le (x);", []);
1588 JUnitTestCase.assertNotNull(statement.doKeyword);
1589 JUnitTestCase.assertNotNull(statement.body);
1590 JUnitTestCase.assertNotNull(statement.whileKeyword);
1591 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1592 JUnitTestCase.assertNotNull(statement.condition);
1593 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1594 JUnitTestCase.assertNotNull(statement.semicolon);
1595 }
1596 void test_parseEmptyStatement() {
1597 EmptyStatement statement = ParserTestCase.parse5("parseEmptyStatement", ";", []);
1598 JUnitTestCase.assertNotNull(statement.semicolon);
1599 }
1600 void test_parseEqualityExpression_normal() {
1601 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "x == y", []);
1602 JUnitTestCase.assertNotNull(expression.leftOperand);
1603 JUnitTestCase.assertNotNull(expression.operator);
1604 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1605 JUnitTestCase.assertNotNull(expression.rightOperand);
1606 }
1607 void test_parseEqualityExpression_super() {
1608 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "super == y", []);
1609 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
1610 JUnitTestCase.assertNotNull(expression.operator);
1611 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1612 JUnitTestCase.assertNotNull(expression.rightOperand);
1613 }
1614 void test_parseExportDirective_hide() {
1615 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;");
1616 JUnitTestCase.assertNotNull(directive.keyword);
1617 JUnitTestCase.assertNotNull(directive.uri);
1618 EngineTestCase.assertSize(1, directive.combinators);
1619 JUnitTestCase.assertNotNull(directive.semicolon);
1620 }
1621 void test_parseExportDirective_hide_show() {
1622 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A show B;");
1623 JUnitTestCase.assertNotNull(directive.keyword);
1624 JUnitTestCase.assertNotNull(directive.uri);
1625 EngineTestCase.assertSize(2, directive.combinators);
1626 JUnitTestCase.assertNotNull(directive.semicolon);
1627 }
1628 void test_parseExportDirective_noCombinator() {
1629 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
1630 JUnitTestCase.assertNotNull(directive.keyword);
1631 JUnitTestCase.assertNotNull(directive.uri);
1632 EngineTestCase.assertSize(0, directive.combinators);
1633 JUnitTestCase.assertNotNull(directive.semicolon);
1634 }
1635 void test_parseExportDirective_show() {
1636 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show A, B;");
1637 JUnitTestCase.assertNotNull(directive.keyword);
1638 JUnitTestCase.assertNotNull(directive.uri);
1639 EngineTestCase.assertSize(1, directive.combinators);
1640 JUnitTestCase.assertNotNull(directive.semicolon);
1641 }
1642 void test_parseExportDirective_show_hide() {
1643 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;");
1644 JUnitTestCase.assertNotNull(directive.keyword);
1645 JUnitTestCase.assertNotNull(directive.uri);
1646 EngineTestCase.assertSize(2, directive.combinators);
1647 JUnitTestCase.assertNotNull(directive.semicolon);
1648 }
1649 void test_parseExpression_assign() {
1650 AssignmentExpression expression = ParserTestCase.parse5("parseExpression", " x = y", []);
1651 JUnitTestCase.assertNotNull(expression.leftHandSide);
1652 JUnitTestCase.assertNotNull(expression.operator);
1653 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
1654 JUnitTestCase.assertNotNull(expression.rightHandSide);
1655 }
1656 void test_parseExpression_comparison() {
1657 BinaryExpression expression = ParserTestCase.parse5("parseExpression", "--a. b == c", []);
1658 JUnitTestCase.assertNotNull(expression.leftOperand);
1659 JUnitTestCase.assertNotNull(expression.operator);
1660 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1661 JUnitTestCase.assertNotNull(expression.rightOperand);
1662 }
1663 void test_parseExpression_invokeFunctionExpression() {
1664 FunctionExpressionInvocation invocation = ParserTestCase.parse5("parseExpres sion", "(a) {return a + a;} (3)", []);
1665 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
1666 FunctionExpression expression = invocation.function as FunctionExpression;
1667 JUnitTestCase.assertNotNull(expression.parameters);
1668 JUnitTestCase.assertNotNull(expression.body);
1669 ArgumentList list = invocation.argumentList;
1670 JUnitTestCase.assertNotNull(list);
1671 EngineTestCase.assertSize(1, list.arguments);
1672 }
1673 void test_parseExpression_superMethodInvocation() {
1674 MethodInvocation invocation = ParserTestCase.parse5("parseExpression", "supe r.m()", []);
1675 JUnitTestCase.assertNotNull(invocation.target);
1676 JUnitTestCase.assertNotNull(invocation.methodName);
1677 JUnitTestCase.assertNotNull(invocation.argumentList);
1678 }
1679 void test_parseExpressionList_multiple() {
1680 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3", []);
1681 EngineTestCase.assertSize(3, result);
1682 }
1683 void test_parseExpressionList_single() {
1684 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1", []);
1685 EngineTestCase.assertSize(1, result);
1686 }
1687 void test_parseExpressionWithoutCascade_assign() {
1688 AssignmentExpression expression = ParserTestCase.parse5("parseExpressionWith outCascade", "x = y", []);
1689 JUnitTestCase.assertNotNull(expression.leftHandSide);
1690 JUnitTestCase.assertNotNull(expression.operator);
1691 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
1692 JUnitTestCase.assertNotNull(expression.rightHandSide);
1693 }
1694 void test_parseExpressionWithoutCascade_comparison() {
1695 BinaryExpression expression = ParserTestCase.parse5("parseExpressionWithoutC ascade", "--a.b == c", []);
1696 JUnitTestCase.assertNotNull(expression.leftOperand);
1697 JUnitTestCase.assertNotNull(expression.operator);
1698 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1699 JUnitTestCase.assertNotNull(expression.rightOperand);
1700 }
1701 void test_parseExpressionWithoutCascade_superMethodInvocation() {
1702 MethodInvocation invocation = ParserTestCase.parse5("parseExpressionWithoutC ascade", "super.m()", []);
1703 JUnitTestCase.assertNotNull(invocation.target);
1704 JUnitTestCase.assertNotNull(invocation.methodName);
1705 JUnitTestCase.assertNotNull(invocation.argumentList);
1706 }
1707 void test_parseExtendsClause() {
1708 ExtendsClause clause = ParserTestCase.parse5("parseExtendsClause", "extends B", []);
1709 JUnitTestCase.assertNotNull(clause.keyword);
1710 JUnitTestCase.assertNotNull(clause.superclass);
1711 EngineTestCase.assertInstanceOf(TypeName, clause.superclass);
1712 }
1713 void test_parseFinalConstVarOrType_const_noType() {
1714 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const");
1715 Token keyword = result.keyword;
1716 JUnitTestCase.assertNotNull(keyword);
1717 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1718 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword as KeywordToken)).keywor d);
1719 JUnitTestCase.assertNull(result.type);
1720 }
1721 void test_parseFinalConstVarOrType_const_type() {
1722 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const A a");
1723 Token keyword = result.keyword;
1724 JUnitTestCase.assertNotNull(keyword);
1725 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1726 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword as KeywordToken)).keywor d);
1727 JUnitTestCase.assertNotNull(result.type);
1728 }
1729 void test_parseFinalConstVarOrType_final_noType() {
1730 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final");
1731 Token keyword = result.keyword;
1732 JUnitTestCase.assertNotNull(keyword);
1733 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1734 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword as KeywordToken)).keywor d);
1735 JUnitTestCase.assertNull(result.type);
1736 }
1737 void test_parseFinalConstVarOrType_final_prefixedType() {
1738 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final p.A a");
1739 Token keyword = result.keyword;
1740 JUnitTestCase.assertNotNull(keyword);
1741 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1742 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword as KeywordToken)).keywor d);
1743 JUnitTestCase.assertNotNull(result.type);
1744 }
1745 void test_parseFinalConstVarOrType_final_type() {
1746 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final A a");
1747 Token keyword = result.keyword;
1748 JUnitTestCase.assertNotNull(keyword);
1749 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1750 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword as KeywordToken)).keywor d);
1751 JUnitTestCase.assertNotNull(result.type);
1752 }
1753 void test_parseFinalConstVarOrType_type_parameterized() {
1754 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A<B> a");
1755 JUnitTestCase.assertNull(result.keyword);
1756 JUnitTestCase.assertNotNull(result.type);
1757 }
1758 void test_parseFinalConstVarOrType_type_prefixed() {
1759 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A a");
1760 JUnitTestCase.assertNull(result.keyword);
1761 JUnitTestCase.assertNotNull(result.type);
1762 }
1763 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() {
1764 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A<B> a");
1765 JUnitTestCase.assertNull(result.keyword);
1766 JUnitTestCase.assertNotNull(result.type);
1767 }
1768 void test_parseFinalConstVarOrType_type_simple() {
1769 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A a");
1770 JUnitTestCase.assertNull(result.keyword);
1771 JUnitTestCase.assertNotNull(result.type);
1772 }
1773 void test_parseFinalConstVarOrType_var() {
1774 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "var");
1775 Token keyword = result.keyword;
1776 JUnitTestCase.assertNotNull(keyword);
1777 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
1778 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword as KeywordToken)).keyword) ;
1779 JUnitTestCase.assertNull(result.type);
1780 }
1781 void test_parseFormalParameter_final_withType_named() {
1782 ParameterKind kind = ParameterKind.NAMED;
1783 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a : null");
1784 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1785 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1786 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1787 JUnitTestCase.assertNotNull(simpleParameter.type);
1788 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1789 JUnitTestCase.assertNotNull(parameter.separator);
1790 JUnitTestCase.assertNotNull(parameter.defaultValue);
1791 JUnitTestCase.assertEquals(kind, parameter.kind);
1792 }
1793 void test_parseFormalParameter_final_withType_normal() {
1794 ParameterKind kind = ParameterKind.REQUIRED;
1795 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter ", <Object> [kind], "final A a");
1796 JUnitTestCase.assertNotNull(parameter.identifier);
1797 JUnitTestCase.assertNotNull(parameter.keyword);
1798 JUnitTestCase.assertNotNull(parameter.type);
1799 JUnitTestCase.assertEquals(kind, parameter.kind);
1800 }
1801 void test_parseFormalParameter_final_withType_positional() {
1802 ParameterKind kind = ParameterKind.POSITIONAL;
1803 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a = null");
1804 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1805 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1806 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1807 JUnitTestCase.assertNotNull(simpleParameter.type);
1808 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1809 JUnitTestCase.assertNotNull(parameter.separator);
1810 JUnitTestCase.assertNotNull(parameter.defaultValue);
1811 JUnitTestCase.assertEquals(kind, parameter.kind);
1812 }
1813 void test_parseFormalParameter_nonFinal_withType_named() {
1814 ParameterKind kind = ParameterKind.NAMED;
1815 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "A a : null");
1816 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1817 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1818 JUnitTestCase.assertNull(simpleParameter.keyword);
1819 JUnitTestCase.assertNotNull(simpleParameter.type);
1820 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1821 JUnitTestCase.assertNotNull(parameter.separator);
1822 JUnitTestCase.assertNotNull(parameter.defaultValue);
1823 JUnitTestCase.assertEquals(kind, parameter.kind);
1824 }
1825 void test_parseFormalParameter_nonFinal_withType_normal() {
1826 ParameterKind kind = ParameterKind.REQUIRED;
1827 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter ", <Object> [kind], "A a");
1828 JUnitTestCase.assertNotNull(parameter.identifier);
1829 JUnitTestCase.assertNull(parameter.keyword);
1830 JUnitTestCase.assertNotNull(parameter.type);
1831 JUnitTestCase.assertEquals(kind, parameter.kind);
1832 }
1833 void test_parseFormalParameter_nonFinal_withType_positional() {
1834 ParameterKind kind = ParameterKind.POSITIONAL;
1835 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "A a = null");
1836 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1837 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1838 JUnitTestCase.assertNull(simpleParameter.keyword);
1839 JUnitTestCase.assertNotNull(simpleParameter.type);
1840 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1841 JUnitTestCase.assertNotNull(parameter.separator);
1842 JUnitTestCase.assertNotNull(parameter.defaultValue);
1843 JUnitTestCase.assertEquals(kind, parameter.kind);
1844 }
1845 void test_parseFormalParameter_var() {
1846 ParameterKind kind = ParameterKind.REQUIRED;
1847 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter ", <Object> [kind], "var a");
1848 JUnitTestCase.assertNotNull(parameter.identifier);
1849 JUnitTestCase.assertNotNull(parameter.keyword);
1850 JUnitTestCase.assertNull(parameter.type);
1851 JUnitTestCase.assertEquals(kind, parameter.kind);
1852 }
1853 void test_parseFormalParameter_var_named() {
1854 ParameterKind kind = ParameterKind.NAMED;
1855 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "var a : null");
1856 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1857 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1858 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1859 JUnitTestCase.assertNull(simpleParameter.type);
1860 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1861 JUnitTestCase.assertNotNull(parameter.separator);
1862 JUnitTestCase.assertNotNull(parameter.defaultValue);
1863 JUnitTestCase.assertEquals(kind, parameter.kind);
1864 }
1865 void test_parseFormalParameter_var_positional() {
1866 ParameterKind kind = ParameterKind.POSITIONAL;
1867 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "var a = null");
1868 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1869 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1870 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1871 JUnitTestCase.assertNull(simpleParameter.type);
1872 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1873 JUnitTestCase.assertNotNull(parameter.separator);
1874 JUnitTestCase.assertNotNull(parameter.defaultValue);
1875 JUnitTestCase.assertEquals(kind, parameter.kind);
1876 }
1877 void test_parseFormalParameterList_empty() {
1878 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "()", []);
1879 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1880 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1881 EngineTestCase.assertSize(0, parameterList.parameters);
1882 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1883 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1884 }
1885 void test_parseFormalParameterList_named_multiple() {
1886 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a : 1, B b, C c : 3})", []);
1887 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1888 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1889 EngineTestCase.assertSize(3, parameterList.parameters);
1890 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1891 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1892 }
1893 void test_parseFormalParameterList_named_single() {
1894 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a})", []);
1895 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1896 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1897 EngineTestCase.assertSize(1, parameterList.parameters);
1898 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1899 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1900 }
1901 void test_parseFormalParameterList_normal_multiple() {
1902 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, B b, C c)", []);
1903 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1904 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1905 EngineTestCase.assertSize(3, parameterList.parameters);
1906 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1907 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1908 }
1909 void test_parseFormalParameterList_normal_named() {
1910 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, {B b})", []);
1911 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1912 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1913 EngineTestCase.assertSize(2, parameterList.parameters);
1914 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1915 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1916 }
1917 void test_parseFormalParameterList_normal_positional() {
1918 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, [B b])", []);
1919 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1920 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1921 EngineTestCase.assertSize(2, parameterList.parameters);
1922 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1923 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1924 }
1925 void test_parseFormalParameterList_normal_single() {
1926 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a)", []);
1927 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1928 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1929 EngineTestCase.assertSize(1, parameterList.parameters);
1930 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1931 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1932 }
1933 void test_parseFormalParameterList_positional_multiple() {
1934 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null, B b, C c = null])", []);
1935 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1936 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1937 EngineTestCase.assertSize(3, parameterList.parameters);
1938 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1939 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1940 }
1941 void test_parseFormalParameterList_positional_single() {
1942 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null])", []);
1943 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1944 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1945 EngineTestCase.assertSize(1, parameterList.parameters);
1946 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1947 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1948 }
1949 void test_parseForStatement_each_identifier() {
1950 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (element in list) {}", []);
1951 JUnitTestCase.assertNotNull(statement.forKeyword);
1952 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1953 JUnitTestCase.assertNull(statement.loopVariable);
1954 JUnitTestCase.assertNotNull(statement.identifier);
1955 JUnitTestCase.assertNotNull(statement.inKeyword);
1956 JUnitTestCase.assertNotNull(statement.iterator);
1957 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1958 JUnitTestCase.assertNotNull(statement.body);
1959 }
1960 void test_parseForStatement_each_noType_metadata() {
1961 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var element in list) {}", []);
1962 JUnitTestCase.assertNotNull(statement.forKeyword);
1963 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1964 JUnitTestCase.assertNotNull(statement.loopVariable);
1965 EngineTestCase.assertSize(1, statement.loopVariable.metadata);
1966 JUnitTestCase.assertNull(statement.identifier);
1967 JUnitTestCase.assertNotNull(statement.inKeyword);
1968 JUnitTestCase.assertNotNull(statement.iterator);
1969 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1970 JUnitTestCase.assertNotNull(statement.body);
1971 }
1972 void test_parseForStatement_each_type() {
1973 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (A element in list) {}", []);
1974 JUnitTestCase.assertNotNull(statement.forKeyword);
1975 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1976 JUnitTestCase.assertNotNull(statement.loopVariable);
1977 JUnitTestCase.assertNull(statement.identifier);
1978 JUnitTestCase.assertNotNull(statement.inKeyword);
1979 JUnitTestCase.assertNotNull(statement.iterator);
1980 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1981 JUnitTestCase.assertNotNull(statement.body);
1982 }
1983 void test_parseForStatement_each_var() {
1984 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (var element in list) {}", []);
1985 JUnitTestCase.assertNotNull(statement.forKeyword);
1986 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1987 JUnitTestCase.assertNotNull(statement.loopVariable);
1988 JUnitTestCase.assertNull(statement.identifier);
1989 JUnitTestCase.assertNotNull(statement.inKeyword);
1990 JUnitTestCase.assertNotNull(statement.iterator);
1991 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1992 JUnitTestCase.assertNotNull(statement.body);
1993 }
1994 void test_parseForStatement_loop_c() {
1995 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count;) {}", []);
1996 JUnitTestCase.assertNotNull(statement.forKeyword);
1997 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1998 JUnitTestCase.assertNull(statement.variables);
1999 JUnitTestCase.assertNull(statement.initialization);
2000 JUnitTestCase.assertNotNull(statement.leftSeparator);
2001 JUnitTestCase.assertNotNull(statement.condition);
2002 JUnitTestCase.assertNotNull(statement.rightSeparator);
2003 EngineTestCase.assertSize(0, statement.updaters);
2004 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2005 JUnitTestCase.assertNotNull(statement.body);
2006 }
2007 void test_parseForStatement_loop_cu() {
2008 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count; i++) {}", []);
2009 JUnitTestCase.assertNotNull(statement.forKeyword);
2010 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2011 JUnitTestCase.assertNull(statement.variables);
2012 JUnitTestCase.assertNull(statement.initialization);
2013 JUnitTestCase.assertNotNull(statement.leftSeparator);
2014 JUnitTestCase.assertNotNull(statement.condition);
2015 JUnitTestCase.assertNotNull(statement.rightSeparator);
2016 EngineTestCase.assertSize(1, statement.updaters);
2017 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2018 JUnitTestCase.assertNotNull(statement.body);
2019 }
2020 void test_parseForStatement_loop_ecu() {
2021 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (i- -; i < count; i++) {}", []);
2022 JUnitTestCase.assertNotNull(statement.forKeyword);
2023 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2024 JUnitTestCase.assertNull(statement.variables);
2025 JUnitTestCase.assertNotNull(statement.initialization);
2026 JUnitTestCase.assertNotNull(statement.leftSeparator);
2027 JUnitTestCase.assertNotNull(statement.condition);
2028 JUnitTestCase.assertNotNull(statement.rightSeparator);
2029 EngineTestCase.assertSize(1, statement.updaters);
2030 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2031 JUnitTestCase.assertNotNull(statement.body);
2032 }
2033 void test_parseForStatement_loop_i() {
2034 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;;) {}", []);
2035 JUnitTestCase.assertNotNull(statement.forKeyword);
2036 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2037 VariableDeclarationList variables = statement.variables;
2038 JUnitTestCase.assertNotNull(variables);
2039 EngineTestCase.assertSize(0, variables.metadata);
2040 EngineTestCase.assertSize(1, variables.variables);
2041 JUnitTestCase.assertNull(statement.initialization);
2042 JUnitTestCase.assertNotNull(statement.leftSeparator);
2043 JUnitTestCase.assertNull(statement.condition);
2044 JUnitTestCase.assertNotNull(statement.rightSeparator);
2045 EngineTestCase.assertSize(0, statement.updaters);
2046 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2047 JUnitTestCase.assertNotNull(statement.body);
2048 }
2049 void test_parseForStatement_loop_i_withMetadata() {
2050 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var i = 0;;) {}", []);
2051 JUnitTestCase.assertNotNull(statement.forKeyword);
2052 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2053 VariableDeclarationList variables = statement.variables;
2054 JUnitTestCase.assertNotNull(variables);
2055 EngineTestCase.assertSize(1, variables.metadata);
2056 EngineTestCase.assertSize(1, variables.variables);
2057 JUnitTestCase.assertNull(statement.initialization);
2058 JUnitTestCase.assertNotNull(statement.leftSeparator);
2059 JUnitTestCase.assertNull(statement.condition);
2060 JUnitTestCase.assertNotNull(statement.rightSeparator);
2061 EngineTestCase.assertSize(0, statement.updaters);
2062 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2063 JUnitTestCase.assertNotNull(statement.body);
2064 }
2065 void test_parseForStatement_loop_ic() {
2066 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count;) {}", []);
2067 JUnitTestCase.assertNotNull(statement.forKeyword);
2068 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2069 VariableDeclarationList variables = statement.variables;
2070 JUnitTestCase.assertNotNull(variables);
2071 EngineTestCase.assertSize(1, variables.variables);
2072 JUnitTestCase.assertNull(statement.initialization);
2073 JUnitTestCase.assertNotNull(statement.leftSeparator);
2074 JUnitTestCase.assertNotNull(statement.condition);
2075 JUnitTestCase.assertNotNull(statement.rightSeparator);
2076 EngineTestCase.assertSize(0, statement.updaters);
2077 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2078 JUnitTestCase.assertNotNull(statement.body);
2079 }
2080 void test_parseForStatement_loop_icu() {
2081 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count; i++) {}", []);
2082 JUnitTestCase.assertNotNull(statement.forKeyword);
2083 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2084 VariableDeclarationList variables = statement.variables;
2085 JUnitTestCase.assertNotNull(variables);
2086 EngineTestCase.assertSize(1, variables.variables);
2087 JUnitTestCase.assertNull(statement.initialization);
2088 JUnitTestCase.assertNotNull(statement.leftSeparator);
2089 JUnitTestCase.assertNotNull(statement.condition);
2090 JUnitTestCase.assertNotNull(statement.rightSeparator);
2091 EngineTestCase.assertSize(1, statement.updaters);
2092 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2093 JUnitTestCase.assertNotNull(statement.body);
2094 }
2095 void test_parseForStatement_loop_iicuu() {
2096 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (in t i = 0, j = count; i < j; i++, j--) {}", []);
2097 JUnitTestCase.assertNotNull(statement.forKeyword);
2098 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2099 VariableDeclarationList variables = statement.variables;
2100 JUnitTestCase.assertNotNull(variables);
2101 EngineTestCase.assertSize(2, variables.variables);
2102 JUnitTestCase.assertNull(statement.initialization);
2103 JUnitTestCase.assertNotNull(statement.leftSeparator);
2104 JUnitTestCase.assertNotNull(statement.condition);
2105 JUnitTestCase.assertNotNull(statement.rightSeparator);
2106 EngineTestCase.assertSize(2, statement.updaters);
2107 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2108 JUnitTestCase.assertNotNull(statement.body);
2109 }
2110 void test_parseForStatement_loop_iu() {
2111 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;; i++) {}", []);
2112 JUnitTestCase.assertNotNull(statement.forKeyword);
2113 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2114 VariableDeclarationList variables = statement.variables;
2115 JUnitTestCase.assertNotNull(variables);
2116 EngineTestCase.assertSize(1, variables.variables);
2117 JUnitTestCase.assertNull(statement.initialization);
2118 JUnitTestCase.assertNotNull(statement.leftSeparator);
2119 JUnitTestCase.assertNull(statement.condition);
2120 JUnitTestCase.assertNotNull(statement.rightSeparator);
2121 EngineTestCase.assertSize(1, statement.updaters);
2122 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2123 JUnitTestCase.assertNotNull(statement.body);
2124 }
2125 void test_parseForStatement_loop_u() {
2126 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;; i++) {}", []);
2127 JUnitTestCase.assertNotNull(statement.forKeyword);
2128 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2129 JUnitTestCase.assertNull(statement.variables);
2130 JUnitTestCase.assertNull(statement.initialization);
2131 JUnitTestCase.assertNotNull(statement.leftSeparator);
2132 JUnitTestCase.assertNull(statement.condition);
2133 JUnitTestCase.assertNotNull(statement.rightSeparator);
2134 EngineTestCase.assertSize(1, statement.updaters);
2135 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2136 JUnitTestCase.assertNotNull(statement.body);
2137 }
2138 void test_parseFunctionBody_block() {
2139 BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", < Object> [false, null, false], "{}");
2140 JUnitTestCase.assertNotNull(functionBody.block);
2141 }
2142 void test_parseFunctionBody_empty() {
2143 EmptyFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", < Object> [true, null, false], ";");
2144 JUnitTestCase.assertNotNull(functionBody.semicolon);
2145 }
2146 void test_parseFunctionBody_expression() {
2147 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod y", <Object> [false, null, false], "=> y;");
2148 JUnitTestCase.assertNotNull(functionBody.functionDefinition);
2149 JUnitTestCase.assertNotNull(functionBody.expression);
2150 JUnitTestCase.assertNotNull(functionBody.semicolon);
2151 }
2152 void test_parseFunctionBody_nativeFunctionBody() {
2153 NativeFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <Object> [false, null, false], "native 'str';");
2154 JUnitTestCase.assertNotNull(functionBody.nativeToken);
2155 JUnitTestCase.assertNotNull(functionBody.stringLiteral);
2156 JUnitTestCase.assertNotNull(functionBody.semicolon);
2157 }
2158 void test_parseFunctionDeclaration_function() {
2159 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2160 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2161 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara tion", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}");
2162 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2163 JUnitTestCase.assertEquals(returnType, declaration.returnType);
2164 JUnitTestCase.assertNotNull(declaration.name);
2165 FunctionExpression expression = declaration.functionExpression;
2166 JUnitTestCase.assertNotNull(expression);
2167 JUnitTestCase.assertNotNull(expression.body);
2168 JUnitTestCase.assertNotNull(expression.parameters);
2169 JUnitTestCase.assertNull(declaration.propertyKeyword);
2170 }
2171 void test_parseFunctionDeclaration_getter() {
2172 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2173 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2174 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara tion", <Object> [commentAndMetadata(comment, []), null, returnType], "get p => 0 ;");
2175 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2176 JUnitTestCase.assertEquals(returnType, declaration.returnType);
2177 JUnitTestCase.assertNotNull(declaration.name);
2178 FunctionExpression expression = declaration.functionExpression;
2179 JUnitTestCase.assertNotNull(expression);
2180 JUnitTestCase.assertNotNull(expression.body);
2181 JUnitTestCase.assertNull(expression.parameters);
2182 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
2183 }
2184 void test_parseFunctionDeclaration_setter() {
2185 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2186 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2187 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara tion", <Object> [commentAndMetadata(comment, []), null, returnType], "set p(v) { }");
2188 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2189 JUnitTestCase.assertEquals(returnType, declaration.returnType);
2190 JUnitTestCase.assertNotNull(declaration.name);
2191 FunctionExpression expression = declaration.functionExpression;
2192 JUnitTestCase.assertNotNull(expression);
2193 JUnitTestCase.assertNotNull(expression.body);
2194 JUnitTestCase.assertNotNull(expression.parameters);
2195 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
2196 }
2197 void test_parseFunctionDeclarationStatement() {
2198 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseFunctio nDeclarationStatement", "void f(int p) => p * 2;", []);
2199 JUnitTestCase.assertNotNull(statement.functionDeclaration);
2200 }
2201 void test_parseFunctionExpression_body_inExpression() {
2202 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "(int i) => i++", []);
2203 JUnitTestCase.assertNotNull(expression.body);
2204 JUnitTestCase.assertNotNull(expression.parameters);
2205 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic olon);
2206 }
2207 void test_parseFunctionExpression_minimal() {
2208 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "() {}", []);
2209 JUnitTestCase.assertNotNull(expression.body);
2210 JUnitTestCase.assertNotNull(expression.parameters);
2211 }
2212 void test_parseGetter_nonStatic() {
2213 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2214 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2215 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "get a;");
2216 JUnitTestCase.assertNotNull(method.body);
2217 JUnitTestCase.assertEquals(comment, method.documentationComment);
2218 JUnitTestCase.assertNull(method.externalKeyword);
2219 JUnitTestCase.assertNull(method.modifierKeyword);
2220 JUnitTestCase.assertNotNull(method.name);
2221 JUnitTestCase.assertNull(method.operatorKeyword);
2222 JUnitTestCase.assertNull(method.parameters);
2223 JUnitTestCase.assertNotNull(method.propertyKeyword);
2224 JUnitTestCase.assertEquals(returnType, method.returnType);
2225 }
2226 void test_parseGetter_static() {
2227 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2228 Token staticKeyword = TokenFactory.token(Keyword.STATIC);
2229 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2230 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [
2231 commentAndMetadata(comment, []),
2232 null,
2233 staticKeyword,
2234 returnType], "get a => 42;");
2235 JUnitTestCase.assertNotNull(method.body);
2236 JUnitTestCase.assertEquals(comment, method.documentationComment);
2237 JUnitTestCase.assertNull(method.externalKeyword);
2238 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
2239 JUnitTestCase.assertNotNull(method.name);
2240 JUnitTestCase.assertNull(method.operatorKeyword);
2241 JUnitTestCase.assertNull(method.parameters);
2242 JUnitTestCase.assertNotNull(method.propertyKeyword);
2243 JUnitTestCase.assertEquals(returnType, method.returnType);
2244 }
2245 void test_parseIdentifierList_multiple() {
2246 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a, b, c", []);
2247 EngineTestCase.assertSize(3, list);
2248 }
2249 void test_parseIdentifierList_single() {
2250 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a", []);
2251 EngineTestCase.assertSize(1, list);
2252 }
2253 void test_parseIfStatement_else_block() {
2254 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} else {}", []);
2255 JUnitTestCase.assertNotNull(statement.ifKeyword);
2256 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2257 JUnitTestCase.assertNotNull(statement.condition);
2258 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2259 JUnitTestCase.assertNotNull(statement.thenStatement);
2260 JUnitTestCase.assertNotNull(statement.elseKeyword);
2261 JUnitTestCase.assertNotNull(statement.elseStatement);
2262 }
2263 void test_parseIfStatement_else_statement() {
2264 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x); else f(y);", []);
2265 JUnitTestCase.assertNotNull(statement.ifKeyword);
2266 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2267 JUnitTestCase.assertNotNull(statement.condition);
2268 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2269 JUnitTestCase.assertNotNull(statement.thenStatement);
2270 JUnitTestCase.assertNotNull(statement.elseKeyword);
2271 JUnitTestCase.assertNotNull(statement.elseStatement);
2272 }
2273 void test_parseIfStatement_noElse_block() {
2274 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} ", []);
2275 JUnitTestCase.assertNotNull(statement.ifKeyword);
2276 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2277 JUnitTestCase.assertNotNull(statement.condition);
2278 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2279 JUnitTestCase.assertNotNull(statement.thenStatement);
2280 JUnitTestCase.assertNull(statement.elseKeyword);
2281 JUnitTestCase.assertNull(statement.elseStatement);
2282 }
2283 void test_parseIfStatement_noElse_statement() {
2284 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x);", []);
2285 JUnitTestCase.assertNotNull(statement.ifKeyword);
2286 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2287 JUnitTestCase.assertNotNull(statement.condition);
2288 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2289 JUnitTestCase.assertNotNull(statement.thenStatement);
2290 JUnitTestCase.assertNull(statement.elseKeyword);
2291 JUnitTestCase.assertNull(statement.elseStatement);
2292 }
2293 void test_parseImplementsClause_multiple() {
2294 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A, B, C", []);
2295 EngineTestCase.assertSize(3, clause.interfaces);
2296 JUnitTestCase.assertNotNull(clause.keyword);
2297 }
2298 void test_parseImplementsClause_single() {
2299 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A", []);
2300 EngineTestCase.assertSize(1, clause.interfaces);
2301 JUnitTestCase.assertNotNull(clause.keyword);
2302 }
2303 void test_parseImportDirective_hide() {
2304 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;");
2305 JUnitTestCase.assertNotNull(directive.keyword);
2306 JUnitTestCase.assertNotNull(directive.uri);
2307 JUnitTestCase.assertNull(directive.asToken);
2308 JUnitTestCase.assertNull(directive.prefix);
2309 EngineTestCase.assertSize(1, directive.combinators);
2310 JUnitTestCase.assertNotNull(directive.semicolon);
2311 }
2312 void test_parseImportDirective_noCombinator() {
2313 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart';");
2314 JUnitTestCase.assertNotNull(directive.keyword);
2315 JUnitTestCase.assertNotNull(directive.uri);
2316 JUnitTestCase.assertNull(directive.asToken);
2317 JUnitTestCase.assertNull(directive.prefix);
2318 EngineTestCase.assertSize(0, directive.combinators);
2319 JUnitTestCase.assertNotNull(directive.semicolon);
2320 }
2321 void test_parseImportDirective_prefix() {
2322 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a;");
2323 JUnitTestCase.assertNotNull(directive.keyword);
2324 JUnitTestCase.assertNotNull(directive.uri);
2325 JUnitTestCase.assertNotNull(directive.asToken);
2326 JUnitTestCase.assertNotNull(directive.prefix);
2327 EngineTestCase.assertSize(0, directive.combinators);
2328 JUnitTestCase.assertNotNull(directive.semicolon);
2329 }
2330 void test_parseImportDirective_prefix_hide_show() {
2331 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a hide A show B;");
2332 JUnitTestCase.assertNotNull(directive.keyword);
2333 JUnitTestCase.assertNotNull(directive.uri);
2334 JUnitTestCase.assertNotNull(directive.asToken);
2335 JUnitTestCase.assertNotNull(directive.prefix);
2336 EngineTestCase.assertSize(2, directive.combinators);
2337 JUnitTestCase.assertNotNull(directive.semicolon);
2338 }
2339 void test_parseImportDirective_prefix_show_hide() {
2340 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a show B hide A;");
2341 JUnitTestCase.assertNotNull(directive.keyword);
2342 JUnitTestCase.assertNotNull(directive.uri);
2343 JUnitTestCase.assertNotNull(directive.asToken);
2344 JUnitTestCase.assertNotNull(directive.prefix);
2345 EngineTestCase.assertSize(2, directive.combinators);
2346 JUnitTestCase.assertNotNull(directive.semicolon);
2347 }
2348 void test_parseImportDirective_show() {
2349 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' show A, B;");
2350 JUnitTestCase.assertNotNull(directive.keyword);
2351 JUnitTestCase.assertNotNull(directive.uri);
2352 JUnitTestCase.assertNull(directive.asToken);
2353 JUnitTestCase.assertNull(directive.prefix);
2354 EngineTestCase.assertSize(1, directive.combinators);
2355 JUnitTestCase.assertNotNull(directive.semicolon);
2356 }
2357 void test_parseInitializedIdentifierList_type() {
2358 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2359 Token staticKeyword = TokenFactory.token(Keyword.STATIC);
2360 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null);
2361 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif ierList", <Object> [
2362 commentAndMetadata(comment, []),
2363 staticKeyword,
2364 null,
2365 type], "a = 1, b, c = 3;");
2366 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2367 VariableDeclarationList fields = declaration.fields;
2368 JUnitTestCase.assertNotNull(fields);
2369 JUnitTestCase.assertNull(fields.keyword);
2370 JUnitTestCase.assertEquals(type, fields.type);
2371 EngineTestCase.assertSize(3, fields.variables);
2372 JUnitTestCase.assertEquals(staticKeyword, declaration.staticKeyword);
2373 JUnitTestCase.assertNotNull(declaration.semicolon);
2374 }
2375 void test_parseInitializedIdentifierList_var() {
2376 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2377 Token staticKeyword = TokenFactory.token(Keyword.STATIC);
2378 Token varKeyword = TokenFactory.token(Keyword.VAR);
2379 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif ierList", <Object> [
2380 commentAndMetadata(comment, []),
2381 staticKeyword,
2382 varKeyword,
2383 null], "a = 1, b, c = 3;");
2384 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2385 VariableDeclarationList fields = declaration.fields;
2386 JUnitTestCase.assertNotNull(fields);
2387 JUnitTestCase.assertEquals(varKeyword, fields.keyword);
2388 JUnitTestCase.assertNull(fields.type);
2389 EngineTestCase.assertSize(3, fields.variables);
2390 JUnitTestCase.assertEquals(staticKeyword, declaration.staticKeyword);
2391 JUnitTestCase.assertNotNull(declaration.semicolon);
2392 }
2393 void test_parseInstanceCreationExpression_qualifiedType() {
2394 Token token = TokenFactory.token(Keyword.NEW);
2395 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC reationExpression", <Object> [token], "A.B()");
2396 JUnitTestCase.assertEquals(token, expression.keyword);
2397 ConstructorName name = expression.constructorName;
2398 JUnitTestCase.assertNotNull(name);
2399 JUnitTestCase.assertNotNull(name.type);
2400 JUnitTestCase.assertNull(name.period);
2401 JUnitTestCase.assertNull(name.name);
2402 JUnitTestCase.assertNotNull(expression.argumentList);
2403 }
2404 void test_parseInstanceCreationExpression_qualifiedType_named() {
2405 Token token = TokenFactory.token(Keyword.NEW);
2406 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC reationExpression", <Object> [token], "A.B.c()");
2407 JUnitTestCase.assertEquals(token, expression.keyword);
2408 ConstructorName name = expression.constructorName;
2409 JUnitTestCase.assertNotNull(name);
2410 JUnitTestCase.assertNotNull(name.type);
2411 JUnitTestCase.assertNotNull(name.period);
2412 JUnitTestCase.assertNotNull(name.name);
2413 JUnitTestCase.assertNotNull(expression.argumentList);
2414 }
2415 void test_parseInstanceCreationExpression_type() {
2416 Token token = TokenFactory.token(Keyword.NEW);
2417 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC reationExpression", <Object> [token], "A()");
2418 JUnitTestCase.assertEquals(token, expression.keyword);
2419 ConstructorName name = expression.constructorName;
2420 JUnitTestCase.assertNotNull(name);
2421 JUnitTestCase.assertNotNull(name.type);
2422 JUnitTestCase.assertNull(name.period);
2423 JUnitTestCase.assertNull(name.name);
2424 JUnitTestCase.assertNotNull(expression.argumentList);
2425 }
2426 void test_parseInstanceCreationExpression_type_named() {
2427 Token token = TokenFactory.token(Keyword.NEW);
2428 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC reationExpression", <Object> [token], "A<B>.c()");
2429 JUnitTestCase.assertEquals(token, expression.keyword);
2430 ConstructorName name = expression.constructorName;
2431 JUnitTestCase.assertNotNull(name);
2432 JUnitTestCase.assertNotNull(name.type);
2433 JUnitTestCase.assertNotNull(name.period);
2434 JUnitTestCase.assertNotNull(name.name);
2435 JUnitTestCase.assertNotNull(expression.argumentList);
2436 }
2437 void test_parseLibraryDirective() {
2438 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", < Object> [emptyCommentAndMetadata()], "library l;");
2439 JUnitTestCase.assertNotNull(directive.libraryToken);
2440 JUnitTestCase.assertNotNull(directive.name);
2441 JUnitTestCase.assertNotNull(directive.semicolon);
2442 }
2443 void test_parseLibraryIdentifier_multiple() {
2444 String name = "a.b.c";
2445 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []);
2446 JUnitTestCase.assertEquals(name, identifier.name);
2447 }
2448 void test_parseLibraryIdentifier_single() {
2449 String name = "a";
2450 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []);
2451 JUnitTestCase.assertEquals(name, identifier.name);
2452 }
2453 void test_parseListLiteral_empty_oneToken() {
2454 Token token = TokenFactory.token(Keyword.CONST);
2455 TypeArgumentList typeArguments = null;
2456 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en, typeArguments], "[]");
2457 JUnitTestCase.assertEquals(token, literal.constKeyword);
2458 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2459 JUnitTestCase.assertNotNull(literal.leftBracket);
2460 EngineTestCase.assertSize(0, literal.elements);
2461 JUnitTestCase.assertNotNull(literal.rightBracket);
2462 }
2463 void test_parseListLiteral_empty_twoTokens() {
2464 Token token = TokenFactory.token(Keyword.CONST);
2465 TypeArgumentList typeArguments = null;
2466 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en, typeArguments], "[ ]");
2467 JUnitTestCase.assertEquals(token, literal.constKeyword);
2468 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2469 JUnitTestCase.assertNotNull(literal.leftBracket);
2470 EngineTestCase.assertSize(0, literal.elements);
2471 JUnitTestCase.assertNotNull(literal.rightBracket);
2472 }
2473 void test_parseListLiteral_multiple() {
2474 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul l, null], "[1, 2, 3]");
2475 JUnitTestCase.assertNull(literal.constKeyword);
2476 JUnitTestCase.assertNull(literal.typeArguments);
2477 JUnitTestCase.assertNotNull(literal.leftBracket);
2478 EngineTestCase.assertSize(3, literal.elements);
2479 JUnitTestCase.assertNotNull(literal.rightBracket);
2480 }
2481 void test_parseListLiteral_single() {
2482 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul l, null], "[1]");
2483 JUnitTestCase.assertNull(literal.constKeyword);
2484 JUnitTestCase.assertNull(literal.typeArguments);
2485 JUnitTestCase.assertNotNull(literal.leftBracket);
2486 EngineTestCase.assertSize(1, literal.elements);
2487 JUnitTestCase.assertNotNull(literal.rightBracket);
2488 }
2489 void test_parseListOrMapLiteral_list_noType() {
2490 ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "[1]");
2491 JUnitTestCase.assertNull(literal.constKeyword);
2492 JUnitTestCase.assertNull(literal.typeArguments);
2493 JUnitTestCase.assertNotNull(literal.leftBracket);
2494 EngineTestCase.assertSize(1, literal.elements);
2495 JUnitTestCase.assertNotNull(literal.rightBracket);
2496 }
2497 void test_parseListOrMapLiteral_list_type() {
2498 ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<int> [1]");
2499 JUnitTestCase.assertNull(literal.constKeyword);
2500 JUnitTestCase.assertNotNull(literal.typeArguments);
2501 JUnitTestCase.assertNotNull(literal.leftBracket);
2502 EngineTestCase.assertSize(1, literal.elements);
2503 JUnitTestCase.assertNotNull(literal.rightBracket);
2504 }
2505 void test_parseListOrMapLiteral_map_noType() {
2506 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "{'1' : 1}");
2507 JUnitTestCase.assertNull(literal.constKeyword);
2508 JUnitTestCase.assertNull(literal.typeArguments);
2509 JUnitTestCase.assertNotNull(literal.leftBracket);
2510 EngineTestCase.assertSize(1, literal.entries);
2511 JUnitTestCase.assertNotNull(literal.rightBracket);
2512 }
2513 void test_parseListOrMapLiteral_map_type() {
2514 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<String, int> {'1' : 1}");
2515 JUnitTestCase.assertNull(literal.constKeyword);
2516 JUnitTestCase.assertNotNull(literal.typeArguments);
2517 JUnitTestCase.assertNotNull(literal.leftBracket);
2518 EngineTestCase.assertSize(1, literal.entries);
2519 JUnitTestCase.assertNotNull(literal.rightBracket);
2520 }
2521 void test_parseLogicalAndExpression() {
2522 BinaryExpression expression = ParserTestCase.parse5("parseLogicalAndExpressi on", "x && y", []);
2523 JUnitTestCase.assertNotNull(expression.leftOperand);
2524 JUnitTestCase.assertNotNull(expression.operator);
2525 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato r.type);
2526 JUnitTestCase.assertNotNull(expression.rightOperand);
2527 }
2528 void test_parseLogicalOrExpression() {
2529 BinaryExpression expression = ParserTestCase.parse5("parseLogicalOrExpressio n", "x || y", []);
2530 JUnitTestCase.assertNotNull(expression.leftOperand);
2531 JUnitTestCase.assertNotNull(expression.operator);
2532 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type);
2533 JUnitTestCase.assertNotNull(expression.rightOperand);
2534 }
2535 void test_parseMapLiteral_empty() {
2536 Token token = TokenFactory.token(Keyword.CONST);
2537 TypeArgumentList typeArguments = ASTFactory.typeArgumentList([
2538 ASTFactory.typeName4("String", []),
2539 ASTFactory.typeName4("int", [])]);
2540 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token , typeArguments], "{}");
2541 JUnitTestCase.assertEquals(token, literal.constKeyword);
2542 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2543 JUnitTestCase.assertNotNull(literal.leftBracket);
2544 EngineTestCase.assertSize(0, literal.entries);
2545 JUnitTestCase.assertNotNull(literal.rightBracket);
2546 }
2547 void test_parseMapLiteral_multiple() {
2548 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'a' : b, 'x' : y}");
2549 JUnitTestCase.assertNotNull(literal.leftBracket);
2550 EngineTestCase.assertSize(2, literal.entries);
2551 JUnitTestCase.assertNotNull(literal.rightBracket);
2552 }
2553 void test_parseMapLiteral_single() {
2554 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}");
2555 JUnitTestCase.assertNotNull(literal.leftBracket);
2556 EngineTestCase.assertSize(1, literal.entries);
2557 JUnitTestCase.assertNotNull(literal.rightBracket);
2558 }
2559 void test_parseMapLiteralEntry_complex() {
2560 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "2 + 2 : y", []);
2561 JUnitTestCase.assertNotNull(entry.key);
2562 JUnitTestCase.assertNotNull(entry.separator);
2563 JUnitTestCase.assertNotNull(entry.value);
2564 }
2565 void test_parseMapLiteralEntry_int() {
2566 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "0 : y ", []);
2567 JUnitTestCase.assertNotNull(entry.key);
2568 JUnitTestCase.assertNotNull(entry.separator);
2569 JUnitTestCase.assertNotNull(entry.value);
2570 }
2571 void test_parseMapLiteralEntry_string() {
2572 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "'x' : y", []);
2573 JUnitTestCase.assertNotNull(entry.key);
2574 JUnitTestCase.assertNotNull(entry.separator);
2575 JUnitTestCase.assertNotNull(entry.value);
2576 }
2577 void test_parseModifiers_abstract() {
2578 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "abstract A", []);
2579 JUnitTestCase.assertNotNull(modifiers.abstractKeyword);
2580 }
2581 void test_parseModifiers_const() {
2582 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "const A", []) ;
2583 JUnitTestCase.assertNotNull(modifiers.constKeyword);
2584 }
2585 void test_parseModifiers_external() {
2586 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "external A", []);
2587 JUnitTestCase.assertNotNull(modifiers.externalKeyword);
2588 }
2589 void test_parseModifiers_factory() {
2590 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "factory A", [ ]);
2591 JUnitTestCase.assertNotNull(modifiers.factoryKeyword);
2592 }
2593 void test_parseModifiers_final() {
2594 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "final A", []) ;
2595 JUnitTestCase.assertNotNull(modifiers.finalKeyword);
2596 }
2597 void test_parseModifiers_static() {
2598 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "static A", [] );
2599 JUnitTestCase.assertNotNull(modifiers.staticKeyword);
2600 }
2601 void test_parseModifiers_var() {
2602 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "var A", []);
2603 JUnitTestCase.assertNotNull(modifiers.varKeyword);
2604 }
2605 void test_parseMultiplicativeExpression_normal() {
2606 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "x * y", []);
2607 JUnitTestCase.assertNotNull(expression.leftOperand);
2608 JUnitTestCase.assertNotNull(expression.operator);
2609 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
2610 JUnitTestCase.assertNotNull(expression.rightOperand);
2611 }
2612 void test_parseMultiplicativeExpression_super() {
2613 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "super * y", []);
2614 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
2615 JUnitTestCase.assertNotNull(expression.operator);
2616 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
2617 JUnitTestCase.assertNotNull(expression.rightOperand);
2618 }
2619 void test_parseNewExpression() {
2620 InstanceCreationExpression expression = ParserTestCase.parse5("parseNewExpre ssion", "new A()", []);
2621 JUnitTestCase.assertNotNull(expression.keyword);
2622 ConstructorName name = expression.constructorName;
2623 JUnitTestCase.assertNotNull(name);
2624 JUnitTestCase.assertNotNull(name.type);
2625 JUnitTestCase.assertNull(name.period);
2626 JUnitTestCase.assertNull(name.name);
2627 JUnitTestCase.assertNotNull(expression.argumentList);
2628 }
2629 void test_parseNonLabeledStatement_const_list_empty() {
2630 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [];", []);
2631 JUnitTestCase.assertNotNull(statement.expression);
2632 }
2633 void test_parseNonLabeledStatement_const_list_nonEmpty() {
2634 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [1, 2];", []);
2635 JUnitTestCase.assertNotNull(statement.expression);
2636 }
2637 void test_parseNonLabeledStatement_const_map_empty() {
2638 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {};", []);
2639 JUnitTestCase.assertNotNull(statement.expression);
2640 }
2641 void test_parseNonLabeledStatement_const_map_nonEmpty() {
2642 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {'a' : 1};", []);
2643 JUnitTestCase.assertNotNull(statement.expression);
2644 }
2645 void test_parseNonLabeledStatement_const_object() {
2646 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A();", []);
2647 JUnitTestCase.assertNotNull(statement.expression);
2648 }
2649 void test_parseNonLabeledStatement_const_object_named_typeParameters() {
2650 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A<B>.c();", []);
2651 JUnitTestCase.assertNotNull(statement.expression);
2652 }
2653 void test_parseNonLabeledStatement_constructorInvocation() {
2654 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "new C().m();", []);
2655 JUnitTestCase.assertNotNull(statement.expression);
2656 }
2657 void test_parseNonLabeledStatement_false() {
2658 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "false;", []);
2659 JUnitTestCase.assertNotNull(statement.expression);
2660 }
2661 void test_parseNonLabeledStatement_functionDeclaration() {
2662 ParserTestCase.parse5("parseNonLabeledStatement", "f() {};", []);
2663 }
2664 void test_parseNonLabeledStatement_functionDeclaration_arguments() {
2665 ParserTestCase.parse5("parseNonLabeledStatement", "f(void g()) {};", []);
2666 }
2667 void test_parseNonLabeledStatement_functionExpressionIndex() {
2668 ParserTestCase.parse5("parseNonLabeledStatement", "() {}[0] = null;", []);
2669 }
2670 void test_parseNonLabeledStatement_functionInvocation() {
2671 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "f();", []);
2672 JUnitTestCase.assertNotNull(statement.expression);
2673 }
2674 void test_parseNonLabeledStatement_invokeFunctionExpression() {
2675 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "(a) {return a + a;} (3);", []);
2676 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr ession);
2677 FunctionExpressionInvocation invocation = statement.expression as FunctionEx pressionInvocation;
2678 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
2679 FunctionExpression expression = invocation.function as FunctionExpression;
2680 JUnitTestCase.assertNotNull(expression.parameters);
2681 JUnitTestCase.assertNotNull(expression.body);
2682 ArgumentList list = invocation.argumentList;
2683 JUnitTestCase.assertNotNull(list);
2684 EngineTestCase.assertSize(1, list.arguments);
2685 }
2686 void test_parseNonLabeledStatement_null() {
2687 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "null;", []);
2688 JUnitTestCase.assertNotNull(statement.expression);
2689 }
2690 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() {
2691 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "library.getName();", []);
2692 JUnitTestCase.assertNotNull(statement.expression);
2693 }
2694 void test_parseNonLabeledStatement_true() {
2695 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "true;", []);
2696 JUnitTestCase.assertNotNull(statement.expression);
2697 }
2698 void test_parseNonLabeledStatement_typeCast() {
2699 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "double.NAN as num;", []);
2700 JUnitTestCase.assertNotNull(statement.expression);
2701 }
2702 void test_parseNormalFormalParameter_field_const_noType() {
2703 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const this.a)", []);
2704 JUnitTestCase.assertNotNull(parameter.keyword);
2705 JUnitTestCase.assertNull(parameter.type);
2706 JUnitTestCase.assertNotNull(parameter.identifier);
2707 JUnitTestCase.assertNull(parameter.parameters);
2708 }
2709 void test_parseNormalFormalParameter_field_const_type() {
2710 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const A this.a)", []);
2711 JUnitTestCase.assertNotNull(parameter.keyword);
2712 JUnitTestCase.assertNotNull(parameter.type);
2713 JUnitTestCase.assertNotNull(parameter.identifier);
2714 JUnitTestCase.assertNull(parameter.parameters);
2715 }
2716 void test_parseNormalFormalParameter_field_final_noType() {
2717 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final this.a)", []);
2718 JUnitTestCase.assertNotNull(parameter.keyword);
2719 JUnitTestCase.assertNull(parameter.type);
2720 JUnitTestCase.assertNotNull(parameter.identifier);
2721 JUnitTestCase.assertNull(parameter.parameters);
2722 }
2723 void test_parseNormalFormalParameter_field_final_type() {
2724 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final A this.a)", []);
2725 JUnitTestCase.assertNotNull(parameter.keyword);
2726 JUnitTestCase.assertNotNull(parameter.type);
2727 JUnitTestCase.assertNotNull(parameter.identifier);
2728 JUnitTestCase.assertNull(parameter.parameters);
2729 }
2730 void test_parseNormalFormalParameter_field_function_nested() {
2731 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a(B b))", []);
2732 JUnitTestCase.assertNull(parameter.keyword);
2733 JUnitTestCase.assertNull(parameter.type);
2734 JUnitTestCase.assertNotNull(parameter.identifier);
2735 FormalParameterList parameterList = parameter.parameters;
2736 JUnitTestCase.assertNotNull(parameterList);
2737 EngineTestCase.assertSize(1, parameterList.parameters);
2738 }
2739 void test_parseNormalFormalParameter_field_function_noNested() {
2740 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a())", []);
2741 JUnitTestCase.assertNull(parameter.keyword);
2742 JUnitTestCase.assertNull(parameter.type);
2743 JUnitTestCase.assertNotNull(parameter.identifier);
2744 FormalParameterList parameterList = parameter.parameters;
2745 JUnitTestCase.assertNotNull(parameterList);
2746 EngineTestCase.assertSize(0, parameterList.parameters);
2747 }
2748 void test_parseNormalFormalParameter_field_noType() {
2749 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a)", []);
2750 JUnitTestCase.assertNull(parameter.keyword);
2751 JUnitTestCase.assertNull(parameter.type);
2752 JUnitTestCase.assertNotNull(parameter.identifier);
2753 JUnitTestCase.assertNull(parameter.parameters);
2754 }
2755 void test_parseNormalFormalParameter_field_type() {
2756 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "A this.a)", []);
2757 JUnitTestCase.assertNull(parameter.keyword);
2758 JUnitTestCase.assertNotNull(parameter.type);
2759 JUnitTestCase.assertNotNull(parameter.identifier);
2760 JUnitTestCase.assertNull(parameter.parameters);
2761 }
2762 void test_parseNormalFormalParameter_field_var() {
2763 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "var this.a)", []);
2764 JUnitTestCase.assertNotNull(parameter.keyword);
2765 JUnitTestCase.assertNull(parameter.type);
2766 JUnitTestCase.assertNotNull(parameter.identifier);
2767 JUnitTestCase.assertNull(parameter.parameters);
2768 }
2769 void test_parseNormalFormalParameter_function_noType() {
2770 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "a())", []);
2771 JUnitTestCase.assertNull(parameter.returnType);
2772 JUnitTestCase.assertNotNull(parameter.identifier);
2773 JUnitTestCase.assertNotNull(parameter.parameters);
2774 }
2775 void test_parseNormalFormalParameter_function_type() {
2776 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "A a())", []);
2777 JUnitTestCase.assertNotNull(parameter.returnType);
2778 JUnitTestCase.assertNotNull(parameter.identifier);
2779 JUnitTestCase.assertNotNull(parameter.parameters);
2780 }
2781 void test_parseNormalFormalParameter_function_void() {
2782 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "void a())", []);
2783 JUnitTestCase.assertNotNull(parameter.returnType);
2784 JUnitTestCase.assertNotNull(parameter.identifier);
2785 JUnitTestCase.assertNotNull(parameter.parameters);
2786 }
2787 void test_parseNormalFormalParameter_simple_const_noType() {
2788 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const a)", []);
2789 JUnitTestCase.assertNotNull(parameter.keyword);
2790 JUnitTestCase.assertNull(parameter.type);
2791 JUnitTestCase.assertNotNull(parameter.identifier);
2792 }
2793 void test_parseNormalFormalParameter_simple_const_type() {
2794 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const A a)", []);
2795 JUnitTestCase.assertNotNull(parameter.keyword);
2796 JUnitTestCase.assertNotNull(parameter.type);
2797 JUnitTestCase.assertNotNull(parameter.identifier);
2798 }
2799 void test_parseNormalFormalParameter_simple_final_noType() {
2800 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final a)", []);
2801 JUnitTestCase.assertNotNull(parameter.keyword);
2802 JUnitTestCase.assertNull(parameter.type);
2803 JUnitTestCase.assertNotNull(parameter.identifier);
2804 }
2805 void test_parseNormalFormalParameter_simple_final_type() {
2806 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final A a)", []);
2807 JUnitTestCase.assertNotNull(parameter.keyword);
2808 JUnitTestCase.assertNotNull(parameter.type);
2809 JUnitTestCase.assertNotNull(parameter.identifier);
2810 }
2811 void test_parseNormalFormalParameter_simple_noType() {
2812 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "a)", []);
2813 JUnitTestCase.assertNull(parameter.keyword);
2814 JUnitTestCase.assertNull(parameter.type);
2815 JUnitTestCase.assertNotNull(parameter.identifier);
2816 }
2817 void test_parseNormalFormalParameter_simple_type() {
2818 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "A a)", []);
2819 JUnitTestCase.assertNull(parameter.keyword);
2820 JUnitTestCase.assertNotNull(parameter.type);
2821 JUnitTestCase.assertNotNull(parameter.identifier);
2822 }
2823 void test_parseOperator() {
2824 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2825 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2826 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c ommentAndMetadata(comment, []), null, returnType], "operator +(A a);");
2827 JUnitTestCase.assertNotNull(method.body);
2828 JUnitTestCase.assertEquals(comment, method.documentationComment);
2829 JUnitTestCase.assertNull(method.externalKeyword);
2830 JUnitTestCase.assertNull(method.modifierKeyword);
2831 JUnitTestCase.assertNotNull(method.name);
2832 JUnitTestCase.assertNotNull(method.operatorKeyword);
2833 JUnitTestCase.assertNotNull(method.parameters);
2834 JUnitTestCase.assertNull(method.propertyKeyword);
2835 JUnitTestCase.assertEquals(returnType, method.returnType);
2836 }
2837 void test_parseOptionalReturnType() {
2838 }
2839 void test_parsePartDirective_part() {
2840 PartDirective directive = ParserTestCase.parse("parsePartDirective", <Object > [emptyCommentAndMetadata()], "part 'lib/lib.dart';");
2841 JUnitTestCase.assertNotNull(directive.partToken);
2842 JUnitTestCase.assertNotNull(directive.uri);
2843 JUnitTestCase.assertNotNull(directive.semicolon);
2844 }
2845 void test_parsePartDirective_partOf() {
2846 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje ct> [emptyCommentAndMetadata()], "part of l;");
2847 JUnitTestCase.assertNotNull(directive.partToken);
2848 JUnitTestCase.assertNotNull(directive.ofToken);
2849 JUnitTestCase.assertNotNull(directive.libraryName);
2850 JUnitTestCase.assertNotNull(directive.semicolon);
2851 }
2852 void test_parsePostfixExpression_decrement() {
2853 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i--", []);
2854 JUnitTestCase.assertNotNull(expression.operand);
2855 JUnitTestCase.assertNotNull(expression.operator);
2856 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
2857 }
2858 void test_parsePostfixExpression_increment() {
2859 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i++", []);
2860 JUnitTestCase.assertNotNull(expression.operand);
2861 JUnitTestCase.assertNotNull(expression.operator);
2862 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
2863 }
2864 void test_parsePostfixExpression_none_indexExpression() {
2865 IndexExpression expression = ParserTestCase.parse5("parsePostfixExpression", "a[0]", []);
2866 JUnitTestCase.assertNotNull(expression.target);
2867 JUnitTestCase.assertNotNull(expression.index);
2868 }
2869 void test_parsePostfixExpression_none_methodInvocation() {
2870 MethodInvocation expression = ParserTestCase.parse5("parsePostfixExpression" , "a.m()", []);
2871 JUnitTestCase.assertNotNull(expression.target);
2872 JUnitTestCase.assertNotNull(expression.methodName);
2873 JUnitTestCase.assertNotNull(expression.argumentList);
2874 }
2875 void test_parsePostfixExpression_none_propertyAccess() {
2876 PrefixedIdentifier expression = ParserTestCase.parse5("parsePostfixExpressio n", "a.b", []);
2877 JUnitTestCase.assertNotNull(expression.prefix);
2878 JUnitTestCase.assertNotNull(expression.identifier);
2879 }
2880 void test_parsePrefixedIdentifier_noPrefix() {
2881 String lexeme = "bar";
2882 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifier ", lexeme, []);
2883 JUnitTestCase.assertNotNull(identifier.token);
2884 JUnitTestCase.assertEquals(lexeme, identifier.name);
2885 }
2886 void test_parsePrefixedIdentifier_prefix() {
2887 String lexeme = "foo.bar";
2888 PrefixedIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifi er", lexeme, []);
2889 JUnitTestCase.assertEquals("foo", identifier.prefix.name);
2890 JUnitTestCase.assertNotNull(identifier.period);
2891 JUnitTestCase.assertEquals("bar", identifier.identifier.name);
2892 }
2893 void test_parsePrimaryExpression_const() {
2894 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "const A()", []);
2895 JUnitTestCase.assertNotNull(expression);
2896 }
2897 void test_parsePrimaryExpression_double() {
2898 String doubleLiteral = "3.2e4";
2899 DoubleLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", doub leLiteral, []);
2900 JUnitTestCase.assertNotNull(literal.literal);
2901 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value);
2902 }
2903 void test_parsePrimaryExpression_false() {
2904 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "fa lse", []);
2905 JUnitTestCase.assertNotNull(literal.literal);
2906 JUnitTestCase.assertFalse(literal.value);
2907 }
2908 void test_parsePrimaryExpression_function_arguments() {
2909 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "(int i) => i + 1", []);
2910 JUnitTestCase.assertNotNull(expression.parameters);
2911 JUnitTestCase.assertNotNull(expression.body);
2912 }
2913 void test_parsePrimaryExpression_function_noArguments() {
2914 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "() => 42", []);
2915 JUnitTestCase.assertNotNull(expression.parameters);
2916 JUnitTestCase.assertNotNull(expression.body);
2917 }
2918 void test_parsePrimaryExpression_hex() {
2919 String hexLiteral = "3F";
2920 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "0x ${hexLiteral}", []);
2921 JUnitTestCase.assertNotNull(literal.literal);
2922 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value);
2923 }
2924 void test_parsePrimaryExpression_identifier() {
2925 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrimaryExpression" , "a", []);
2926 JUnitTestCase.assertNotNull(identifier);
2927 }
2928 void test_parsePrimaryExpression_int() {
2929 String intLiteral = "472";
2930 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", int Literal, []);
2931 JUnitTestCase.assertNotNull(literal.literal);
2932 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value);
2933 }
2934 void test_parsePrimaryExpression_listLiteral() {
2935 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[ ]", []);
2936 JUnitTestCase.assertNotNull(literal);
2937 }
2938 void test_parsePrimaryExpression_listLiteral_index() {
2939 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[]", []);
2940 JUnitTestCase.assertNotNull(literal);
2941 }
2942 void test_parsePrimaryExpression_listLiteral_typed() {
2943 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>[ ]", []);
2944 JUnitTestCase.assertNotNull(literal.typeArguments);
2945 EngineTestCase.assertSize(1, literal.typeArguments.arguments);
2946 }
2947 void test_parsePrimaryExpression_mapLiteral() {
2948 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "{}", [ ]);
2949 JUnitTestCase.assertNotNull(literal);
2950 }
2951 void test_parsePrimaryExpression_mapLiteral_typed() {
2952 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A, B> {}", []);
2953 JUnitTestCase.assertNotNull(literal.typeArguments);
2954 EngineTestCase.assertSize(2, literal.typeArguments.arguments);
2955 }
2956 void test_parsePrimaryExpression_new() {
2957 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "new A()", []);
2958 JUnitTestCase.assertNotNull(expression);
2959 }
2960 void test_parsePrimaryExpression_null() {
2961 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null" , []);
2962 JUnitTestCase.assertNotNull(literal.literal);
2963 }
2964 void test_parsePrimaryExpression_parenthesized() {
2965 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr ession", "(x)", []);
2966 JUnitTestCase.assertNotNull(expression);
2967 }
2968 void test_parsePrimaryExpression_string() {
2969 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression" , "\"string\"", []);
2970 JUnitTestCase.assertFalse(literal.isMultiline);
2971 JUnitTestCase.assertEquals("string", literal.value);
2972 }
2973 void test_parsePrimaryExpression_super() {
2974 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio n", "super.x", []);
2975 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression);
2976 JUnitTestCase.assertNotNull(propertyAccess.operator);
2977 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type);
2978 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
2979 }
2980 void test_parsePrimaryExpression_this() {
2981 ThisExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "this", []);
2982 JUnitTestCase.assertNotNull(expression.keyword);
2983 }
2984 void test_parsePrimaryExpression_true() {
2985 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "tr ue", []);
2986 JUnitTestCase.assertNotNull(literal.literal);
2987 JUnitTestCase.assertTrue(literal.value);
2988 }
2989 void test_Parser() {
2990 JUnitTestCase.assertNotNull(new Parser(null, null));
2991 }
2992 void test_parseRedirectingConstructorInvocation_named() {
2993 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this.a()", []);
2994 JUnitTestCase.assertNotNull(invocation.argumentList);
2995 JUnitTestCase.assertNotNull(invocation.constructorName);
2996 JUnitTestCase.assertNotNull(invocation.keyword);
2997 JUnitTestCase.assertNotNull(invocation.period);
2998 }
2999 void test_parseRedirectingConstructorInvocation_unnamed() {
3000 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this()", []);
3001 JUnitTestCase.assertNotNull(invocation.argumentList);
3002 JUnitTestCase.assertNull(invocation.constructorName);
3003 JUnitTestCase.assertNotNull(invocation.keyword);
3004 JUnitTestCase.assertNull(invocation.period);
3005 }
3006 void test_parseRelationalExpression_as() {
3007 AsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x as Y", []);
3008 JUnitTestCase.assertNotNull(expression.expression);
3009 JUnitTestCase.assertNotNull(expression.asOperator);
3010 JUnitTestCase.assertNotNull(expression.type);
3011 }
3012 void test_parseRelationalExpression_is() {
3013 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is y", []);
3014 JUnitTestCase.assertNotNull(expression.expression);
3015 JUnitTestCase.assertNotNull(expression.isOperator);
3016 JUnitTestCase.assertNull(expression.notOperator);
3017 JUnitTestCase.assertNotNull(expression.type);
3018 }
3019 void test_parseRelationalExpression_isNot() {
3020 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is! y", []);
3021 JUnitTestCase.assertNotNull(expression.expression);
3022 JUnitTestCase.assertNotNull(expression.isOperator);
3023 JUnitTestCase.assertNotNull(expression.notOperator);
3024 JUnitTestCase.assertNotNull(expression.type);
3025 }
3026 void test_parseRelationalExpression_normal() {
3027 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "x < y", []);
3028 JUnitTestCase.assertNotNull(expression.leftOperand);
3029 JUnitTestCase.assertNotNull(expression.operator);
3030 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
3031 JUnitTestCase.assertNotNull(expression.rightOperand);
3032 }
3033 void test_parseRelationalExpression_super() {
3034 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "super < y", []);
3035 JUnitTestCase.assertNotNull(expression.leftOperand);
3036 JUnitTestCase.assertNotNull(expression.operator);
3037 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
3038 JUnitTestCase.assertNotNull(expression.rightOperand);
3039 }
3040 void test_parseRethrowExpression() {
3041 RethrowExpression expression = ParserTestCase.parse5("parseRethrowExpression ", "rethrow;", []);
3042 JUnitTestCase.assertNotNull(expression.keyword);
3043 }
3044 void test_parseReturnStatement_noValue() {
3045 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn;", []);
3046 JUnitTestCase.assertNotNull(statement.keyword);
3047 JUnitTestCase.assertNull(statement.expression);
3048 JUnitTestCase.assertNotNull(statement.semicolon);
3049 }
3050 void test_parseReturnStatement_value() {
3051 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn x;", []);
3052 JUnitTestCase.assertNotNull(statement.keyword);
3053 JUnitTestCase.assertNotNull(statement.expression);
3054 JUnitTestCase.assertNotNull(statement.semicolon);
3055 }
3056 void test_parseReturnType_nonVoid() {
3057 TypeName typeName = ParserTestCase.parse5("parseReturnType", "A<B>", []);
3058 JUnitTestCase.assertNotNull(typeName.name);
3059 JUnitTestCase.assertNotNull(typeName.typeArguments);
3060 }
3061 void test_parseReturnType_void() {
3062 TypeName typeName = ParserTestCase.parse5("parseReturnType", "void", []);
3063 JUnitTestCase.assertNotNull(typeName.name);
3064 JUnitTestCase.assertNull(typeName.typeArguments);
3065 }
3066 void test_parseSetter_nonStatic() {
3067 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
3068 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
3069 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "set a(var x);");
3070 JUnitTestCase.assertNotNull(method.body);
3071 JUnitTestCase.assertEquals(comment, method.documentationComment);
3072 JUnitTestCase.assertNull(method.externalKeyword);
3073 JUnitTestCase.assertNull(method.modifierKeyword);
3074 JUnitTestCase.assertNotNull(method.name);
3075 JUnitTestCase.assertNull(method.operatorKeyword);
3076 JUnitTestCase.assertNotNull(method.parameters);
3077 JUnitTestCase.assertNotNull(method.propertyKeyword);
3078 JUnitTestCase.assertEquals(returnType, method.returnType);
3079 }
3080 void test_parseSetter_static() {
3081 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
3082 Token staticKeyword = TokenFactory.token(Keyword.STATIC);
3083 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
3084 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [
3085 commentAndMetadata(comment, []),
3086 null,
3087 staticKeyword,
3088 returnType], "set a(var x) {}");
3089 JUnitTestCase.assertNotNull(method.body);
3090 JUnitTestCase.assertEquals(comment, method.documentationComment);
3091 JUnitTestCase.assertNull(method.externalKeyword);
3092 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
3093 JUnitTestCase.assertNotNull(method.name);
3094 JUnitTestCase.assertNull(method.operatorKeyword);
3095 JUnitTestCase.assertNotNull(method.parameters);
3096 JUnitTestCase.assertNotNull(method.propertyKeyword);
3097 JUnitTestCase.assertEquals(returnType, method.returnType);
3098 }
3099 void test_parseShiftExpression_normal() {
3100 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "x << y", []);
3101 JUnitTestCase.assertNotNull(expression.leftOperand);
3102 JUnitTestCase.assertNotNull(expression.operator);
3103 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
3104 JUnitTestCase.assertNotNull(expression.rightOperand);
3105 }
3106 void test_parseShiftExpression_super() {
3107 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "super << y", []);
3108 JUnitTestCase.assertNotNull(expression.leftOperand);
3109 JUnitTestCase.assertNotNull(expression.operator);
3110 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
3111 JUnitTestCase.assertNotNull(expression.rightOperand);
3112 }
3113 void test_parseSimpleIdentifier_builtInIdentifier() {
3114 String lexeme = "as";
3115 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []);
3116 JUnitTestCase.assertNotNull(identifier.token);
3117 JUnitTestCase.assertEquals(lexeme, identifier.name);
3118 }
3119 void test_parseSimpleIdentifier_normalIdentifier() {
3120 String lexeme = "foo";
3121 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []);
3122 JUnitTestCase.assertNotNull(identifier.token);
3123 JUnitTestCase.assertEquals(lexeme, identifier.name);
3124 }
3125 void test_parseSimpleIdentifier1_normalIdentifier() {
3126 }
3127 void test_parseStatement_functionDeclaration() {
3128 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseStateme nt", "int f(a, b) {};", []);
3129 JUnitTestCase.assertNotNull(statement.functionDeclaration);
3130 }
3131 void test_parseStatement_mulipleLabels() {
3132 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: m: return x;", []);
3133 EngineTestCase.assertSize(2, statement.labels);
3134 JUnitTestCase.assertNotNull(statement.statement);
3135 }
3136 void test_parseStatement_noLabels() {
3137 ParserTestCase.parse5("parseStatement", "return x;", []);
3138 }
3139 void test_parseStatement_singleLabel() {
3140 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: ret urn x;", []);
3141 EngineTestCase.assertSize(1, statement.labels);
3142 JUnitTestCase.assertNotNull(statement.statement);
3143 }
3144 void test_parseStatements_multiple() {
3145 List<Statement> statements = ParserTestCase.parseStatements("return; return; ", 2, []);
3146 EngineTestCase.assertSize(2, statements);
3147 }
3148 void test_parseStatements_single() {
3149 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, [] );
3150 EngineTestCase.assertSize(1, statements);
3151 }
3152 void test_parseStringLiteral_adjacent() {
3153 AdjacentStrings literal = ParserTestCase.parse5("parseStringLiteral", "'a' ' b'", []);
3154 NodeList<StringLiteral> strings = literal.strings;
3155 EngineTestCase.assertSize(2, strings);
3156 StringLiteral firstString = strings[0];
3157 StringLiteral secondString = strings[1];
3158 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value );
3159 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu e);
3160 }
3161 void test_parseStringLiteral_interpolated() {
3162 StringInterpolation literal = ParserTestCase.parse5("parseStringLiteral", "' a \${b} c \$this d'", []);
3163 NodeList<InterpolationElement> elements = literal.elements;
3164 EngineTestCase.assertSize(5, elements);
3165 JUnitTestCase.assertTrue(elements[0] is InterpolationString);
3166 JUnitTestCase.assertTrue(elements[1] is InterpolationExpression);
3167 JUnitTestCase.assertTrue(elements[2] is InterpolationString);
3168 JUnitTestCase.assertTrue(elements[3] is InterpolationExpression);
3169 JUnitTestCase.assertTrue(elements[4] is InterpolationString);
3170 }
3171 void test_parseStringLiteral_single() {
3172 SimpleStringLiteral literal = ParserTestCase.parse5("parseStringLiteral", "' a'", []);
3173 JUnitTestCase.assertNotNull(literal.literal);
3174 JUnitTestCase.assertEquals("a", literal.value);
3175 }
3176 void test_parseSuperConstructorInvocation_named() {
3177 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super.a()", []);
3178 JUnitTestCase.assertNotNull(invocation.argumentList);
3179 JUnitTestCase.assertNotNull(invocation.constructorName);
3180 JUnitTestCase.assertNotNull(invocation.keyword);
3181 JUnitTestCase.assertNotNull(invocation.period);
3182 }
3183 void test_parseSuperConstructorInvocation_unnamed() {
3184 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super()", []);
3185 JUnitTestCase.assertNotNull(invocation.argumentList);
3186 JUnitTestCase.assertNull(invocation.constructorName);
3187 JUnitTestCase.assertNotNull(invocation.keyword);
3188 JUnitTestCase.assertNull(invocation.period);
3189 }
3190 void test_parseSwitchStatement_case() {
3191 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 1: return 'I';}", []);
3192 JUnitTestCase.assertNotNull(statement.keyword);
3193 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3194 JUnitTestCase.assertNotNull(statement.expression);
3195 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3196 JUnitTestCase.assertNotNull(statement.leftBracket);
3197 EngineTestCase.assertSize(1, statement.members);
3198 JUnitTestCase.assertNotNull(statement.rightBracket);
3199 }
3200 void test_parseSwitchStatement_empty() {
3201 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {}", []);
3202 JUnitTestCase.assertNotNull(statement.keyword);
3203 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3204 JUnitTestCase.assertNotNull(statement.expression);
3205 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3206 JUnitTestCase.assertNotNull(statement.leftBracket);
3207 EngineTestCase.assertSize(0, statement.members);
3208 JUnitTestCase.assertNotNull(statement.rightBracket);
3209 }
3210 void test_parseSwitchStatement_labeledCase() {
3211 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {l1: l2: l3: case(1):}", []);
3212 JUnitTestCase.assertNotNull(statement.keyword);
3213 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3214 JUnitTestCase.assertNotNull(statement.expression);
3215 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3216 JUnitTestCase.assertNotNull(statement.leftBracket);
3217 EngineTestCase.assertSize(1, statement.members);
3218 EngineTestCase.assertSize(3, statement.members[0].labels);
3219 JUnitTestCase.assertNotNull(statement.rightBracket);
3220 }
3221 void test_parseSwitchStatement_labeledStatementInCase() {
3222 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 0: f(); l1: g(); break;}", []);
3223 JUnitTestCase.assertNotNull(statement.keyword);
3224 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3225 JUnitTestCase.assertNotNull(statement.expression);
3226 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3227 JUnitTestCase.assertNotNull(statement.leftBracket);
3228 EngineTestCase.assertSize(1, statement.members);
3229 EngineTestCase.assertSize(3, statement.members[0].statements);
3230 JUnitTestCase.assertNotNull(statement.rightBracket);
3231 }
3232 void test_parseSymbolLiteral_builtInIdentifier() {
3233 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#dynami c.static.abstract", []);
3234 JUnitTestCase.assertNotNull(literal.poundSign);
3235 List<Token> components = literal.components;
3236 EngineTestCase.assertLength(3, components);
3237 JUnitTestCase.assertEquals("dynamic", components[0].lexeme);
3238 JUnitTestCase.assertEquals("static", components[1].lexeme);
3239 JUnitTestCase.assertEquals("abstract", components[2].lexeme);
3240 }
3241 void test_parseSymbolLiteral_multiple() {
3242 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#a.b.c" , []);
3243 JUnitTestCase.assertNotNull(literal.poundSign);
3244 List<Token> components = literal.components;
3245 EngineTestCase.assertLength(3, components);
3246 JUnitTestCase.assertEquals("a", components[0].lexeme);
3247 JUnitTestCase.assertEquals("b", components[1].lexeme);
3248 JUnitTestCase.assertEquals("c", components[2].lexeme);
3249 }
3250 void test_parseSymbolLiteral_operator() {
3251 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#==", [ ]);
3252 JUnitTestCase.assertNotNull(literal.poundSign);
3253 List<Token> components = literal.components;
3254 EngineTestCase.assertLength(1, components);
3255 JUnitTestCase.assertEquals("==", components[0].lexeme);
3256 }
3257 void test_parseSymbolLiteral_single() {
3258 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#a", [] );
3259 JUnitTestCase.assertNotNull(literal.poundSign);
3260 List<Token> components = literal.components;
3261 EngineTestCase.assertLength(1, components);
3262 JUnitTestCase.assertEquals("a", components[0].lexeme);
3263 }
3264 void test_parseThrowExpression() {
3265 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpression", " throw x;", []);
3266 JUnitTestCase.assertNotNull(expression.keyword);
3267 JUnitTestCase.assertNotNull(expression.expression);
3268 }
3269 void test_parseThrowExpressionWithoutCascade() {
3270 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpressionWith outCascade", "throw x;", []);
3271 JUnitTestCase.assertNotNull(expression.keyword);
3272 JUnitTestCase.assertNotNull(expression.expression);
3273 }
3274 void test_parseTryStatement_catch() {
3275 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e) {}", []);
3276 JUnitTestCase.assertNotNull(statement.tryKeyword);
3277 JUnitTestCase.assertNotNull(statement.body);
3278 NodeList<CatchClause> catchClauses = statement.catchClauses;
3279 EngineTestCase.assertSize(1, catchClauses);
3280 CatchClause clause = catchClauses[0];
3281 JUnitTestCase.assertNull(clause.onKeyword);
3282 JUnitTestCase.assertNull(clause.exceptionType);
3283 JUnitTestCase.assertNotNull(clause.catchKeyword);
3284 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3285 JUnitTestCase.assertNull(clause.comma);
3286 JUnitTestCase.assertNull(clause.stackTraceParameter);
3287 JUnitTestCase.assertNotNull(clause.body);
3288 JUnitTestCase.assertNull(statement.finallyKeyword);
3289 JUnitTestCase.assertNull(statement.finallyBlock);
3290 }
3291 void test_parseTryStatement_catch_finally() {
3292 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e, s) {} finally {}", []);
3293 JUnitTestCase.assertNotNull(statement.tryKeyword);
3294 JUnitTestCase.assertNotNull(statement.body);
3295 NodeList<CatchClause> catchClauses = statement.catchClauses;
3296 EngineTestCase.assertSize(1, catchClauses);
3297 CatchClause clause = catchClauses[0];
3298 JUnitTestCase.assertNull(clause.onKeyword);
3299 JUnitTestCase.assertNull(clause.exceptionType);
3300 JUnitTestCase.assertNotNull(clause.catchKeyword);
3301 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3302 JUnitTestCase.assertNotNull(clause.comma);
3303 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3304 JUnitTestCase.assertNotNull(clause.body);
3305 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3306 JUnitTestCase.assertNotNull(statement.finallyBlock);
3307 }
3308 void test_parseTryStatement_finally() {
3309 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} finally {}", []);
3310 JUnitTestCase.assertNotNull(statement.tryKeyword);
3311 JUnitTestCase.assertNotNull(statement.body);
3312 EngineTestCase.assertSize(0, statement.catchClauses);
3313 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3314 JUnitTestCase.assertNotNull(statement.finallyBlock);
3315 }
3316 void test_parseTryStatement_multiple() {
3317 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []);
3318 JUnitTestCase.assertNotNull(statement.tryKeyword);
3319 JUnitTestCase.assertNotNull(statement.body);
3320 EngineTestCase.assertSize(3, statement.catchClauses);
3321 JUnitTestCase.assertNull(statement.finallyKeyword);
3322 JUnitTestCase.assertNull(statement.finallyBlock);
3323 }
3324 void test_parseTryStatement_on() {
3325 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error {}", []);
3326 JUnitTestCase.assertNotNull(statement.tryKeyword);
3327 JUnitTestCase.assertNotNull(statement.body);
3328 NodeList<CatchClause> catchClauses = statement.catchClauses;
3329 EngineTestCase.assertSize(1, catchClauses);
3330 CatchClause clause = catchClauses[0];
3331 JUnitTestCase.assertNotNull(clause.onKeyword);
3332 JUnitTestCase.assertNotNull(clause.exceptionType);
3333 JUnitTestCase.assertNull(clause.catchKeyword);
3334 JUnitTestCase.assertNull(clause.exceptionParameter);
3335 JUnitTestCase.assertNull(clause.comma);
3336 JUnitTestCase.assertNull(clause.stackTraceParameter);
3337 JUnitTestCase.assertNotNull(clause.body);
3338 JUnitTestCase.assertNull(statement.finallyKeyword);
3339 JUnitTestCase.assertNull(statement.finallyBlock);
3340 }
3341 void test_parseTryStatement_on_catch() {
3342 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {}", []);
3343 JUnitTestCase.assertNotNull(statement.tryKeyword);
3344 JUnitTestCase.assertNotNull(statement.body);
3345 NodeList<CatchClause> catchClauses = statement.catchClauses;
3346 EngineTestCase.assertSize(1, catchClauses);
3347 CatchClause clause = catchClauses[0];
3348 JUnitTestCase.assertNotNull(clause.onKeyword);
3349 JUnitTestCase.assertNotNull(clause.exceptionType);
3350 JUnitTestCase.assertNotNull(clause.catchKeyword);
3351 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3352 JUnitTestCase.assertNotNull(clause.comma);
3353 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3354 JUnitTestCase.assertNotNull(clause.body);
3355 JUnitTestCase.assertNull(statement.finallyKeyword);
3356 JUnitTestCase.assertNull(statement.finallyBlock);
3357 }
3358 void test_parseTryStatement_on_catch_finally() {
3359 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []);
3360 JUnitTestCase.assertNotNull(statement.tryKeyword);
3361 JUnitTestCase.assertNotNull(statement.body);
3362 NodeList<CatchClause> catchClauses = statement.catchClauses;
3363 EngineTestCase.assertSize(1, catchClauses);
3364 CatchClause clause = catchClauses[0];
3365 JUnitTestCase.assertNotNull(clause.onKeyword);
3366 JUnitTestCase.assertNotNull(clause.exceptionType);
3367 JUnitTestCase.assertNotNull(clause.catchKeyword);
3368 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3369 JUnitTestCase.assertNotNull(clause.comma);
3370 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3371 JUnitTestCase.assertNotNull(clause.body);
3372 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3373 JUnitTestCase.assertNotNull(statement.finallyBlock);
3374 }
3375 void test_parseTypeAlias_function_noParameters() {
3376 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef bool F();");
3377 JUnitTestCase.assertNotNull(typeAlias.keyword);
3378 JUnitTestCase.assertNotNull(typeAlias.name);
3379 JUnitTestCase.assertNotNull(typeAlias.parameters);
3380 JUnitTestCase.assertNotNull(typeAlias.returnType);
3381 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3382 JUnitTestCase.assertNull(typeAlias.typeParameters);
3383 }
3384 void test_parseTypeAlias_function_noReturnType() {
3385 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef F();");
3386 JUnitTestCase.assertNotNull(typeAlias.keyword);
3387 JUnitTestCase.assertNotNull(typeAlias.name);
3388 JUnitTestCase.assertNotNull(typeAlias.parameters);
3389 JUnitTestCase.assertNull(typeAlias.returnType);
3390 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3391 JUnitTestCase.assertNull(typeAlias.typeParameters);
3392 }
3393 void test_parseTypeAlias_function_parameterizedReturnType() {
3394 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef A<B> F();");
3395 JUnitTestCase.assertNotNull(typeAlias.keyword);
3396 JUnitTestCase.assertNotNull(typeAlias.name);
3397 JUnitTestCase.assertNotNull(typeAlias.parameters);
3398 JUnitTestCase.assertNotNull(typeAlias.returnType);
3399 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3400 JUnitTestCase.assertNull(typeAlias.typeParameters);
3401 }
3402 void test_parseTypeAlias_function_parameters() {
3403 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef bool F(Object value);");
3404 JUnitTestCase.assertNotNull(typeAlias.keyword);
3405 JUnitTestCase.assertNotNull(typeAlias.name);
3406 JUnitTestCase.assertNotNull(typeAlias.parameters);
3407 JUnitTestCase.assertNotNull(typeAlias.returnType);
3408 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3409 JUnitTestCase.assertNull(typeAlias.typeParameters);
3410 }
3411 void test_parseTypeAlias_function_typeParameters() {
3412 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef bool F<E>();");
3413 JUnitTestCase.assertNotNull(typeAlias.keyword);
3414 JUnitTestCase.assertNotNull(typeAlias.name);
3415 JUnitTestCase.assertNotNull(typeAlias.parameters);
3416 JUnitTestCase.assertNotNull(typeAlias.returnType);
3417 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3418 JUnitTestCase.assertNotNull(typeAlias.typeParameters);
3419 }
3420 void test_parseTypeAlias_function_voidReturnType() {
3421 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef void F();");
3422 JUnitTestCase.assertNotNull(typeAlias.keyword);
3423 JUnitTestCase.assertNotNull(typeAlias.name);
3424 JUnitTestCase.assertNotNull(typeAlias.parameters);
3425 JUnitTestCase.assertNotNull(typeAlias.returnType);
3426 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3427 JUnitTestCase.assertNull(typeAlias.typeParameters);
3428 }
3429 void test_parseTypeArgumentList_multiple() {
3430 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int, int, int>", []);
3431 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3432 EngineTestCase.assertSize(3, argumentList.arguments);
3433 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3434 }
3435 void test_parseTypeArgumentList_nested() {
3436 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<A<B>>", []);
3437 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3438 EngineTestCase.assertSize(1, argumentList.arguments);
3439 TypeName argument = argumentList.arguments[0];
3440 JUnitTestCase.assertNotNull(argument);
3441 TypeArgumentList innerList = argument.typeArguments;
3442 JUnitTestCase.assertNotNull(innerList);
3443 EngineTestCase.assertSize(1, innerList.arguments);
3444 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3445 }
3446 void test_parseTypeArgumentList_single() {
3447 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int>", []);
3448 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3449 EngineTestCase.assertSize(1, argumentList.arguments);
3450 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3451 }
3452 void test_parseTypeName_parameterized() {
3453 TypeName typeName = ParserTestCase.parse5("parseTypeName", "List<int>", []);
3454 JUnitTestCase.assertNotNull(typeName.name);
3455 JUnitTestCase.assertNotNull(typeName.typeArguments);
3456 }
3457 void test_parseTypeName_simple() {
3458 TypeName typeName = ParserTestCase.parse5("parseTypeName", "int", []);
3459 JUnitTestCase.assertNotNull(typeName.name);
3460 JUnitTestCase.assertNull(typeName.typeArguments);
3461 }
3462 void test_parseTypeParameter_bounded() {
3463 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A ext ends B", []);
3464 JUnitTestCase.assertNotNull(parameter.bound);
3465 JUnitTestCase.assertNotNull(parameter.keyword);
3466 JUnitTestCase.assertNotNull(parameter.name);
3467 }
3468 void test_parseTypeParameter_simple() {
3469 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A", [ ]);
3470 JUnitTestCase.assertNull(parameter.bound);
3471 JUnitTestCase.assertNull(parameter.keyword);
3472 JUnitTestCase.assertNotNull(parameter.name);
3473 }
3474 void test_parseTypeParameterList_multiple() {
3475 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A, B extends C, D>", []);
3476 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3477 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3478 EngineTestCase.assertSize(3, parameterList.typeParameters);
3479 }
3480 void test_parseTypeParameterList_parameterizedWithTrailingEquals() {
3481 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A extends B<E>>=", []);
3482 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3483 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3484 EngineTestCase.assertSize(1, parameterList.typeParameters);
3485 }
3486 void test_parseTypeParameterList_single() {
3487 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>", []);
3488 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3489 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3490 EngineTestCase.assertSize(1, parameterList.typeParameters);
3491 }
3492 void test_parseTypeParameterList_withTrailingEquals() {
3493 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>=", []);
3494 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3495 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3496 EngineTestCase.assertSize(1, parameterList.typeParameters);
3497 }
3498 void test_parseUnaryExpression_decrement_normal() {
3499 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--x", []);
3500 JUnitTestCase.assertNotNull(expression.operator);
3501 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
3502 JUnitTestCase.assertNotNull(expression.operand);
3503 }
3504 void test_parseUnaryExpression_decrement_super() {
3505 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super", []);
3506 JUnitTestCase.assertNotNull(expression.operator);
3507 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3508 Expression innerExpression = expression.operand;
3509 JUnitTestCase.assertNotNull(innerExpression);
3510 JUnitTestCase.assertTrue(innerExpression is PrefixExpression);
3511 PrefixExpression operand = innerExpression as PrefixExpression;
3512 JUnitTestCase.assertNotNull(operand.operator);
3513 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type);
3514 JUnitTestCase.assertNotNull(operand.operand);
3515 }
3516 void test_parseUnaryExpression_decrement_super_propertyAccess() {
3517 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super.x", []);
3518 JUnitTestCase.assertNotNull(expression.operator);
3519 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
3520 JUnitTestCase.assertNotNull(expression.operand);
3521 PropertyAccess operand = expression.operand as PropertyAccess;
3522 JUnitTestCase.assertTrue(operand.target is SuperExpression);
3523 JUnitTestCase.assertEquals("x", operand.propertyName.name);
3524 }
3525 void test_parseUnaryExpression_increment_normal() {
3526 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++x", []);
3527 JUnitTestCase.assertNotNull(expression.operator);
3528 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3529 JUnitTestCase.assertNotNull(expression.operand);
3530 }
3531 void test_parseUnaryExpression_increment_super_index() {
3532 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super[0]", []);
3533 JUnitTestCase.assertNotNull(expression.operator);
3534 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3535 JUnitTestCase.assertNotNull(expression.operand);
3536 IndexExpression operand = expression.operand as IndexExpression;
3537 JUnitTestCase.assertTrue(operand.realTarget is SuperExpression);
3538 JUnitTestCase.assertTrue(operand.index is IntegerLiteral);
3539 }
3540 void test_parseUnaryExpression_increment_super_propertyAccess() {
3541 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super.x", []);
3542 JUnitTestCase.assertNotNull(expression.operator);
3543 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3544 JUnitTestCase.assertNotNull(expression.operand);
3545 PropertyAccess operand = expression.operand as PropertyAccess;
3546 JUnitTestCase.assertTrue(operand.target is SuperExpression);
3547 JUnitTestCase.assertEquals("x", operand.propertyName.name);
3548 }
3549 void test_parseUnaryExpression_minus_normal() {
3550 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-x", []);
3551 JUnitTestCase.assertNotNull(expression.operator);
3552 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3553 JUnitTestCase.assertNotNull(expression.operand);
3554 }
3555 void test_parseUnaryExpression_minus_super() {
3556 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-super", []);
3557 JUnitTestCase.assertNotNull(expression.operator);
3558 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3559 JUnitTestCase.assertNotNull(expression.operand);
3560 }
3561 void test_parseUnaryExpression_not_normal() {
3562 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!x", []);
3563 JUnitTestCase.assertNotNull(expression.operator);
3564 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
3565 JUnitTestCase.assertNotNull(expression.operand);
3566 }
3567 void test_parseUnaryExpression_not_super() {
3568 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!super", []);
3569 JUnitTestCase.assertNotNull(expression.operator);
3570 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
3571 JUnitTestCase.assertNotNull(expression.operand);
3572 }
3573 void test_parseUnaryExpression_tilda_normal() {
3574 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~x", []);
3575 JUnitTestCase.assertNotNull(expression.operator);
3576 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
3577 JUnitTestCase.assertNotNull(expression.operand);
3578 }
3579 void test_parseUnaryExpression_tilda_super() {
3580 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~super", []);
3581 JUnitTestCase.assertNotNull(expression.operator);
3582 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
3583 JUnitTestCase.assertNotNull(expression.operand);
3584 }
3585 void test_parseVariableDeclaration_equals() {
3586 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a = b", []);
3587 JUnitTestCase.assertNotNull(declaration.name);
3588 JUnitTestCase.assertNotNull(declaration.equals);
3589 JUnitTestCase.assertNotNull(declaration.initializer);
3590 }
3591 void test_parseVariableDeclaration_noEquals() {
3592 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a", []);
3593 JUnitTestCase.assertNotNull(declaration.name);
3594 JUnitTestCase.assertNull(declaration.equals);
3595 JUnitTestCase.assertNull(declaration.initializer);
3596 }
3597 void test_parseVariableDeclarationList_const_noType() {
3598 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const a");
3599 JUnitTestCase.assertNotNull(declarationList.keyword);
3600 JUnitTestCase.assertNull(declarationList.type);
3601 EngineTestCase.assertSize(1, declarationList.variables);
3602 }
3603 void test_parseVariableDeclarationList_const_type() {
3604 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const A a");
3605 JUnitTestCase.assertNotNull(declarationList.keyword);
3606 JUnitTestCase.assertNotNull(declarationList.type);
3607 EngineTestCase.assertSize(1, declarationList.variables);
3608 }
3609 void test_parseVariableDeclarationList_final_noType() {
3610 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "final a");
3611 JUnitTestCase.assertNotNull(declarationList.keyword);
3612 JUnitTestCase.assertNull(declarationList.type);
3613 EngineTestCase.assertSize(1, declarationList.variables);
3614 }
3615 void test_parseVariableDeclarationList_final_type() {
3616 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "final A a");
3617 JUnitTestCase.assertNotNull(declarationList.keyword);
3618 JUnitTestCase.assertNotNull(declarationList.type);
3619 EngineTestCase.assertSize(1, declarationList.variables);
3620 }
3621 void test_parseVariableDeclarationList_type_multiple() {
3622 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "A a, b, c");
3623 JUnitTestCase.assertNull(declarationList.keyword);
3624 JUnitTestCase.assertNotNull(declarationList.type);
3625 EngineTestCase.assertSize(3, declarationList.variables);
3626 }
3627 void test_parseVariableDeclarationList_type_single() {
3628 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "A a");
3629 JUnitTestCase.assertNull(declarationList.keyword);
3630 JUnitTestCase.assertNotNull(declarationList.type);
3631 EngineTestCase.assertSize(1, declarationList.variables);
3632 }
3633 void test_parseVariableDeclarationList_var_multiple() {
3634 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "var a, b, c");
3635 JUnitTestCase.assertNotNull(declarationList.keyword);
3636 JUnitTestCase.assertNull(declarationList.type);
3637 EngineTestCase.assertSize(3, declarationList.variables);
3638 }
3639 void test_parseVariableDeclarationList_var_single() {
3640 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "var a");
3641 JUnitTestCase.assertNotNull(declarationList.keyword);
3642 JUnitTestCase.assertNull(declarationList.type);
3643 EngineTestCase.assertSize(1, declarationList.variables);
3644 }
3645 void test_parseVariableDeclarationList2_type() {
3646 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null);
3647 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata(), null, type], "a");
3648 JUnitTestCase.assertNull(declarationList.keyword);
3649 JUnitTestCase.assertEquals(type, declarationList.type);
3650 EngineTestCase.assertSize(1, declarationList.variables);
3651 }
3652 void test_parseVariableDeclarationList2_var() {
3653 Token keyword = TokenFactory.token(Keyword.VAR);
3654 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata(), keyword, null], "a, b, c ");
3655 JUnitTestCase.assertEquals(keyword, declarationList.keyword);
3656 JUnitTestCase.assertNull(declarationList.type);
3657 EngineTestCase.assertSize(3, declarationList.variables);
3658 }
3659 void test_parseVariableDeclarationStatement_multiple() {
3660 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x, y, z;");
3661 JUnitTestCase.assertNotNull(statement.semicolon);
3662 VariableDeclarationList variableList = statement.variables;
3663 JUnitTestCase.assertNotNull(variableList);
3664 EngineTestCase.assertSize(3, variableList.variables);
3665 }
3666 void test_parseVariableDeclarationStatement_single() {
3667 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x;");
3668 JUnitTestCase.assertNotNull(statement.semicolon);
3669 VariableDeclarationList variableList = statement.variables;
3670 JUnitTestCase.assertNotNull(variableList);
3671 EngineTestCase.assertSize(1, variableList.variables);
3672 }
3673 void test_parseWhileStatement() {
3674 WhileStatement statement = ParserTestCase.parse5("parseWhileStatement", "whi le (x) {}", []);
3675 JUnitTestCase.assertNotNull(statement.keyword);
3676 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3677 JUnitTestCase.assertNotNull(statement.condition);
3678 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3679 JUnitTestCase.assertNotNull(statement.body);
3680 }
3681 void test_parseWithClause_multiple() {
3682 WithClause clause = ParserTestCase.parse5("parseWithClause", "with A, B, C", []);
3683 JUnitTestCase.assertNotNull(clause.withKeyword);
3684 EngineTestCase.assertSize(3, clause.mixinTypes);
3685 }
3686 void test_parseWithClause_single() {
3687 WithClause clause = ParserTestCase.parse5("parseWithClause", "with M", []);
3688 JUnitTestCase.assertNotNull(clause.withKeyword);
3689 EngineTestCase.assertSize(1, clause.mixinTypes);
3690 }
3691 void test_skipPrefixedIdentifier_invalid() {
3692 Token following = skip("skipPrefixedIdentifier", "+");
3693 JUnitTestCase.assertNull(following);
3694 }
3695 void test_skipPrefixedIdentifier_notPrefixed() {
3696 Token following = skip("skipPrefixedIdentifier", "a +");
3697 JUnitTestCase.assertNotNull(following);
3698 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3699 }
3700 void test_skipPrefixedIdentifier_prefixed() {
3701 Token following = skip("skipPrefixedIdentifier", "a.b +");
3702 JUnitTestCase.assertNotNull(following);
3703 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3704 }
3705 void test_skipReturnType_invalid() {
3706 Token following = skip("skipReturnType", "+");
3707 JUnitTestCase.assertNull(following);
3708 }
3709 void test_skipReturnType_type() {
3710 Token following = skip("skipReturnType", "C +");
3711 JUnitTestCase.assertNotNull(following);
3712 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3713 }
3714 void test_skipReturnType_void() {
3715 Token following = skip("skipReturnType", "void +");
3716 JUnitTestCase.assertNotNull(following);
3717 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3718 }
3719 void test_skipSimpleIdentifier_identifier() {
3720 Token following = skip("skipSimpleIdentifier", "i +");
3721 JUnitTestCase.assertNotNull(following);
3722 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3723 }
3724 void test_skipSimpleIdentifier_invalid() {
3725 Token following = skip("skipSimpleIdentifier", "9 +");
3726 JUnitTestCase.assertNull(following);
3727 }
3728 void test_skipSimpleIdentifier_pseudoKeyword() {
3729 Token following = skip("skipSimpleIdentifier", "as +");
3730 JUnitTestCase.assertNotNull(following);
3731 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3732 }
3733 void test_skipStringLiteral_adjacent() {
3734 Token following = skip("skipStringLiteral", "'a' 'b' +");
3735 JUnitTestCase.assertNotNull(following);
3736 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3737 }
3738 void test_skipStringLiteral_interpolated() {
3739 Token following = skip("skipStringLiteral", "'a\${b}c' +");
3740 JUnitTestCase.assertNotNull(following);
3741 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3742 }
3743 void test_skipStringLiteral_invalid() {
3744 Token following = skip("skipStringLiteral", "a");
3745 JUnitTestCase.assertNull(following);
3746 }
3747 void test_skipStringLiteral_single() {
3748 Token following = skip("skipStringLiteral", "'a' +");
3749 JUnitTestCase.assertNotNull(following);
3750 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3751 }
3752 void test_skipTypeArgumentList_invalid() {
3753 Token following = skip("skipTypeArgumentList", "+");
3754 JUnitTestCase.assertNull(following);
3755 }
3756 void test_skipTypeArgumentList_multiple() {
3757 Token following = skip("skipTypeArgumentList", "<E, F, G> +");
3758 JUnitTestCase.assertNotNull(following);
3759 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3760 }
3761 void test_skipTypeArgumentList_single() {
3762 Token following = skip("skipTypeArgumentList", "<E> +");
3763 JUnitTestCase.assertNotNull(following);
3764 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3765 }
3766 void test_skipTypeName_invalid() {
3767 Token following = skip("skipTypeName", "+");
3768 JUnitTestCase.assertNull(following);
3769 }
3770 void test_skipTypeName_parameterized() {
3771 Token following = skip("skipTypeName", "C<E<F<G>>> +");
3772 JUnitTestCase.assertNotNull(following);
3773 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3774 }
3775 void test_skipTypeName_simple() {
3776 Token following = skip("skipTypeName", "C +");
3777 JUnitTestCase.assertNotNull(following);
3778 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3779 }
3780
3781 /**
3782 * Invoke the method [Parser#computeStringValue] with the given argument.
3783 *
3784 * @param lexeme the argument to the method
3785 * @param first `true` if this is the first token in a string literal
3786 * @param last `true` if this is the last token in a string literal
3787 * @return the result of invoking the method
3788 * @throws Exception if the method could not be invoked or throws an exception
3789 */
3790 String computeStringValue(String lexeme, bool first, bool last) {
3791 AnalysisErrorListener listener = new AnalysisErrorListener_24();
3792 Parser parser = new Parser(null, listener);
3793 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme , first, last], null) as String;
3794 }
3795
3796 /**
3797 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
3798 * stream produced by scanning the given source.
3799 *
3800 * @param source the source to be scanned to produce the token stream being te sted
3801 * @return the result of invoking the method
3802 * @throws Exception if the method could not be invoked or throws an exception
3803 */
3804 SimpleIdentifier createSyntheticIdentifier() {
3805 GatheringErrorListener listener = new GatheringErrorListener();
3806 return ParserTestCase.invokeParserMethod2("createSyntheticIdentifier", "", l istener);
3807 }
3808
3809 /**
3810 * Invoke the method [Parser#createSyntheticIdentifier] with the parser set to the token
3811 * stream produced by scanning the given source.
3812 *
3813 * @param source the source to be scanned to produce the token stream being te sted
3814 * @return the result of invoking the method
3815 * @throws Exception if the method could not be invoked or throws an exception
3816 */
3817 SimpleStringLiteral createSyntheticStringLiteral() {
3818 GatheringErrorListener listener = new GatheringErrorListener();
3819 return ParserTestCase.invokeParserMethod2("createSyntheticStringLiteral", "" , listener);
3820 }
3821
3822 /**
3823 * Invoke the method [Parser#isFunctionDeclaration] with the parser set to the token
3824 * stream produced by scanning the given source.
3825 *
3826 * @param source the source to be scanned to produce the token stream being te sted
3827 * @return the result of invoking the method
3828 * @throws Exception if the method could not be invoked or throws an exception
3829 */
3830 bool isFunctionDeclaration(String source) {
3831 GatheringErrorListener listener = new GatheringErrorListener();
3832 return ParserTestCase.invokeParserMethod2("isFunctionDeclaration", source, l istener) as bool;
3833 }
3834
3835 /**
3836 * Invoke the method [Parser#isFunctionExpression] with the parser set to the token stream
3837 * produced by scanning the given source.
3838 *
3839 * @param source the source to be scanned to produce the token stream being te sted
3840 * @return the result of invoking the method
3841 * @throws Exception if the method could not be invoked or throws an exception
3842 */
3843 bool isFunctionExpression(String source) {
3844 GatheringErrorListener listener = new GatheringErrorListener();
3845 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
3846 Token tokenStream = scanner.tokenize();
3847 Parser parser = new Parser(null, listener);
3848 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke nStream], tokenStream) as bool;
3849 }
3850
3851 /**
3852 * Invoke the method [Parser#isInitializedVariableDeclaration] with the parser set to the
3853 * token stream produced by scanning the given source.
3854 *
3855 * @param source the source to be scanned to produce the token stream being te sted
3856 * @return the result of invoking the method
3857 * @throws Exception if the method could not be invoked or throws an exception
3858 */
3859 bool isInitializedVariableDeclaration(String source) {
3860 GatheringErrorListener listener = new GatheringErrorListener();
3861 return ParserTestCase.invokeParserMethod2("isInitializedVariableDeclaration" , source, listener) as bool;
3862 }
3863
3864 /**
3865 * Invoke the method [Parser#isSwitchMember] with the parser set to the token stream
3866 * produced by scanning the given source.
3867 *
3868 * @param source the source to be scanned to produce the token stream being te sted
3869 * @return the result of invoking the method
3870 * @throws Exception if the method could not be invoked or throws an exception
3871 */
3872 bool isSwitchMember(String source) {
3873 GatheringErrorListener listener = new GatheringErrorListener();
3874 return ParserTestCase.invokeParserMethod2("isSwitchMember", source, listener ) as bool;
3875 }
3876
3877 /**
3878 * Invoke a "skip" method in [Parser]. The method is assumed to take a token a s it's
3879 * parameter and is given the first token in the scanned source.
3880 *
3881 * @param methodName the name of the method that should be invoked
3882 * @param source the source to be processed by the method
3883 * @return the result of invoking the method
3884 * @throws Exception if the method could not be invoked or throws an exception
3885 * @throws AssertionFailedError if the result is `null`
3886 */
3887 Token skip(String methodName, String source) {
3888 GatheringErrorListener listener = new GatheringErrorListener();
3889 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
3890 Token tokenStream = scanner.tokenize();
3891 Parser parser = new Parser(null, listener);
3892 return invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], to kenStream) as Token;
3893 }
3894 static dartSuite() {
3895 _ut.group('SimpleParserTest', () {
3896 _ut.test('test_Parser', () {
3897 final __test = new SimpleParserTest();
3898 runJUnitTest(__test, __test.test_Parser);
3899 });
3900 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () {
3901 final __test = new SimpleParserTest();
3902 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr efix);
3903 });
3904 _ut.test('test_computeStringValue_escape_b', () {
3905 final __test = new SimpleParserTest();
3906 runJUnitTest(__test, __test.test_computeStringValue_escape_b);
3907 });
3908 _ut.test('test_computeStringValue_escape_f', () {
3909 final __test = new SimpleParserTest();
3910 runJUnitTest(__test, __test.test_computeStringValue_escape_f);
3911 });
3912 _ut.test('test_computeStringValue_escape_n', () {
3913 final __test = new SimpleParserTest();
3914 runJUnitTest(__test, __test.test_computeStringValue_escape_n);
3915 });
3916 _ut.test('test_computeStringValue_escape_notSpecial', () {
3917 final __test = new SimpleParserTest();
3918 runJUnitTest(__test, __test.test_computeStringValue_escape_notSpecial);
3919 });
3920 _ut.test('test_computeStringValue_escape_r', () {
3921 final __test = new SimpleParserTest();
3922 runJUnitTest(__test, __test.test_computeStringValue_escape_r);
3923 });
3924 _ut.test('test_computeStringValue_escape_t', () {
3925 final __test = new SimpleParserTest();
3926 runJUnitTest(__test, __test.test_computeStringValue_escape_t);
3927 });
3928 _ut.test('test_computeStringValue_escape_u_fixed', () {
3929 final __test = new SimpleParserTest();
3930 runJUnitTest(__test, __test.test_computeStringValue_escape_u_fixed);
3931 });
3932 _ut.test('test_computeStringValue_escape_u_variable', () {
3933 final __test = new SimpleParserTest();
3934 runJUnitTest(__test, __test.test_computeStringValue_escape_u_variable);
3935 });
3936 _ut.test('test_computeStringValue_escape_v', () {
3937 final __test = new SimpleParserTest();
3938 runJUnitTest(__test, __test.test_computeStringValue_escape_v);
3939 });
3940 _ut.test('test_computeStringValue_escape_x', () {
3941 final __test = new SimpleParserTest();
3942 runJUnitTest(__test, __test.test_computeStringValue_escape_x);
3943 });
3944 _ut.test('test_computeStringValue_noEscape_single', () {
3945 final __test = new SimpleParserTest();
3946 runJUnitTest(__test, __test.test_computeStringValue_noEscape_single);
3947 });
3948 _ut.test('test_computeStringValue_noEscape_triple', () {
3949 final __test = new SimpleParserTest();
3950 runJUnitTest(__test, __test.test_computeStringValue_noEscape_triple);
3951 });
3952 _ut.test('test_computeStringValue_raw_single', () {
3953 final __test = new SimpleParserTest();
3954 runJUnitTest(__test, __test.test_computeStringValue_raw_single);
3955 });
3956 _ut.test('test_computeStringValue_raw_triple', () {
3957 final __test = new SimpleParserTest();
3958 runJUnitTest(__test, __test.test_computeStringValue_raw_triple);
3959 });
3960 _ut.test('test_computeStringValue_raw_withEscape', () {
3961 final __test = new SimpleParserTest();
3962 runJUnitTest(__test, __test.test_computeStringValue_raw_withEscape);
3963 });
3964 _ut.test('test_computeStringValue_triple_internalQuote_first_empty', () {
3965 final __test = new SimpleParserTest();
3966 runJUnitTest(__test, __test.test_computeStringValue_triple_internalQuote _first_empty);
3967 });
3968 _ut.test('test_computeStringValue_triple_internalQuote_first_nonEmpty', () {
3969 final __test = new SimpleParserTest();
3970 runJUnitTest(__test, __test.test_computeStringValue_triple_internalQuote _first_nonEmpty);
3971 });
3972 _ut.test('test_computeStringValue_triple_internalQuote_last_empty', () {
3973 final __test = new SimpleParserTest();
3974 runJUnitTest(__test, __test.test_computeStringValue_triple_internalQuote _last_empty);
3975 });
3976 _ut.test('test_computeStringValue_triple_internalQuote_last_nonEmpty', () {
3977 final __test = new SimpleParserTest();
3978 runJUnitTest(__test, __test.test_computeStringValue_triple_internalQuote _last_nonEmpty);
3979 });
3980 _ut.test('test_constFactory', () {
3981 final __test = new SimpleParserTest();
3982 runJUnitTest(__test, __test.test_constFactory);
3983 });
3984 _ut.test('test_createSyntheticIdentifier', () {
3985 final __test = new SimpleParserTest();
3986 runJUnitTest(__test, __test.test_createSyntheticIdentifier);
3987 });
3988 _ut.test('test_createSyntheticStringLiteral', () {
3989 final __test = new SimpleParserTest();
3990 runJUnitTest(__test, __test.test_createSyntheticStringLiteral);
3991 });
3992 _ut.test('test_isFunctionDeclaration_nameButNoReturn_block', () {
3993 final __test = new SimpleParserTest();
3994 runJUnitTest(__test, __test.test_isFunctionDeclaration_nameButNoReturn_b lock);
3995 });
3996 _ut.test('test_isFunctionDeclaration_nameButNoReturn_expression', () {
3997 final __test = new SimpleParserTest();
3998 runJUnitTest(__test, __test.test_isFunctionDeclaration_nameButNoReturn_e xpression);
3999 });
4000 _ut.test('test_isFunctionDeclaration_normalReturn_block', () {
4001 final __test = new SimpleParserTest();
4002 runJUnitTest(__test, __test.test_isFunctionDeclaration_normalReturn_bloc k);
4003 });
4004 _ut.test('test_isFunctionDeclaration_normalReturn_expression', () {
4005 final __test = new SimpleParserTest();
4006 runJUnitTest(__test, __test.test_isFunctionDeclaration_normalReturn_expr ession);
4007 });
4008 _ut.test('test_isFunctionDeclaration_voidReturn_block', () {
4009 final __test = new SimpleParserTest();
4010 runJUnitTest(__test, __test.test_isFunctionDeclaration_voidReturn_block) ;
4011 });
4012 _ut.test('test_isFunctionDeclaration_voidReturn_expression', () {
4013 final __test = new SimpleParserTest();
4014 runJUnitTest(__test, __test.test_isFunctionDeclaration_voidReturn_expres sion);
4015 });
4016 _ut.test('test_isFunctionExpression_false_noBody', () {
4017 final __test = new SimpleParserTest();
4018 runJUnitTest(__test, __test.test_isFunctionExpression_false_noBody);
4019 });
4020 _ut.test('test_isFunctionExpression_false_notParameters', () {
4021 final __test = new SimpleParserTest();
4022 runJUnitTest(__test, __test.test_isFunctionExpression_false_notParameter s);
4023 });
4024 _ut.test('test_isFunctionExpression_noName_block', () {
4025 final __test = new SimpleParserTest();
4026 runJUnitTest(__test, __test.test_isFunctionExpression_noName_block);
4027 });
4028 _ut.test('test_isFunctionExpression_noName_expression', () {
4029 final __test = new SimpleParserTest();
4030 runJUnitTest(__test, __test.test_isFunctionExpression_noName_expression) ;
4031 });
4032 _ut.test('test_isFunctionExpression_parameter_multiple', () {
4033 final __test = new SimpleParserTest();
4034 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_multiple );
4035 });
4036 _ut.test('test_isFunctionExpression_parameter_named', () {
4037 final __test = new SimpleParserTest();
4038 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_named);
4039 });
4040 _ut.test('test_isFunctionExpression_parameter_optional', () {
4041 final __test = new SimpleParserTest();
4042 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_optional );
4043 });
4044 _ut.test('test_isFunctionExpression_parameter_single', () {
4045 final __test = new SimpleParserTest();
4046 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_single);
4047 });
4048 _ut.test('test_isFunctionExpression_parameter_typed', () {
4049 final __test = new SimpleParserTest();
4050 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_typed);
4051 });
4052 _ut.test('test_isInitializedVariableDeclaration_assignment', () {
4053 final __test = new SimpleParserTest();
4054 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_assign ment);
4055 });
4056 _ut.test('test_isInitializedVariableDeclaration_comparison', () {
4057 final __test = new SimpleParserTest();
4058 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_compar ison);
4059 });
4060 _ut.test('test_isInitializedVariableDeclaration_conditional', () {
4061 final __test = new SimpleParserTest();
4062 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_condit ional);
4063 });
4064 _ut.test('test_isInitializedVariableDeclaration_const_noType_initialized', () {
4065 final __test = new SimpleParserTest();
4066 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_ noType_initialized);
4067 });
4068 _ut.test('test_isInitializedVariableDeclaration_const_noType_uninitialized ', () {
4069 final __test = new SimpleParserTest();
4070 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_ noType_uninitialized);
4071 });
4072 _ut.test('test_isInitializedVariableDeclaration_const_simpleType_uninitial ized', () {
4073 final __test = new SimpleParserTest();
4074 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_ simpleType_uninitialized);
4075 });
4076 _ut.test('test_isInitializedVariableDeclaration_final_noType_initialized', () {
4077 final __test = new SimpleParserTest();
4078 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_ noType_initialized);
4079 });
4080 _ut.test('test_isInitializedVariableDeclaration_final_noType_uninitialized ', () {
4081 final __test = new SimpleParserTest();
4082 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_ noType_uninitialized);
4083 });
4084 _ut.test('test_isInitializedVariableDeclaration_final_simpleType_initializ ed', () {
4085 final __test = new SimpleParserTest();
4086 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_ simpleType_initialized);
4087 });
4088 _ut.test('test_isInitializedVariableDeclaration_functionDeclaration_typed' , () {
4089 final __test = new SimpleParserTest();
4090 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_functi onDeclaration_typed);
4091 });
4092 _ut.test('test_isInitializedVariableDeclaration_functionDeclaration_untype d', () {
4093 final __test = new SimpleParserTest();
4094 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_functi onDeclaration_untyped);
4095 });
4096 _ut.test('test_isInitializedVariableDeclaration_noType_initialized', () {
4097 final __test = new SimpleParserTest();
4098 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_noType _initialized);
4099 });
4100 _ut.test('test_isInitializedVariableDeclaration_noType_uninitialized', () {
4101 final __test = new SimpleParserTest();
4102 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_noType _uninitialized);
4103 });
4104 _ut.test('test_isInitializedVariableDeclaration_parameterizedType_initiali zed', () {
4105 final __test = new SimpleParserTest();
4106 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_parame terizedType_initialized);
4107 });
4108 _ut.test('test_isInitializedVariableDeclaration_parameterizedType_uninitia lized', () {
4109 final __test = new SimpleParserTest();
4110 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_parame terizedType_uninitialized);
4111 });
4112 _ut.test('test_isInitializedVariableDeclaration_simpleType_initialized', ( ) {
4113 final __test = new SimpleParserTest();
4114 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_simple Type_initialized);
4115 });
4116 _ut.test('test_isInitializedVariableDeclaration_simpleType_uninitialized', () {
4117 final __test = new SimpleParserTest();
4118 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_simple Type_uninitialized);
4119 });
4120 _ut.test('test_isSwitchMember_case_labeled', () {
4121 final __test = new SimpleParserTest();
4122 runJUnitTest(__test, __test.test_isSwitchMember_case_labeled);
4123 });
4124 _ut.test('test_isSwitchMember_case_unlabeled', () {
4125 final __test = new SimpleParserTest();
4126 runJUnitTest(__test, __test.test_isSwitchMember_case_unlabeled);
4127 });
4128 _ut.test('test_isSwitchMember_default_labeled', () {
4129 final __test = new SimpleParserTest();
4130 runJUnitTest(__test, __test.test_isSwitchMember_default_labeled);
4131 });
4132 _ut.test('test_isSwitchMember_default_unlabeled', () {
4133 final __test = new SimpleParserTest();
4134 runJUnitTest(__test, __test.test_isSwitchMember_default_unlabeled);
4135 });
4136 _ut.test('test_isSwitchMember_false', () {
4137 final __test = new SimpleParserTest();
4138 runJUnitTest(__test, __test.test_isSwitchMember_false);
4139 });
4140 _ut.test('test_parseAdditiveExpression_normal', () {
4141 final __test = new SimpleParserTest();
4142 runJUnitTest(__test, __test.test_parseAdditiveExpression_normal);
4143 });
4144 _ut.test('test_parseAdditiveExpression_super', () {
4145 final __test = new SimpleParserTest();
4146 runJUnitTest(__test, __test.test_parseAdditiveExpression_super);
4147 });
4148 _ut.test('test_parseAnnotation_n1', () {
4149 final __test = new SimpleParserTest();
4150 runJUnitTest(__test, __test.test_parseAnnotation_n1);
4151 });
4152 _ut.test('test_parseAnnotation_n1_a', () {
4153 final __test = new SimpleParserTest();
4154 runJUnitTest(__test, __test.test_parseAnnotation_n1_a);
4155 });
4156 _ut.test('test_parseAnnotation_n2', () {
4157 final __test = new SimpleParserTest();
4158 runJUnitTest(__test, __test.test_parseAnnotation_n2);
4159 });
4160 _ut.test('test_parseAnnotation_n2_a', () {
4161 final __test = new SimpleParserTest();
4162 runJUnitTest(__test, __test.test_parseAnnotation_n2_a);
4163 });
4164 _ut.test('test_parseAnnotation_n3', () {
4165 final __test = new SimpleParserTest();
4166 runJUnitTest(__test, __test.test_parseAnnotation_n3);
4167 });
4168 _ut.test('test_parseAnnotation_n3_a', () {
4169 final __test = new SimpleParserTest();
4170 runJUnitTest(__test, __test.test_parseAnnotation_n3_a);
4171 });
4172 _ut.test('test_parseArgumentDefinitionTest', () {
4173 final __test = new SimpleParserTest();
4174 runJUnitTest(__test, __test.test_parseArgumentDefinitionTest);
4175 });
4176 _ut.test('test_parseArgumentList_empty', () {
4177 final __test = new SimpleParserTest();
4178 runJUnitTest(__test, __test.test_parseArgumentList_empty);
4179 });
4180 _ut.test('test_parseArgumentList_mixed', () {
4181 final __test = new SimpleParserTest();
4182 runJUnitTest(__test, __test.test_parseArgumentList_mixed);
4183 });
4184 _ut.test('test_parseArgumentList_noNamed', () {
4185 final __test = new SimpleParserTest();
4186 runJUnitTest(__test, __test.test_parseArgumentList_noNamed);
4187 });
4188 _ut.test('test_parseArgumentList_onlyNamed', () {
4189 final __test = new SimpleParserTest();
4190 runJUnitTest(__test, __test.test_parseArgumentList_onlyNamed);
4191 });
4192 _ut.test('test_parseArgument_named', () {
4193 final __test = new SimpleParserTest();
4194 runJUnitTest(__test, __test.test_parseArgument_named);
4195 });
4196 _ut.test('test_parseArgument_unnamed', () {
4197 final __test = new SimpleParserTest();
4198 runJUnitTest(__test, __test.test_parseArgument_unnamed);
4199 });
4200 _ut.test('test_parseAssertStatement', () {
4201 final __test = new SimpleParserTest();
4202 runJUnitTest(__test, __test.test_parseAssertStatement);
4203 });
4204 _ut.test('test_parseAssignableExpression_expression_args_dot', () {
4205 final __test = new SimpleParserTest();
4206 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_ar gs_dot);
4207 });
4208 _ut.test('test_parseAssignableExpression_expression_dot', () {
4209 final __test = new SimpleParserTest();
4210 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_do t);
4211 });
4212 _ut.test('test_parseAssignableExpression_expression_index', () {
4213 final __test = new SimpleParserTest();
4214 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_in dex);
4215 });
4216 _ut.test('test_parseAssignableExpression_identifier', () {
4217 final __test = new SimpleParserTest();
4218 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier);
4219 });
4220 _ut.test('test_parseAssignableExpression_identifier_args_dot', () {
4221 final __test = new SimpleParserTest();
4222 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_ar gs_dot);
4223 });
4224 _ut.test('test_parseAssignableExpression_identifier_dot', () {
4225 final __test = new SimpleParserTest();
4226 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_do t);
4227 });
4228 _ut.test('test_parseAssignableExpression_identifier_index', () {
4229 final __test = new SimpleParserTest();
4230 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_in dex);
4231 });
4232 _ut.test('test_parseAssignableExpression_super_dot', () {
4233 final __test = new SimpleParserTest();
4234 runJUnitTest(__test, __test.test_parseAssignableExpression_super_dot);
4235 });
4236 _ut.test('test_parseAssignableExpression_super_index', () {
4237 final __test = new SimpleParserTest();
4238 runJUnitTest(__test, __test.test_parseAssignableExpression_super_index);
4239 });
4240 _ut.test('test_parseAssignableSelector_dot', () {
4241 final __test = new SimpleParserTest();
4242 runJUnitTest(__test, __test.test_parseAssignableSelector_dot);
4243 });
4244 _ut.test('test_parseAssignableSelector_index', () {
4245 final __test = new SimpleParserTest();
4246 runJUnitTest(__test, __test.test_parseAssignableSelector_index);
4247 });
4248 _ut.test('test_parseAssignableSelector_none', () {
4249 final __test = new SimpleParserTest();
4250 runJUnitTest(__test, __test.test_parseAssignableSelector_none);
4251 });
4252 _ut.test('test_parseBitwiseAndExpression_normal', () {
4253 final __test = new SimpleParserTest();
4254 runJUnitTest(__test, __test.test_parseBitwiseAndExpression_normal);
4255 });
4256 _ut.test('test_parseBitwiseAndExpression_super', () {
4257 final __test = new SimpleParserTest();
4258 runJUnitTest(__test, __test.test_parseBitwiseAndExpression_super);
4259 });
4260 _ut.test('test_parseBitwiseOrExpression_normal', () {
4261 final __test = new SimpleParserTest();
4262 runJUnitTest(__test, __test.test_parseBitwiseOrExpression_normal);
4263 });
4264 _ut.test('test_parseBitwiseOrExpression_super', () {
4265 final __test = new SimpleParserTest();
4266 runJUnitTest(__test, __test.test_parseBitwiseOrExpression_super);
4267 });
4268 _ut.test('test_parseBitwiseXorExpression_normal', () {
4269 final __test = new SimpleParserTest();
4270 runJUnitTest(__test, __test.test_parseBitwiseXorExpression_normal);
4271 });
4272 _ut.test('test_parseBitwiseXorExpression_super', () {
4273 final __test = new SimpleParserTest();
4274 runJUnitTest(__test, __test.test_parseBitwiseXorExpression_super);
4275 });
4276 _ut.test('test_parseBlock_empty', () {
4277 final __test = new SimpleParserTest();
4278 runJUnitTest(__test, __test.test_parseBlock_empty);
4279 });
4280 _ut.test('test_parseBlock_nonEmpty', () {
4281 final __test = new SimpleParserTest();
4282 runJUnitTest(__test, __test.test_parseBlock_nonEmpty);
4283 });
4284 _ut.test('test_parseBreakStatement_label', () {
4285 final __test = new SimpleParserTest();
4286 runJUnitTest(__test, __test.test_parseBreakStatement_label);
4287 });
4288 _ut.test('test_parseBreakStatement_noLabel', () {
4289 final __test = new SimpleParserTest();
4290 runJUnitTest(__test, __test.test_parseBreakStatement_noLabel);
4291 });
4292 _ut.test('test_parseCascadeSection_i', () {
4293 final __test = new SimpleParserTest();
4294 runJUnitTest(__test, __test.test_parseCascadeSection_i);
4295 });
4296 _ut.test('test_parseCascadeSection_ia', () {
4297 final __test = new SimpleParserTest();
4298 runJUnitTest(__test, __test.test_parseCascadeSection_ia);
4299 });
4300 _ut.test('test_parseCascadeSection_p', () {
4301 final __test = new SimpleParserTest();
4302 runJUnitTest(__test, __test.test_parseCascadeSection_p);
4303 });
4304 _ut.test('test_parseCascadeSection_p_assign', () {
4305 final __test = new SimpleParserTest();
4306 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign);
4307 });
4308 _ut.test('test_parseCascadeSection_p_assign_withCascade', () {
4309 final __test = new SimpleParserTest();
4310 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign_withCascad e);
4311 });
4312 _ut.test('test_parseCascadeSection_p_builtIn', () {
4313 final __test = new SimpleParserTest();
4314 runJUnitTest(__test, __test.test_parseCascadeSection_p_builtIn);
4315 });
4316 _ut.test('test_parseCascadeSection_pa', () {
4317 final __test = new SimpleParserTest();
4318 runJUnitTest(__test, __test.test_parseCascadeSection_pa);
4319 });
4320 _ut.test('test_parseCascadeSection_paa', () {
4321 final __test = new SimpleParserTest();
4322 runJUnitTest(__test, __test.test_parseCascadeSection_paa);
4323 });
4324 _ut.test('test_parseCascadeSection_paapaa', () {
4325 final __test = new SimpleParserTest();
4326 runJUnitTest(__test, __test.test_parseCascadeSection_paapaa);
4327 });
4328 _ut.test('test_parseCascadeSection_pap', () {
4329 final __test = new SimpleParserTest();
4330 runJUnitTest(__test, __test.test_parseCascadeSection_pap);
4331 });
4332 _ut.test('test_parseClassDeclaration_abstract', () {
4333 final __test = new SimpleParserTest();
4334 runJUnitTest(__test, __test.test_parseClassDeclaration_abstract);
4335 });
4336 _ut.test('test_parseClassDeclaration_empty', () {
4337 final __test = new SimpleParserTest();
4338 runJUnitTest(__test, __test.test_parseClassDeclaration_empty);
4339 });
4340 _ut.test('test_parseClassDeclaration_extends', () {
4341 final __test = new SimpleParserTest();
4342 runJUnitTest(__test, __test.test_parseClassDeclaration_extends);
4343 });
4344 _ut.test('test_parseClassDeclaration_extendsAndImplements', () {
4345 final __test = new SimpleParserTest();
4346 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndImpleme nts);
4347 });
4348 _ut.test('test_parseClassDeclaration_extendsAndWith', () {
4349 final __test = new SimpleParserTest();
4350 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndWith);
4351 });
4352 _ut.test('test_parseClassDeclaration_extendsAndWithAndImplements', () {
4353 final __test = new SimpleParserTest();
4354 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndWithAnd Implements);
4355 });
4356 _ut.test('test_parseClassDeclaration_implements', () {
4357 final __test = new SimpleParserTest();
4358 runJUnitTest(__test, __test.test_parseClassDeclaration_implements);
4359 });
4360 _ut.test('test_parseClassDeclaration_native', () {
4361 final __test = new SimpleParserTest();
4362 runJUnitTest(__test, __test.test_parseClassDeclaration_native);
4363 });
4364 _ut.test('test_parseClassDeclaration_nonEmpty', () {
4365 final __test = new SimpleParserTest();
4366 runJUnitTest(__test, __test.test_parseClassDeclaration_nonEmpty);
4367 });
4368 _ut.test('test_parseClassDeclaration_typeAlias_implementsC', () {
4369 final __test = new SimpleParserTest();
4370 runJUnitTest(__test, __test.test_parseClassDeclaration_typeAlias_impleme ntsC);
4371 });
4372 _ut.test('test_parseClassDeclaration_typeAlias_withB', () {
4373 final __test = new SimpleParserTest();
4374 runJUnitTest(__test, __test.test_parseClassDeclaration_typeAlias_withB);
4375 });
4376 _ut.test('test_parseClassDeclaration_typeParameters', () {
4377 final __test = new SimpleParserTest();
4378 runJUnitTest(__test, __test.test_parseClassDeclaration_typeParameters);
4379 });
4380 _ut.test('test_parseClassMember_constructor_withInitializers', () {
4381 final __test = new SimpleParserTest();
4382 runJUnitTest(__test, __test.test_parseClassMember_constructor_withInitia lizers);
4383 });
4384 _ut.test('test_parseClassMember_field_instance_prefixedType', () {
4385 final __test = new SimpleParserTest();
4386 runJUnitTest(__test, __test.test_parseClassMember_field_instance_prefixe dType);
4387 });
4388 _ut.test('test_parseClassMember_field_namedGet', () {
4389 final __test = new SimpleParserTest();
4390 runJUnitTest(__test, __test.test_parseClassMember_field_namedGet);
4391 });
4392 _ut.test('test_parseClassMember_field_namedOperator', () {
4393 final __test = new SimpleParserTest();
4394 runJUnitTest(__test, __test.test_parseClassMember_field_namedOperator);
4395 });
4396 _ut.test('test_parseClassMember_field_namedSet', () {
4397 final __test = new SimpleParserTest();
4398 runJUnitTest(__test, __test.test_parseClassMember_field_namedSet);
4399 });
4400 _ut.test('test_parseClassMember_getter_void', () {
4401 final __test = new SimpleParserTest();
4402 runJUnitTest(__test, __test.test_parseClassMember_getter_void);
4403 });
4404 _ut.test('test_parseClassMember_method_external', () {
4405 final __test = new SimpleParserTest();
4406 runJUnitTest(__test, __test.test_parseClassMember_method_external);
4407 });
4408 _ut.test('test_parseClassMember_method_external_withTypeAndArgs', () {
4409 final __test = new SimpleParserTest();
4410 runJUnitTest(__test, __test.test_parseClassMember_method_external_withTy peAndArgs);
4411 });
4412 _ut.test('test_parseClassMember_method_get_noType', () {
4413 final __test = new SimpleParserTest();
4414 runJUnitTest(__test, __test.test_parseClassMember_method_get_noType);
4415 });
4416 _ut.test('test_parseClassMember_method_get_type', () {
4417 final __test = new SimpleParserTest();
4418 runJUnitTest(__test, __test.test_parseClassMember_method_get_type);
4419 });
4420 _ut.test('test_parseClassMember_method_get_void', () {
4421 final __test = new SimpleParserTest();
4422 runJUnitTest(__test, __test.test_parseClassMember_method_get_void);
4423 });
4424 _ut.test('test_parseClassMember_method_operator_noType', () {
4425 final __test = new SimpleParserTest();
4426 runJUnitTest(__test, __test.test_parseClassMember_method_operator_noType );
4427 });
4428 _ut.test('test_parseClassMember_method_operator_type', () {
4429 final __test = new SimpleParserTest();
4430 runJUnitTest(__test, __test.test_parseClassMember_method_operator_type);
4431 });
4432 _ut.test('test_parseClassMember_method_operator_void', () {
4433 final __test = new SimpleParserTest();
4434 runJUnitTest(__test, __test.test_parseClassMember_method_operator_void);
4435 });
4436 _ut.test('test_parseClassMember_method_returnType_parameterized', () {
4437 final __test = new SimpleParserTest();
4438 runJUnitTest(__test, __test.test_parseClassMember_method_returnType_para meterized);
4439 });
4440 _ut.test('test_parseClassMember_method_set_noType', () {
4441 final __test = new SimpleParserTest();
4442 runJUnitTest(__test, __test.test_parseClassMember_method_set_noType);
4443 });
4444 _ut.test('test_parseClassMember_method_set_type', () {
4445 final __test = new SimpleParserTest();
4446 runJUnitTest(__test, __test.test_parseClassMember_method_set_type);
4447 });
4448 _ut.test('test_parseClassMember_method_set_void', () {
4449 final __test = new SimpleParserTest();
4450 runJUnitTest(__test, __test.test_parseClassMember_method_set_void);
4451 });
4452 _ut.test('test_parseClassMember_operator_index', () {
4453 final __test = new SimpleParserTest();
4454 runJUnitTest(__test, __test.test_parseClassMember_operator_index);
4455 });
4456 _ut.test('test_parseClassMember_operator_indexAssign', () {
4457 final __test = new SimpleParserTest();
4458 runJUnitTest(__test, __test.test_parseClassMember_operator_indexAssign);
4459 });
4460 _ut.test('test_parseClassMember_redirectingFactory_const', () {
4461 final __test = new SimpleParserTest();
4462 runJUnitTest(__test, __test.test_parseClassMember_redirectingFactory_con st);
4463 });
4464 _ut.test('test_parseClassMember_redirectingFactory_nonConst', () {
4465 final __test = new SimpleParserTest();
4466 runJUnitTest(__test, __test.test_parseClassMember_redirectingFactory_non Const);
4467 });
4468 _ut.test('test_parseClassTypeAlias', () {
4469 final __test = new SimpleParserTest();
4470 runJUnitTest(__test, __test.test_parseClassTypeAlias);
4471 });
4472 _ut.test('test_parseClassTypeAlias_abstract', () {
4473 final __test = new SimpleParserTest();
4474 runJUnitTest(__test, __test.test_parseClassTypeAlias_abstract);
4475 });
4476 _ut.test('test_parseClassTypeAlias_implements', () {
4477 final __test = new SimpleParserTest();
4478 runJUnitTest(__test, __test.test_parseClassTypeAlias_implements);
4479 });
4480 _ut.test('test_parseClassTypeAlias_with', () {
4481 final __test = new SimpleParserTest();
4482 runJUnitTest(__test, __test.test_parseClassTypeAlias_with);
4483 });
4484 _ut.test('test_parseClassTypeAlias_with_implements', () {
4485 final __test = new SimpleParserTest();
4486 runJUnitTest(__test, __test.test_parseClassTypeAlias_with_implements);
4487 });
4488 _ut.test('test_parseCombinators_h', () {
4489 final __test = new SimpleParserTest();
4490 runJUnitTest(__test, __test.test_parseCombinators_h);
4491 });
4492 _ut.test('test_parseCombinators_hs', () {
4493 final __test = new SimpleParserTest();
4494 runJUnitTest(__test, __test.test_parseCombinators_hs);
4495 });
4496 _ut.test('test_parseCombinators_hshs', () {
4497 final __test = new SimpleParserTest();
4498 runJUnitTest(__test, __test.test_parseCombinators_hshs);
4499 });
4500 _ut.test('test_parseCombinators_s', () {
4501 final __test = new SimpleParserTest();
4502 runJUnitTest(__test, __test.test_parseCombinators_s);
4503 });
4504 _ut.test('test_parseCommentAndMetadata_c', () {
4505 final __test = new SimpleParserTest();
4506 runJUnitTest(__test, __test.test_parseCommentAndMetadata_c);
4507 });
4508 _ut.test('test_parseCommentAndMetadata_cmc', () {
4509 final __test = new SimpleParserTest();
4510 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmc);
4511 });
4512 _ut.test('test_parseCommentAndMetadata_cmcm', () {
4513 final __test = new SimpleParserTest();
4514 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmcm);
4515 });
4516 _ut.test('test_parseCommentAndMetadata_cmm', () {
4517 final __test = new SimpleParserTest();
4518 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmm);
4519 });
4520 _ut.test('test_parseCommentAndMetadata_m', () {
4521 final __test = new SimpleParserTest();
4522 runJUnitTest(__test, __test.test_parseCommentAndMetadata_m);
4523 });
4524 _ut.test('test_parseCommentAndMetadata_mcm', () {
4525 final __test = new SimpleParserTest();
4526 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mcm);
4527 });
4528 _ut.test('test_parseCommentAndMetadata_mcmc', () {
4529 final __test = new SimpleParserTest();
4530 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mcmc);
4531 });
4532 _ut.test('test_parseCommentAndMetadata_mm', () {
4533 final __test = new SimpleParserTest();
4534 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mm);
4535 });
4536 _ut.test('test_parseCommentAndMetadata_none', () {
4537 final __test = new SimpleParserTest();
4538 runJUnitTest(__test, __test.test_parseCommentAndMetadata_none);
4539 });
4540 _ut.test('test_parseCommentAndMetadata_singleLine', () {
4541 final __test = new SimpleParserTest();
4542 runJUnitTest(__test, __test.test_parseCommentAndMetadata_singleLine);
4543 });
4544 _ut.test('test_parseCommentReference_new_prefixed', () {
4545 final __test = new SimpleParserTest();
4546 runJUnitTest(__test, __test.test_parseCommentReference_new_prefixed);
4547 });
4548 _ut.test('test_parseCommentReference_new_simple', () {
4549 final __test = new SimpleParserTest();
4550 runJUnitTest(__test, __test.test_parseCommentReference_new_simple);
4551 });
4552 _ut.test('test_parseCommentReference_prefixed', () {
4553 final __test = new SimpleParserTest();
4554 runJUnitTest(__test, __test.test_parseCommentReference_prefixed);
4555 });
4556 _ut.test('test_parseCommentReference_simple', () {
4557 final __test = new SimpleParserTest();
4558 runJUnitTest(__test, __test.test_parseCommentReference_simple);
4559 });
4560 _ut.test('test_parseCommentReferences_multiLine', () {
4561 final __test = new SimpleParserTest();
4562 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine);
4563 });
4564 _ut.test('test_parseCommentReferences_singleLine', () {
4565 final __test = new SimpleParserTest();
4566 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine);
4567 });
4568 _ut.test('test_parseCommentReferences_skipCodeBlock_bracketed', () {
4569 final __test = new SimpleParserTest();
4570 runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_br acketed);
4571 });
4572 _ut.test('test_parseCommentReferences_skipCodeBlock_spaces', () {
4573 final __test = new SimpleParserTest();
4574 runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_sp aces);
4575 });
4576 _ut.test('test_parseCommentReferences_skipLinkDefinition', () {
4577 final __test = new SimpleParserTest();
4578 runJUnitTest(__test, __test.test_parseCommentReferences_skipLinkDefiniti on);
4579 });
4580 _ut.test('test_parseCommentReferences_skipLinked', () {
4581 final __test = new SimpleParserTest();
4582 runJUnitTest(__test, __test.test_parseCommentReferences_skipLinked);
4583 });
4584 _ut.test('test_parseCommentReferences_skipReferenceLink', () {
4585 final __test = new SimpleParserTest();
4586 runJUnitTest(__test, __test.test_parseCommentReferences_skipReferenceLin k);
4587 });
4588 _ut.test('test_parseCompilationUnitMember_abstractAsPrefix', () {
4589 final __test = new SimpleParserTest();
4590 runJUnitTest(__test, __test.test_parseCompilationUnitMember_abstractAsPr efix);
4591 });
4592 _ut.test('test_parseCompilationUnitMember_class', () {
4593 final __test = new SimpleParserTest();
4594 runJUnitTest(__test, __test.test_parseCompilationUnitMember_class);
4595 });
4596 _ut.test('test_parseCompilationUnitMember_constVariable', () {
4597 final __test = new SimpleParserTest();
4598 runJUnitTest(__test, __test.test_parseCompilationUnitMember_constVariabl e);
4599 });
4600 _ut.test('test_parseCompilationUnitMember_finalVariable', () {
4601 final __test = new SimpleParserTest();
4602 runJUnitTest(__test, __test.test_parseCompilationUnitMember_finalVariabl e);
4603 });
4604 _ut.test('test_parseCompilationUnitMember_function_external_noType', () {
4605 final __test = new SimpleParserTest();
4606 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_ext ernal_noType);
4607 });
4608 _ut.test('test_parseCompilationUnitMember_function_external_type', () {
4609 final __test = new SimpleParserTest();
4610 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_ext ernal_type);
4611 });
4612 _ut.test('test_parseCompilationUnitMember_function_noType', () {
4613 final __test = new SimpleParserTest();
4614 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_noT ype);
4615 });
4616 _ut.test('test_parseCompilationUnitMember_function_type', () {
4617 final __test = new SimpleParserTest();
4618 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_typ e);
4619 });
4620 _ut.test('test_parseCompilationUnitMember_function_void', () {
4621 final __test = new SimpleParserTest();
4622 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_voi d);
4623 });
4624 _ut.test('test_parseCompilationUnitMember_getter_external_noType', () {
4625 final __test = new SimpleParserTest();
4626 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_exter nal_noType);
4627 });
4628 _ut.test('test_parseCompilationUnitMember_getter_external_type', () {
4629 final __test = new SimpleParserTest();
4630 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_exter nal_type);
4631 });
4632 _ut.test('test_parseCompilationUnitMember_getter_noType', () {
4633 final __test = new SimpleParserTest();
4634 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_noTyp e);
4635 });
4636 _ut.test('test_parseCompilationUnitMember_getter_type', () {
4637 final __test = new SimpleParserTest();
4638 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_type) ;
4639 });
4640 _ut.test('test_parseCompilationUnitMember_setter_external_noType', () {
4641 final __test = new SimpleParserTest();
4642 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_exter nal_noType);
4643 });
4644 _ut.test('test_parseCompilationUnitMember_setter_external_type', () {
4645 final __test = new SimpleParserTest();
4646 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_exter nal_type);
4647 });
4648 _ut.test('test_parseCompilationUnitMember_setter_noType', () {
4649 final __test = new SimpleParserTest();
4650 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_noTyp e);
4651 });
4652 _ut.test('test_parseCompilationUnitMember_setter_type', () {
4653 final __test = new SimpleParserTest();
4654 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_type) ;
4655 });
4656 _ut.test('test_parseCompilationUnitMember_typeAlias_abstract', () {
4657 final __test = new SimpleParserTest();
4658 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typeAlias_ab stract);
4659 });
4660 _ut.test('test_parseCompilationUnitMember_typeAlias_generic', () {
4661 final __test = new SimpleParserTest();
4662 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typeAlias_ge neric);
4663 });
4664 _ut.test('test_parseCompilationUnitMember_typeAlias_implements', () {
4665 final __test = new SimpleParserTest();
4666 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typeAlias_im plements);
4667 });
4668 _ut.test('test_parseCompilationUnitMember_typeAlias_noImplements', () {
4669 final __test = new SimpleParserTest();
4670 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typeAlias_no Implements);
4671 });
4672 _ut.test('test_parseCompilationUnitMember_typedef', () {
4673 final __test = new SimpleParserTest();
4674 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef);
4675 });
4676 _ut.test('test_parseCompilationUnitMember_variable', () {
4677 final __test = new SimpleParserTest();
4678 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variable);
4679 });
4680 _ut.test('test_parseCompilationUnitMember_variableGet', () {
4681 final __test = new SimpleParserTest();
4682 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variableGet) ;
4683 });
4684 _ut.test('test_parseCompilationUnitMember_variableSet', () {
4685 final __test = new SimpleParserTest();
4686 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variableSet) ;
4687 });
4688 _ut.test('test_parseCompilationUnit_abstractAsPrefix_parameterized', () {
4689 final __test = new SimpleParserTest();
4690 runJUnitTest(__test, __test.test_parseCompilationUnit_abstractAsPrefix_p arameterized);
4691 });
4692 _ut.test('test_parseCompilationUnit_directives_multiple', () {
4693 final __test = new SimpleParserTest();
4694 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_multipl e);
4695 });
4696 _ut.test('test_parseCompilationUnit_directives_single', () {
4697 final __test = new SimpleParserTest();
4698 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_single) ;
4699 });
4700 _ut.test('test_parseCompilationUnit_empty', () {
4701 final __test = new SimpleParserTest();
4702 runJUnitTest(__test, __test.test_parseCompilationUnit_empty);
4703 });
4704 _ut.test('test_parseCompilationUnit_exportAsPrefix', () {
4705 final __test = new SimpleParserTest();
4706 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix);
4707 });
4708 _ut.test('test_parseCompilationUnit_exportAsPrefix_parameterized', () {
4709 final __test = new SimpleParserTest();
4710 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix_par ameterized);
4711 });
4712 _ut.test('test_parseCompilationUnit_operatorAsPrefix_parameterized', () {
4713 final __test = new SimpleParserTest();
4714 runJUnitTest(__test, __test.test_parseCompilationUnit_operatorAsPrefix_p arameterized);
4715 });
4716 _ut.test('test_parseCompilationUnit_script', () {
4717 final __test = new SimpleParserTest();
4718 runJUnitTest(__test, __test.test_parseCompilationUnit_script);
4719 });
4720 _ut.test('test_parseCompilationUnit_topLevelDeclaration', () {
4721 final __test = new SimpleParserTest();
4722 runJUnitTest(__test, __test.test_parseCompilationUnit_topLevelDeclaratio n);
4723 });
4724 _ut.test('test_parseCompilationUnit_typedefAsPrefix', () {
4725 final __test = new SimpleParserTest();
4726 runJUnitTest(__test, __test.test_parseCompilationUnit_typedefAsPrefix);
4727 });
4728 _ut.test('test_parseConditionalExpression', () {
4729 final __test = new SimpleParserTest();
4730 runJUnitTest(__test, __test.test_parseConditionalExpression);
4731 });
4732 _ut.test('test_parseConstExpression_instanceCreation', () {
4733 final __test = new SimpleParserTest();
4734 runJUnitTest(__test, __test.test_parseConstExpression_instanceCreation);
4735 });
4736 _ut.test('test_parseConstExpression_listLiteral_typed', () {
4737 final __test = new SimpleParserTest();
4738 runJUnitTest(__test, __test.test_parseConstExpression_listLiteral_typed) ;
4739 });
4740 _ut.test('test_parseConstExpression_listLiteral_untyped', () {
4741 final __test = new SimpleParserTest();
4742 runJUnitTest(__test, __test.test_parseConstExpression_listLiteral_untype d);
4743 });
4744 _ut.test('test_parseConstExpression_mapLiteral_typed', () {
4745 final __test = new SimpleParserTest();
4746 runJUnitTest(__test, __test.test_parseConstExpression_mapLiteral_typed);
4747 });
4748 _ut.test('test_parseConstExpression_mapLiteral_untyped', () {
4749 final __test = new SimpleParserTest();
4750 runJUnitTest(__test, __test.test_parseConstExpression_mapLiteral_untyped );
4751 });
4752 _ut.test('test_parseConstructor', () {
4753 final __test = new SimpleParserTest();
4754 runJUnitTest(__test, __test.test_parseConstructor);
4755 });
4756 _ut.test('test_parseConstructorFieldInitializer_qualified', () {
4757 final __test = new SimpleParserTest();
4758 runJUnitTest(__test, __test.test_parseConstructorFieldInitializer_qualif ied);
4759 });
4760 _ut.test('test_parseConstructorFieldInitializer_unqualified', () {
4761 final __test = new SimpleParserTest();
4762 runJUnitTest(__test, __test.test_parseConstructorFieldInitializer_unqual ified);
4763 });
4764 _ut.test('test_parseConstructorName_named_noPrefix', () {
4765 final __test = new SimpleParserTest();
4766 runJUnitTest(__test, __test.test_parseConstructorName_named_noPrefix);
4767 });
4768 _ut.test('test_parseConstructorName_named_prefixed', () {
4769 final __test = new SimpleParserTest();
4770 runJUnitTest(__test, __test.test_parseConstructorName_named_prefixed);
4771 });
4772 _ut.test('test_parseConstructorName_unnamed_noPrefix', () {
4773 final __test = new SimpleParserTest();
4774 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_noPrefix);
4775 });
4776 _ut.test('test_parseConstructorName_unnamed_prefixed', () {
4777 final __test = new SimpleParserTest();
4778 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_prefixed);
4779 });
4780 _ut.test('test_parseContinueStatement_label', () {
4781 final __test = new SimpleParserTest();
4782 runJUnitTest(__test, __test.test_parseContinueStatement_label);
4783 });
4784 _ut.test('test_parseContinueStatement_noLabel', () {
4785 final __test = new SimpleParserTest();
4786 runJUnitTest(__test, __test.test_parseContinueStatement_noLabel);
4787 });
4788 _ut.test('test_parseDirective_export', () {
4789 final __test = new SimpleParserTest();
4790 runJUnitTest(__test, __test.test_parseDirective_export);
4791 });
4792 _ut.test('test_parseDirective_import', () {
4793 final __test = new SimpleParserTest();
4794 runJUnitTest(__test, __test.test_parseDirective_import);
4795 });
4796 _ut.test('test_parseDirective_library', () {
4797 final __test = new SimpleParserTest();
4798 runJUnitTest(__test, __test.test_parseDirective_library);
4799 });
4800 _ut.test('test_parseDirective_part', () {
4801 final __test = new SimpleParserTest();
4802 runJUnitTest(__test, __test.test_parseDirective_part);
4803 });
4804 _ut.test('test_parseDirective_partOf', () {
4805 final __test = new SimpleParserTest();
4806 runJUnitTest(__test, __test.test_parseDirective_partOf);
4807 });
4808 _ut.test('test_parseDoStatement', () {
4809 final __test = new SimpleParserTest();
4810 runJUnitTest(__test, __test.test_parseDoStatement);
4811 });
4812 _ut.test('test_parseDocumentationComment_block', () {
4813 final __test = new SimpleParserTest();
4814 runJUnitTest(__test, __test.test_parseDocumentationComment_block);
4815 });
4816 _ut.test('test_parseDocumentationComment_block_withReference', () {
4817 final __test = new SimpleParserTest();
4818 runJUnitTest(__test, __test.test_parseDocumentationComment_block_withRef erence);
4819 });
4820 _ut.test('test_parseDocumentationComment_endOfLine', () {
4821 final __test = new SimpleParserTest();
4822 runJUnitTest(__test, __test.test_parseDocumentationComment_endOfLine);
4823 });
4824 _ut.test('test_parseEmptyStatement', () {
4825 final __test = new SimpleParserTest();
4826 runJUnitTest(__test, __test.test_parseEmptyStatement);
4827 });
4828 _ut.test('test_parseEqualityExpression_normal', () {
4829 final __test = new SimpleParserTest();
4830 runJUnitTest(__test, __test.test_parseEqualityExpression_normal);
4831 });
4832 _ut.test('test_parseEqualityExpression_super', () {
4833 final __test = new SimpleParserTest();
4834 runJUnitTest(__test, __test.test_parseEqualityExpression_super);
4835 });
4836 _ut.test('test_parseExportDirective_hide', () {
4837 final __test = new SimpleParserTest();
4838 runJUnitTest(__test, __test.test_parseExportDirective_hide);
4839 });
4840 _ut.test('test_parseExportDirective_hide_show', () {
4841 final __test = new SimpleParserTest();
4842 runJUnitTest(__test, __test.test_parseExportDirective_hide_show);
4843 });
4844 _ut.test('test_parseExportDirective_noCombinator', () {
4845 final __test = new SimpleParserTest();
4846 runJUnitTest(__test, __test.test_parseExportDirective_noCombinator);
4847 });
4848 _ut.test('test_parseExportDirective_show', () {
4849 final __test = new SimpleParserTest();
4850 runJUnitTest(__test, __test.test_parseExportDirective_show);
4851 });
4852 _ut.test('test_parseExportDirective_show_hide', () {
4853 final __test = new SimpleParserTest();
4854 runJUnitTest(__test, __test.test_parseExportDirective_show_hide);
4855 });
4856 _ut.test('test_parseExpressionList_multiple', () {
4857 final __test = new SimpleParserTest();
4858 runJUnitTest(__test, __test.test_parseExpressionList_multiple);
4859 });
4860 _ut.test('test_parseExpressionList_single', () {
4861 final __test = new SimpleParserTest();
4862 runJUnitTest(__test, __test.test_parseExpressionList_single);
4863 });
4864 _ut.test('test_parseExpressionWithoutCascade_assign', () {
4865 final __test = new SimpleParserTest();
4866 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_assign);
4867 });
4868 _ut.test('test_parseExpressionWithoutCascade_comparison', () {
4869 final __test = new SimpleParserTest();
4870 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_compariso n);
4871 });
4872 _ut.test('test_parseExpressionWithoutCascade_superMethodInvocation', () {
4873 final __test = new SimpleParserTest();
4874 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_superMeth odInvocation);
4875 });
4876 _ut.test('test_parseExpression_assign', () {
4877 final __test = new SimpleParserTest();
4878 runJUnitTest(__test, __test.test_parseExpression_assign);
4879 });
4880 _ut.test('test_parseExpression_comparison', () {
4881 final __test = new SimpleParserTest();
4882 runJUnitTest(__test, __test.test_parseExpression_comparison);
4883 });
4884 _ut.test('test_parseExpression_invokeFunctionExpression', () {
4885 final __test = new SimpleParserTest();
4886 runJUnitTest(__test, __test.test_parseExpression_invokeFunctionExpressio n);
4887 });
4888 _ut.test('test_parseExpression_superMethodInvocation', () {
4889 final __test = new SimpleParserTest();
4890 runJUnitTest(__test, __test.test_parseExpression_superMethodInvocation);
4891 });
4892 _ut.test('test_parseExtendsClause', () {
4893 final __test = new SimpleParserTest();
4894 runJUnitTest(__test, __test.test_parseExtendsClause);
4895 });
4896 _ut.test('test_parseFinalConstVarOrType_const_noType', () {
4897 final __test = new SimpleParserTest();
4898 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_const_noType);
4899 });
4900 _ut.test('test_parseFinalConstVarOrType_const_type', () {
4901 final __test = new SimpleParserTest();
4902 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_const_type);
4903 });
4904 _ut.test('test_parseFinalConstVarOrType_final_noType', () {
4905 final __test = new SimpleParserTest();
4906 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_final_noType);
4907 });
4908 _ut.test('test_parseFinalConstVarOrType_final_prefixedType', () {
4909 final __test = new SimpleParserTest();
4910 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_final_prefixed Type);
4911 });
4912 _ut.test('test_parseFinalConstVarOrType_final_type', () {
4913 final __test = new SimpleParserTest();
4914 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_final_type);
4915 });
4916 _ut.test('test_parseFinalConstVarOrType_type_parameterized', () {
4917 final __test = new SimpleParserTest();
4918 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_parameter ized);
4919 });
4920 _ut.test('test_parseFinalConstVarOrType_type_prefixed', () {
4921 final __test = new SimpleParserTest();
4922 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_prefixed) ;
4923 });
4924 _ut.test('test_parseFinalConstVarOrType_type_prefixedAndParameterized', () {
4925 final __test = new SimpleParserTest();
4926 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_prefixedA ndParameterized);
4927 });
4928 _ut.test('test_parseFinalConstVarOrType_type_simple', () {
4929 final __test = new SimpleParserTest();
4930 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_simple);
4931 });
4932 _ut.test('test_parseFinalConstVarOrType_var', () {
4933 final __test = new SimpleParserTest();
4934 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_var);
4935 });
4936 _ut.test('test_parseForStatement_each_identifier', () {
4937 final __test = new SimpleParserTest();
4938 runJUnitTest(__test, __test.test_parseForStatement_each_identifier);
4939 });
4940 _ut.test('test_parseForStatement_each_noType_metadata', () {
4941 final __test = new SimpleParserTest();
4942 runJUnitTest(__test, __test.test_parseForStatement_each_noType_metadata) ;
4943 });
4944 _ut.test('test_parseForStatement_each_type', () {
4945 final __test = new SimpleParserTest();
4946 runJUnitTest(__test, __test.test_parseForStatement_each_type);
4947 });
4948 _ut.test('test_parseForStatement_each_var', () {
4949 final __test = new SimpleParserTest();
4950 runJUnitTest(__test, __test.test_parseForStatement_each_var);
4951 });
4952 _ut.test('test_parseForStatement_loop_c', () {
4953 final __test = new SimpleParserTest();
4954 runJUnitTest(__test, __test.test_parseForStatement_loop_c);
4955 });
4956 _ut.test('test_parseForStatement_loop_cu', () {
4957 final __test = new SimpleParserTest();
4958 runJUnitTest(__test, __test.test_parseForStatement_loop_cu);
4959 });
4960 _ut.test('test_parseForStatement_loop_ecu', () {
4961 final __test = new SimpleParserTest();
4962 runJUnitTest(__test, __test.test_parseForStatement_loop_ecu);
4963 });
4964 _ut.test('test_parseForStatement_loop_i', () {
4965 final __test = new SimpleParserTest();
4966 runJUnitTest(__test, __test.test_parseForStatement_loop_i);
4967 });
4968 _ut.test('test_parseForStatement_loop_i_withMetadata', () {
4969 final __test = new SimpleParserTest();
4970 runJUnitTest(__test, __test.test_parseForStatement_loop_i_withMetadata);
4971 });
4972 _ut.test('test_parseForStatement_loop_ic', () {
4973 final __test = new SimpleParserTest();
4974 runJUnitTest(__test, __test.test_parseForStatement_loop_ic);
4975 });
4976 _ut.test('test_parseForStatement_loop_icu', () {
4977 final __test = new SimpleParserTest();
4978 runJUnitTest(__test, __test.test_parseForStatement_loop_icu);
4979 });
4980 _ut.test('test_parseForStatement_loop_iicuu', () {
4981 final __test = new SimpleParserTest();
4982 runJUnitTest(__test, __test.test_parseForStatement_loop_iicuu);
4983 });
4984 _ut.test('test_parseForStatement_loop_iu', () {
4985 final __test = new SimpleParserTest();
4986 runJUnitTest(__test, __test.test_parseForStatement_loop_iu);
4987 });
4988 _ut.test('test_parseForStatement_loop_u', () {
4989 final __test = new SimpleParserTest();
4990 runJUnitTest(__test, __test.test_parseForStatement_loop_u);
4991 });
4992 _ut.test('test_parseFormalParameterList_empty', () {
4993 final __test = new SimpleParserTest();
4994 runJUnitTest(__test, __test.test_parseFormalParameterList_empty);
4995 });
4996 _ut.test('test_parseFormalParameterList_named_multiple', () {
4997 final __test = new SimpleParserTest();
4998 runJUnitTest(__test, __test.test_parseFormalParameterList_named_multiple );
4999 });
5000 _ut.test('test_parseFormalParameterList_named_single', () {
5001 final __test = new SimpleParserTest();
5002 runJUnitTest(__test, __test.test_parseFormalParameterList_named_single);
5003 });
5004 _ut.test('test_parseFormalParameterList_normal_multiple', () {
5005 final __test = new SimpleParserTest();
5006 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_multipl e);
5007 });
5008 _ut.test('test_parseFormalParameterList_normal_named', () {
5009 final __test = new SimpleParserTest();
5010 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_named);
5011 });
5012 _ut.test('test_parseFormalParameterList_normal_positional', () {
5013 final __test = new SimpleParserTest();
5014 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_positio nal);
5015 });
5016 _ut.test('test_parseFormalParameterList_normal_single', () {
5017 final __test = new SimpleParserTest();
5018 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_single) ;
5019 });
5020 _ut.test('test_parseFormalParameterList_positional_multiple', () {
5021 final __test = new SimpleParserTest();
5022 runJUnitTest(__test, __test.test_parseFormalParameterList_positional_mul tiple);
5023 });
5024 _ut.test('test_parseFormalParameterList_positional_single', () {
5025 final __test = new SimpleParserTest();
5026 runJUnitTest(__test, __test.test_parseFormalParameterList_positional_sin gle);
5027 });
5028 _ut.test('test_parseFormalParameter_final_withType_named', () {
5029 final __test = new SimpleParserTest();
5030 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_nam ed);
5031 });
5032 _ut.test('test_parseFormalParameter_final_withType_normal', () {
5033 final __test = new SimpleParserTest();
5034 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_nor mal);
5035 });
5036 _ut.test('test_parseFormalParameter_final_withType_positional', () {
5037 final __test = new SimpleParserTest();
5038 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_pos itional);
5039 });
5040 _ut.test('test_parseFormalParameter_nonFinal_withType_named', () {
5041 final __test = new SimpleParserTest();
5042 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_ named);
5043 });
5044 _ut.test('test_parseFormalParameter_nonFinal_withType_normal', () {
5045 final __test = new SimpleParserTest();
5046 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_ normal);
5047 });
5048 _ut.test('test_parseFormalParameter_nonFinal_withType_positional', () {
5049 final __test = new SimpleParserTest();
5050 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_ positional);
5051 });
5052 _ut.test('test_parseFormalParameter_var', () {
5053 final __test = new SimpleParserTest();
5054 runJUnitTest(__test, __test.test_parseFormalParameter_var);
5055 });
5056 _ut.test('test_parseFormalParameter_var_named', () {
5057 final __test = new SimpleParserTest();
5058 runJUnitTest(__test, __test.test_parseFormalParameter_var_named);
5059 });
5060 _ut.test('test_parseFormalParameter_var_positional', () {
5061 final __test = new SimpleParserTest();
5062 runJUnitTest(__test, __test.test_parseFormalParameter_var_positional);
5063 });
5064 _ut.test('test_parseFunctionBody_block', () {
5065 final __test = new SimpleParserTest();
5066 runJUnitTest(__test, __test.test_parseFunctionBody_block);
5067 });
5068 _ut.test('test_parseFunctionBody_empty', () {
5069 final __test = new SimpleParserTest();
5070 runJUnitTest(__test, __test.test_parseFunctionBody_empty);
5071 });
5072 _ut.test('test_parseFunctionBody_expression', () {
5073 final __test = new SimpleParserTest();
5074 runJUnitTest(__test, __test.test_parseFunctionBody_expression);
5075 });
5076 _ut.test('test_parseFunctionBody_nativeFunctionBody', () {
5077 final __test = new SimpleParserTest();
5078 runJUnitTest(__test, __test.test_parseFunctionBody_nativeFunctionBody);
5079 });
5080 _ut.test('test_parseFunctionDeclarationStatement', () {
5081 final __test = new SimpleParserTest();
5082 runJUnitTest(__test, __test.test_parseFunctionDeclarationStatement);
5083 });
5084 _ut.test('test_parseFunctionDeclaration_function', () {
5085 final __test = new SimpleParserTest();
5086 runJUnitTest(__test, __test.test_parseFunctionDeclaration_function);
5087 });
5088 _ut.test('test_parseFunctionDeclaration_getter', () {
5089 final __test = new SimpleParserTest();
5090 runJUnitTest(__test, __test.test_parseFunctionDeclaration_getter);
5091 });
5092 _ut.test('test_parseFunctionDeclaration_setter', () {
5093 final __test = new SimpleParserTest();
5094 runJUnitTest(__test, __test.test_parseFunctionDeclaration_setter);
5095 });
5096 _ut.test('test_parseFunctionExpression_body_inExpression', () {
5097 final __test = new SimpleParserTest();
5098 runJUnitTest(__test, __test.test_parseFunctionExpression_body_inExpressi on);
5099 });
5100 _ut.test('test_parseFunctionExpression_minimal', () {
5101 final __test = new SimpleParserTest();
5102 runJUnitTest(__test, __test.test_parseFunctionExpression_minimal);
5103 });
5104 _ut.test('test_parseGetter_nonStatic', () {
5105 final __test = new SimpleParserTest();
5106 runJUnitTest(__test, __test.test_parseGetter_nonStatic);
5107 });
5108 _ut.test('test_parseGetter_static', () {
5109 final __test = new SimpleParserTest();
5110 runJUnitTest(__test, __test.test_parseGetter_static);
5111 });
5112 _ut.test('test_parseIdentifierList_multiple', () {
5113 final __test = new SimpleParserTest();
5114 runJUnitTest(__test, __test.test_parseIdentifierList_multiple);
5115 });
5116 _ut.test('test_parseIdentifierList_single', () {
5117 final __test = new SimpleParserTest();
5118 runJUnitTest(__test, __test.test_parseIdentifierList_single);
5119 });
5120 _ut.test('test_parseIfStatement_else_block', () {
5121 final __test = new SimpleParserTest();
5122 runJUnitTest(__test, __test.test_parseIfStatement_else_block);
5123 });
5124 _ut.test('test_parseIfStatement_else_statement', () {
5125 final __test = new SimpleParserTest();
5126 runJUnitTest(__test, __test.test_parseIfStatement_else_statement);
5127 });
5128 _ut.test('test_parseIfStatement_noElse_block', () {
5129 final __test = new SimpleParserTest();
5130 runJUnitTest(__test, __test.test_parseIfStatement_noElse_block);
5131 });
5132 _ut.test('test_parseIfStatement_noElse_statement', () {
5133 final __test = new SimpleParserTest();
5134 runJUnitTest(__test, __test.test_parseIfStatement_noElse_statement);
5135 });
5136 _ut.test('test_parseImplementsClause_multiple', () {
5137 final __test = new SimpleParserTest();
5138 runJUnitTest(__test, __test.test_parseImplementsClause_multiple);
5139 });
5140 _ut.test('test_parseImplementsClause_single', () {
5141 final __test = new SimpleParserTest();
5142 runJUnitTest(__test, __test.test_parseImplementsClause_single);
5143 });
5144 _ut.test('test_parseImportDirective_hide', () {
5145 final __test = new SimpleParserTest();
5146 runJUnitTest(__test, __test.test_parseImportDirective_hide);
5147 });
5148 _ut.test('test_parseImportDirective_noCombinator', () {
5149 final __test = new SimpleParserTest();
5150 runJUnitTest(__test, __test.test_parseImportDirective_noCombinator);
5151 });
5152 _ut.test('test_parseImportDirective_prefix', () {
5153 final __test = new SimpleParserTest();
5154 runJUnitTest(__test, __test.test_parseImportDirective_prefix);
5155 });
5156 _ut.test('test_parseImportDirective_prefix_hide_show', () {
5157 final __test = new SimpleParserTest();
5158 runJUnitTest(__test, __test.test_parseImportDirective_prefix_hide_show);
5159 });
5160 _ut.test('test_parseImportDirective_prefix_show_hide', () {
5161 final __test = new SimpleParserTest();
5162 runJUnitTest(__test, __test.test_parseImportDirective_prefix_show_hide);
5163 });
5164 _ut.test('test_parseImportDirective_show', () {
5165 final __test = new SimpleParserTest();
5166 runJUnitTest(__test, __test.test_parseImportDirective_show);
5167 });
5168 _ut.test('test_parseInitializedIdentifierList_type', () {
5169 final __test = new SimpleParserTest();
5170 runJUnitTest(__test, __test.test_parseInitializedIdentifierList_type);
5171 });
5172 _ut.test('test_parseInitializedIdentifierList_var', () {
5173 final __test = new SimpleParserTest();
5174 runJUnitTest(__test, __test.test_parseInitializedIdentifierList_var);
5175 });
5176 _ut.test('test_parseInstanceCreationExpression_qualifiedType', () {
5177 final __test = new SimpleParserTest();
5178 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_qualifi edType);
5179 });
5180 _ut.test('test_parseInstanceCreationExpression_qualifiedType_named', () {
5181 final __test = new SimpleParserTest();
5182 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_qualifi edType_named);
5183 });
5184 _ut.test('test_parseInstanceCreationExpression_type', () {
5185 final __test = new SimpleParserTest();
5186 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_type);
5187 });
5188 _ut.test('test_parseInstanceCreationExpression_type_named', () {
5189 final __test = new SimpleParserTest();
5190 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_type_na med);
5191 });
5192 _ut.test('test_parseLibraryDirective', () {
5193 final __test = new SimpleParserTest();
5194 runJUnitTest(__test, __test.test_parseLibraryDirective);
5195 });
5196 _ut.test('test_parseLibraryIdentifier_multiple', () {
5197 final __test = new SimpleParserTest();
5198 runJUnitTest(__test, __test.test_parseLibraryIdentifier_multiple);
5199 });
5200 _ut.test('test_parseLibraryIdentifier_single', () {
5201 final __test = new SimpleParserTest();
5202 runJUnitTest(__test, __test.test_parseLibraryIdentifier_single);
5203 });
5204 _ut.test('test_parseListLiteral_empty_oneToken', () {
5205 final __test = new SimpleParserTest();
5206 runJUnitTest(__test, __test.test_parseListLiteral_empty_oneToken);
5207 });
5208 _ut.test('test_parseListLiteral_empty_twoTokens', () {
5209 final __test = new SimpleParserTest();
5210 runJUnitTest(__test, __test.test_parseListLiteral_empty_twoTokens);
5211 });
5212 _ut.test('test_parseListLiteral_multiple', () {
5213 final __test = new SimpleParserTest();
5214 runJUnitTest(__test, __test.test_parseListLiteral_multiple);
5215 });
5216 _ut.test('test_parseListLiteral_single', () {
5217 final __test = new SimpleParserTest();
5218 runJUnitTest(__test, __test.test_parseListLiteral_single);
5219 });
5220 _ut.test('test_parseListOrMapLiteral_list_noType', () {
5221 final __test = new SimpleParserTest();
5222 runJUnitTest(__test, __test.test_parseListOrMapLiteral_list_noType);
5223 });
5224 _ut.test('test_parseListOrMapLiteral_list_type', () {
5225 final __test = new SimpleParserTest();
5226 runJUnitTest(__test, __test.test_parseListOrMapLiteral_list_type);
5227 });
5228 _ut.test('test_parseListOrMapLiteral_map_noType', () {
5229 final __test = new SimpleParserTest();
5230 runJUnitTest(__test, __test.test_parseListOrMapLiteral_map_noType);
5231 });
5232 _ut.test('test_parseListOrMapLiteral_map_type', () {
5233 final __test = new SimpleParserTest();
5234 runJUnitTest(__test, __test.test_parseListOrMapLiteral_map_type);
5235 });
5236 _ut.test('test_parseLogicalAndExpression', () {
5237 final __test = new SimpleParserTest();
5238 runJUnitTest(__test, __test.test_parseLogicalAndExpression);
5239 });
5240 _ut.test('test_parseLogicalOrExpression', () {
5241 final __test = new SimpleParserTest();
5242 runJUnitTest(__test, __test.test_parseLogicalOrExpression);
5243 });
5244 _ut.test('test_parseMapLiteralEntry_complex', () {
5245 final __test = new SimpleParserTest();
5246 runJUnitTest(__test, __test.test_parseMapLiteralEntry_complex);
5247 });
5248 _ut.test('test_parseMapLiteralEntry_int', () {
5249 final __test = new SimpleParserTest();
5250 runJUnitTest(__test, __test.test_parseMapLiteralEntry_int);
5251 });
5252 _ut.test('test_parseMapLiteralEntry_string', () {
5253 final __test = new SimpleParserTest();
5254 runJUnitTest(__test, __test.test_parseMapLiteralEntry_string);
5255 });
5256 _ut.test('test_parseMapLiteral_empty', () {
5257 final __test = new SimpleParserTest();
5258 runJUnitTest(__test, __test.test_parseMapLiteral_empty);
5259 });
5260 _ut.test('test_parseMapLiteral_multiple', () {
5261 final __test = new SimpleParserTest();
5262 runJUnitTest(__test, __test.test_parseMapLiteral_multiple);
5263 });
5264 _ut.test('test_parseMapLiteral_single', () {
5265 final __test = new SimpleParserTest();
5266 runJUnitTest(__test, __test.test_parseMapLiteral_single);
5267 });
5268 _ut.test('test_parseModifiers_abstract', () {
5269 final __test = new SimpleParserTest();
5270 runJUnitTest(__test, __test.test_parseModifiers_abstract);
5271 });
5272 _ut.test('test_parseModifiers_const', () {
5273 final __test = new SimpleParserTest();
5274 runJUnitTest(__test, __test.test_parseModifiers_const);
5275 });
5276 _ut.test('test_parseModifiers_external', () {
5277 final __test = new SimpleParserTest();
5278 runJUnitTest(__test, __test.test_parseModifiers_external);
5279 });
5280 _ut.test('test_parseModifiers_factory', () {
5281 final __test = new SimpleParserTest();
5282 runJUnitTest(__test, __test.test_parseModifiers_factory);
5283 });
5284 _ut.test('test_parseModifiers_final', () {
5285 final __test = new SimpleParserTest();
5286 runJUnitTest(__test, __test.test_parseModifiers_final);
5287 });
5288 _ut.test('test_parseModifiers_static', () {
5289 final __test = new SimpleParserTest();
5290 runJUnitTest(__test, __test.test_parseModifiers_static);
5291 });
5292 _ut.test('test_parseModifiers_var', () {
5293 final __test = new SimpleParserTest();
5294 runJUnitTest(__test, __test.test_parseModifiers_var);
5295 });
5296 _ut.test('test_parseMultiplicativeExpression_normal', () {
5297 final __test = new SimpleParserTest();
5298 runJUnitTest(__test, __test.test_parseMultiplicativeExpression_normal);
5299 });
5300 _ut.test('test_parseMultiplicativeExpression_super', () {
5301 final __test = new SimpleParserTest();
5302 runJUnitTest(__test, __test.test_parseMultiplicativeExpression_super);
5303 });
5304 _ut.test('test_parseNewExpression', () {
5305 final __test = new SimpleParserTest();
5306 runJUnitTest(__test, __test.test_parseNewExpression);
5307 });
5308 _ut.test('test_parseNonLabeledStatement_const_list_empty', () {
5309 final __test = new SimpleParserTest();
5310 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_list_emp ty);
5311 });
5312 _ut.test('test_parseNonLabeledStatement_const_list_nonEmpty', () {
5313 final __test = new SimpleParserTest();
5314 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_list_non Empty);
5315 });
5316 _ut.test('test_parseNonLabeledStatement_const_map_empty', () {
5317 final __test = new SimpleParserTest();
5318 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_map_empt y);
5319 });
5320 _ut.test('test_parseNonLabeledStatement_const_map_nonEmpty', () {
5321 final __test = new SimpleParserTest();
5322 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_map_nonE mpty);
5323 });
5324 _ut.test('test_parseNonLabeledStatement_const_object', () {
5325 final __test = new SimpleParserTest();
5326 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_object);
5327 });
5328 _ut.test('test_parseNonLabeledStatement_const_object_named_typeParameters' , () {
5329 final __test = new SimpleParserTest();
5330 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_object_n amed_typeParameters);
5331 });
5332 _ut.test('test_parseNonLabeledStatement_constructorInvocation', () {
5333 final __test = new SimpleParserTest();
5334 runJUnitTest(__test, __test.test_parseNonLabeledStatement_constructorInv ocation);
5335 });
5336 _ut.test('test_parseNonLabeledStatement_false', () {
5337 final __test = new SimpleParserTest();
5338 runJUnitTest(__test, __test.test_parseNonLabeledStatement_false);
5339 });
5340 _ut.test('test_parseNonLabeledStatement_functionDeclaration', () {
5341 final __test = new SimpleParserTest();
5342 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionDeclar ation);
5343 });
5344 _ut.test('test_parseNonLabeledStatement_functionDeclaration_arguments', () {
5345 final __test = new SimpleParserTest();
5346 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionDeclar ation_arguments);
5347 });
5348 _ut.test('test_parseNonLabeledStatement_functionExpressionIndex', () {
5349 final __test = new SimpleParserTest();
5350 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionExpres sionIndex);
5351 });
5352 _ut.test('test_parseNonLabeledStatement_functionInvocation', () {
5353 final __test = new SimpleParserTest();
5354 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionInvoca tion);
5355 });
5356 _ut.test('test_parseNonLabeledStatement_invokeFunctionExpression', () {
5357 final __test = new SimpleParserTest();
5358 runJUnitTest(__test, __test.test_parseNonLabeledStatement_invokeFunction Expression);
5359 });
5360 _ut.test('test_parseNonLabeledStatement_null', () {
5361 final __test = new SimpleParserTest();
5362 runJUnitTest(__test, __test.test_parseNonLabeledStatement_null);
5363 });
5364 _ut.test('test_parseNonLabeledStatement_startingWithBuiltInIdentifier', () {
5365 final __test = new SimpleParserTest();
5366 runJUnitTest(__test, __test.test_parseNonLabeledStatement_startingWithBu iltInIdentifier);
5367 });
5368 _ut.test('test_parseNonLabeledStatement_true', () {
5369 final __test = new SimpleParserTest();
5370 runJUnitTest(__test, __test.test_parseNonLabeledStatement_true);
5371 });
5372 _ut.test('test_parseNonLabeledStatement_typeCast', () {
5373 final __test = new SimpleParserTest();
5374 runJUnitTest(__test, __test.test_parseNonLabeledStatement_typeCast);
5375 });
5376 _ut.test('test_parseNormalFormalParameter_field_const_noType', () {
5377 final __test = new SimpleParserTest();
5378 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_const_ noType);
5379 });
5380 _ut.test('test_parseNormalFormalParameter_field_const_type', () {
5381 final __test = new SimpleParserTest();
5382 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_const_ type);
5383 });
5384 _ut.test('test_parseNormalFormalParameter_field_final_noType', () {
5385 final __test = new SimpleParserTest();
5386 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_final_ noType);
5387 });
5388 _ut.test('test_parseNormalFormalParameter_field_final_type', () {
5389 final __test = new SimpleParserTest();
5390 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_final_ type);
5391 });
5392 _ut.test('test_parseNormalFormalParameter_field_function_nested', () {
5393 final __test = new SimpleParserTest();
5394 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_functi on_nested);
5395 });
5396 _ut.test('test_parseNormalFormalParameter_field_function_noNested', () {
5397 final __test = new SimpleParserTest();
5398 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_functi on_noNested);
5399 });
5400 _ut.test('test_parseNormalFormalParameter_field_noType', () {
5401 final __test = new SimpleParserTest();
5402 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_noType );
5403 });
5404 _ut.test('test_parseNormalFormalParameter_field_type', () {
5405 final __test = new SimpleParserTest();
5406 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_type);
5407 });
5408 _ut.test('test_parseNormalFormalParameter_field_var', () {
5409 final __test = new SimpleParserTest();
5410 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_var);
5411 });
5412 _ut.test('test_parseNormalFormalParameter_function_noType', () {
5413 final __test = new SimpleParserTest();
5414 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_noT ype);
5415 });
5416 _ut.test('test_parseNormalFormalParameter_function_type', () {
5417 final __test = new SimpleParserTest();
5418 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_typ e);
5419 });
5420 _ut.test('test_parseNormalFormalParameter_function_void', () {
5421 final __test = new SimpleParserTest();
5422 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_voi d);
5423 });
5424 _ut.test('test_parseNormalFormalParameter_simple_const_noType', () {
5425 final __test = new SimpleParserTest();
5426 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_const _noType);
5427 });
5428 _ut.test('test_parseNormalFormalParameter_simple_const_type', () {
5429 final __test = new SimpleParserTest();
5430 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_const _type);
5431 });
5432 _ut.test('test_parseNormalFormalParameter_simple_final_noType', () {
5433 final __test = new SimpleParserTest();
5434 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_final _noType);
5435 });
5436 _ut.test('test_parseNormalFormalParameter_simple_final_type', () {
5437 final __test = new SimpleParserTest();
5438 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_final _type);
5439 });
5440 _ut.test('test_parseNormalFormalParameter_simple_noType', () {
5441 final __test = new SimpleParserTest();
5442 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_noTyp e);
5443 });
5444 _ut.test('test_parseNormalFormalParameter_simple_type', () {
5445 final __test = new SimpleParserTest();
5446 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_type) ;
5447 });
5448 _ut.test('test_parseOperator', () {
5449 final __test = new SimpleParserTest();
5450 runJUnitTest(__test, __test.test_parseOperator);
5451 });
5452 _ut.test('test_parseOptionalReturnType', () {
5453 final __test = new SimpleParserTest();
5454 runJUnitTest(__test, __test.test_parseOptionalReturnType);
5455 });
5456 _ut.test('test_parsePartDirective_part', () {
5457 final __test = new SimpleParserTest();
5458 runJUnitTest(__test, __test.test_parsePartDirective_part);
5459 });
5460 _ut.test('test_parsePartDirective_partOf', () {
5461 final __test = new SimpleParserTest();
5462 runJUnitTest(__test, __test.test_parsePartDirective_partOf);
5463 });
5464 _ut.test('test_parsePostfixExpression_decrement', () {
5465 final __test = new SimpleParserTest();
5466 runJUnitTest(__test, __test.test_parsePostfixExpression_decrement);
5467 });
5468 _ut.test('test_parsePostfixExpression_increment', () {
5469 final __test = new SimpleParserTest();
5470 runJUnitTest(__test, __test.test_parsePostfixExpression_increment);
5471 });
5472 _ut.test('test_parsePostfixExpression_none_indexExpression', () {
5473 final __test = new SimpleParserTest();
5474 runJUnitTest(__test, __test.test_parsePostfixExpression_none_indexExpres sion);
5475 });
5476 _ut.test('test_parsePostfixExpression_none_methodInvocation', () {
5477 final __test = new SimpleParserTest();
5478 runJUnitTest(__test, __test.test_parsePostfixExpression_none_methodInvoc ation);
5479 });
5480 _ut.test('test_parsePostfixExpression_none_propertyAccess', () {
5481 final __test = new SimpleParserTest();
5482 runJUnitTest(__test, __test.test_parsePostfixExpression_none_propertyAcc ess);
5483 });
5484 _ut.test('test_parsePrefixedIdentifier_noPrefix', () {
5485 final __test = new SimpleParserTest();
5486 runJUnitTest(__test, __test.test_parsePrefixedIdentifier_noPrefix);
5487 });
5488 _ut.test('test_parsePrefixedIdentifier_prefix', () {
5489 final __test = new SimpleParserTest();
5490 runJUnitTest(__test, __test.test_parsePrefixedIdentifier_prefix);
5491 });
5492 _ut.test('test_parsePrimaryExpression_const', () {
5493 final __test = new SimpleParserTest();
5494 runJUnitTest(__test, __test.test_parsePrimaryExpression_const);
5495 });
5496 _ut.test('test_parsePrimaryExpression_double', () {
5497 final __test = new SimpleParserTest();
5498 runJUnitTest(__test, __test.test_parsePrimaryExpression_double);
5499 });
5500 _ut.test('test_parsePrimaryExpression_false', () {
5501 final __test = new SimpleParserTest();
5502 runJUnitTest(__test, __test.test_parsePrimaryExpression_false);
5503 });
5504 _ut.test('test_parsePrimaryExpression_function_arguments', () {
5505 final __test = new SimpleParserTest();
5506 runJUnitTest(__test, __test.test_parsePrimaryExpression_function_argumen ts);
5507 });
5508 _ut.test('test_parsePrimaryExpression_function_noArguments', () {
5509 final __test = new SimpleParserTest();
5510 runJUnitTest(__test, __test.test_parsePrimaryExpression_function_noArgum ents);
5511 });
5512 _ut.test('test_parsePrimaryExpression_hex', () {
5513 final __test = new SimpleParserTest();
5514 runJUnitTest(__test, __test.test_parsePrimaryExpression_hex);
5515 });
5516 _ut.test('test_parsePrimaryExpression_identifier', () {
5517 final __test = new SimpleParserTest();
5518 runJUnitTest(__test, __test.test_parsePrimaryExpression_identifier);
5519 });
5520 _ut.test('test_parsePrimaryExpression_int', () {
5521 final __test = new SimpleParserTest();
5522 runJUnitTest(__test, __test.test_parsePrimaryExpression_int);
5523 });
5524 _ut.test('test_parsePrimaryExpression_listLiteral', () {
5525 final __test = new SimpleParserTest();
5526 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral);
5527 });
5528 _ut.test('test_parsePrimaryExpression_listLiteral_index', () {
5529 final __test = new SimpleParserTest();
5530 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral_inde x);
5531 });
5532 _ut.test('test_parsePrimaryExpression_listLiteral_typed', () {
5533 final __test = new SimpleParserTest();
5534 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral_type d);
5535 });
5536 _ut.test('test_parsePrimaryExpression_mapLiteral', () {
5537 final __test = new SimpleParserTest();
5538 runJUnitTest(__test, __test.test_parsePrimaryExpression_mapLiteral);
5539 });
5540 _ut.test('test_parsePrimaryExpression_mapLiteral_typed', () {
5541 final __test = new SimpleParserTest();
5542 runJUnitTest(__test, __test.test_parsePrimaryExpression_mapLiteral_typed );
5543 });
5544 _ut.test('test_parsePrimaryExpression_new', () {
5545 final __test = new SimpleParserTest();
5546 runJUnitTest(__test, __test.test_parsePrimaryExpression_new);
5547 });
5548 _ut.test('test_parsePrimaryExpression_null', () {
5549 final __test = new SimpleParserTest();
5550 runJUnitTest(__test, __test.test_parsePrimaryExpression_null);
5551 });
5552 _ut.test('test_parsePrimaryExpression_parenthesized', () {
5553 final __test = new SimpleParserTest();
5554 runJUnitTest(__test, __test.test_parsePrimaryExpression_parenthesized);
5555 });
5556 _ut.test('test_parsePrimaryExpression_string', () {
5557 final __test = new SimpleParserTest();
5558 runJUnitTest(__test, __test.test_parsePrimaryExpression_string);
5559 });
5560 _ut.test('test_parsePrimaryExpression_super', () {
5561 final __test = new SimpleParserTest();
5562 runJUnitTest(__test, __test.test_parsePrimaryExpression_super);
5563 });
5564 _ut.test('test_parsePrimaryExpression_this', () {
5565 final __test = new SimpleParserTest();
5566 runJUnitTest(__test, __test.test_parsePrimaryExpression_this);
5567 });
5568 _ut.test('test_parsePrimaryExpression_true', () {
5569 final __test = new SimpleParserTest();
5570 runJUnitTest(__test, __test.test_parsePrimaryExpression_true);
5571 });
5572 _ut.test('test_parseRedirectingConstructorInvocation_named', () {
5573 final __test = new SimpleParserTest();
5574 runJUnitTest(__test, __test.test_parseRedirectingConstructorInvocation_n amed);
5575 });
5576 _ut.test('test_parseRedirectingConstructorInvocation_unnamed', () {
5577 final __test = new SimpleParserTest();
5578 runJUnitTest(__test, __test.test_parseRedirectingConstructorInvocation_u nnamed);
5579 });
5580 _ut.test('test_parseRelationalExpression_as', () {
5581 final __test = new SimpleParserTest();
5582 runJUnitTest(__test, __test.test_parseRelationalExpression_as);
5583 });
5584 _ut.test('test_parseRelationalExpression_is', () {
5585 final __test = new SimpleParserTest();
5586 runJUnitTest(__test, __test.test_parseRelationalExpression_is);
5587 });
5588 _ut.test('test_parseRelationalExpression_isNot', () {
5589 final __test = new SimpleParserTest();
5590 runJUnitTest(__test, __test.test_parseRelationalExpression_isNot);
5591 });
5592 _ut.test('test_parseRelationalExpression_normal', () {
5593 final __test = new SimpleParserTest();
5594 runJUnitTest(__test, __test.test_parseRelationalExpression_normal);
5595 });
5596 _ut.test('test_parseRelationalExpression_super', () {
5597 final __test = new SimpleParserTest();
5598 runJUnitTest(__test, __test.test_parseRelationalExpression_super);
5599 });
5600 _ut.test('test_parseRethrowExpression', () {
5601 final __test = new SimpleParserTest();
5602 runJUnitTest(__test, __test.test_parseRethrowExpression);
5603 });
5604 _ut.test('test_parseReturnStatement_noValue', () {
5605 final __test = new SimpleParserTest();
5606 runJUnitTest(__test, __test.test_parseReturnStatement_noValue);
5607 });
5608 _ut.test('test_parseReturnStatement_value', () {
5609 final __test = new SimpleParserTest();
5610 runJUnitTest(__test, __test.test_parseReturnStatement_value);
5611 });
5612 _ut.test('test_parseReturnType_nonVoid', () {
5613 final __test = new SimpleParserTest();
5614 runJUnitTest(__test, __test.test_parseReturnType_nonVoid);
5615 });
5616 _ut.test('test_parseReturnType_void', () {
5617 final __test = new SimpleParserTest();
5618 runJUnitTest(__test, __test.test_parseReturnType_void);
5619 });
5620 _ut.test('test_parseSetter_nonStatic', () {
5621 final __test = new SimpleParserTest();
5622 runJUnitTest(__test, __test.test_parseSetter_nonStatic);
5623 });
5624 _ut.test('test_parseSetter_static', () {
5625 final __test = new SimpleParserTest();
5626 runJUnitTest(__test, __test.test_parseSetter_static);
5627 });
5628 _ut.test('test_parseShiftExpression_normal', () {
5629 final __test = new SimpleParserTest();
5630 runJUnitTest(__test, __test.test_parseShiftExpression_normal);
5631 });
5632 _ut.test('test_parseShiftExpression_super', () {
5633 final __test = new SimpleParserTest();
5634 runJUnitTest(__test, __test.test_parseShiftExpression_super);
5635 });
5636 _ut.test('test_parseSimpleIdentifier1_normalIdentifier', () {
5637 final __test = new SimpleParserTest();
5638 runJUnitTest(__test, __test.test_parseSimpleIdentifier1_normalIdentifier );
5639 });
5640 _ut.test('test_parseSimpleIdentifier_builtInIdentifier', () {
5641 final __test = new SimpleParserTest();
5642 runJUnitTest(__test, __test.test_parseSimpleIdentifier_builtInIdentifier );
5643 });
5644 _ut.test('test_parseSimpleIdentifier_normalIdentifier', () {
5645 final __test = new SimpleParserTest();
5646 runJUnitTest(__test, __test.test_parseSimpleIdentifier_normalIdentifier) ;
5647 });
5648 _ut.test('test_parseStatement_functionDeclaration', () {
5649 final __test = new SimpleParserTest();
5650 runJUnitTest(__test, __test.test_parseStatement_functionDeclaration);
5651 });
5652 _ut.test('test_parseStatement_mulipleLabels', () {
5653 final __test = new SimpleParserTest();
5654 runJUnitTest(__test, __test.test_parseStatement_mulipleLabels);
5655 });
5656 _ut.test('test_parseStatement_noLabels', () {
5657 final __test = new SimpleParserTest();
5658 runJUnitTest(__test, __test.test_parseStatement_noLabels);
5659 });
5660 _ut.test('test_parseStatement_singleLabel', () {
5661 final __test = new SimpleParserTest();
5662 runJUnitTest(__test, __test.test_parseStatement_singleLabel);
5663 });
5664 _ut.test('test_parseStatements_multiple', () {
5665 final __test = new SimpleParserTest();
5666 runJUnitTest(__test, __test.test_parseStatements_multiple);
5667 });
5668 _ut.test('test_parseStatements_single', () {
5669 final __test = new SimpleParserTest();
5670 runJUnitTest(__test, __test.test_parseStatements_single);
5671 });
5672 _ut.test('test_parseStringLiteral_adjacent', () {
5673 final __test = new SimpleParserTest();
5674 runJUnitTest(__test, __test.test_parseStringLiteral_adjacent);
5675 });
5676 _ut.test('test_parseStringLiteral_interpolated', () {
5677 final __test = new SimpleParserTest();
5678 runJUnitTest(__test, __test.test_parseStringLiteral_interpolated);
5679 });
5680 _ut.test('test_parseStringLiteral_single', () {
5681 final __test = new SimpleParserTest();
5682 runJUnitTest(__test, __test.test_parseStringLiteral_single);
5683 });
5684 _ut.test('test_parseSuperConstructorInvocation_named', () {
5685 final __test = new SimpleParserTest();
5686 runJUnitTest(__test, __test.test_parseSuperConstructorInvocation_named);
5687 });
5688 _ut.test('test_parseSuperConstructorInvocation_unnamed', () {
5689 final __test = new SimpleParserTest();
5690 runJUnitTest(__test, __test.test_parseSuperConstructorInvocation_unnamed );
5691 });
5692 _ut.test('test_parseSwitchStatement_case', () {
5693 final __test = new SimpleParserTest();
5694 runJUnitTest(__test, __test.test_parseSwitchStatement_case);
5695 });
5696 _ut.test('test_parseSwitchStatement_empty', () {
5697 final __test = new SimpleParserTest();
5698 runJUnitTest(__test, __test.test_parseSwitchStatement_empty);
5699 });
5700 _ut.test('test_parseSwitchStatement_labeledCase', () {
5701 final __test = new SimpleParserTest();
5702 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledCase);
5703 });
5704 _ut.test('test_parseSwitchStatement_labeledStatementInCase', () {
5705 final __test = new SimpleParserTest();
5706 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledStatementIn Case);
5707 });
5708 _ut.test('test_parseSymbolLiteral_builtInIdentifier', () {
5709 final __test = new SimpleParserTest();
5710 runJUnitTest(__test, __test.test_parseSymbolLiteral_builtInIdentifier);
5711 });
5712 _ut.test('test_parseSymbolLiteral_multiple', () {
5713 final __test = new SimpleParserTest();
5714 runJUnitTest(__test, __test.test_parseSymbolLiteral_multiple);
5715 });
5716 _ut.test('test_parseSymbolLiteral_operator', () {
5717 final __test = new SimpleParserTest();
5718 runJUnitTest(__test, __test.test_parseSymbolLiteral_operator);
5719 });
5720 _ut.test('test_parseSymbolLiteral_single', () {
5721 final __test = new SimpleParserTest();
5722 runJUnitTest(__test, __test.test_parseSymbolLiteral_single);
5723 });
5724 _ut.test('test_parseThrowExpression', () {
5725 final __test = new SimpleParserTest();
5726 runJUnitTest(__test, __test.test_parseThrowExpression);
5727 });
5728 _ut.test('test_parseThrowExpressionWithoutCascade', () {
5729 final __test = new SimpleParserTest();
5730 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade);
5731 });
5732 _ut.test('test_parseTryStatement_catch', () {
5733 final __test = new SimpleParserTest();
5734 runJUnitTest(__test, __test.test_parseTryStatement_catch);
5735 });
5736 _ut.test('test_parseTryStatement_catch_finally', () {
5737 final __test = new SimpleParserTest();
5738 runJUnitTest(__test, __test.test_parseTryStatement_catch_finally);
5739 });
5740 _ut.test('test_parseTryStatement_finally', () {
5741 final __test = new SimpleParserTest();
5742 runJUnitTest(__test, __test.test_parseTryStatement_finally);
5743 });
5744 _ut.test('test_parseTryStatement_multiple', () {
5745 final __test = new SimpleParserTest();
5746 runJUnitTest(__test, __test.test_parseTryStatement_multiple);
5747 });
5748 _ut.test('test_parseTryStatement_on', () {
5749 final __test = new SimpleParserTest();
5750 runJUnitTest(__test, __test.test_parseTryStatement_on);
5751 });
5752 _ut.test('test_parseTryStatement_on_catch', () {
5753 final __test = new SimpleParserTest();
5754 runJUnitTest(__test, __test.test_parseTryStatement_on_catch);
5755 });
5756 _ut.test('test_parseTryStatement_on_catch_finally', () {
5757 final __test = new SimpleParserTest();
5758 runJUnitTest(__test, __test.test_parseTryStatement_on_catch_finally);
5759 });
5760 _ut.test('test_parseTypeAlias_function_noParameters', () {
5761 final __test = new SimpleParserTest();
5762 runJUnitTest(__test, __test.test_parseTypeAlias_function_noParameters);
5763 });
5764 _ut.test('test_parseTypeAlias_function_noReturnType', () {
5765 final __test = new SimpleParserTest();
5766 runJUnitTest(__test, __test.test_parseTypeAlias_function_noReturnType);
5767 });
5768 _ut.test('test_parseTypeAlias_function_parameterizedReturnType', () {
5769 final __test = new SimpleParserTest();
5770 runJUnitTest(__test, __test.test_parseTypeAlias_function_parameterizedRe turnType);
5771 });
5772 _ut.test('test_parseTypeAlias_function_parameters', () {
5773 final __test = new SimpleParserTest();
5774 runJUnitTest(__test, __test.test_parseTypeAlias_function_parameters);
5775 });
5776 _ut.test('test_parseTypeAlias_function_typeParameters', () {
5777 final __test = new SimpleParserTest();
5778 runJUnitTest(__test, __test.test_parseTypeAlias_function_typeParameters) ;
5779 });
5780 _ut.test('test_parseTypeAlias_function_voidReturnType', () {
5781 final __test = new SimpleParserTest();
5782 runJUnitTest(__test, __test.test_parseTypeAlias_function_voidReturnType) ;
5783 });
5784 _ut.test('test_parseTypeArgumentList_multiple', () {
5785 final __test = new SimpleParserTest();
5786 runJUnitTest(__test, __test.test_parseTypeArgumentList_multiple);
5787 });
5788 _ut.test('test_parseTypeArgumentList_nested', () {
5789 final __test = new SimpleParserTest();
5790 runJUnitTest(__test, __test.test_parseTypeArgumentList_nested);
5791 });
5792 _ut.test('test_parseTypeArgumentList_single', () {
5793 final __test = new SimpleParserTest();
5794 runJUnitTest(__test, __test.test_parseTypeArgumentList_single);
5795 });
5796 _ut.test('test_parseTypeName_parameterized', () {
5797 final __test = new SimpleParserTest();
5798 runJUnitTest(__test, __test.test_parseTypeName_parameterized);
5799 });
5800 _ut.test('test_parseTypeName_simple', () {
5801 final __test = new SimpleParserTest();
5802 runJUnitTest(__test, __test.test_parseTypeName_simple);
5803 });
5804 _ut.test('test_parseTypeParameterList_multiple', () {
5805 final __test = new SimpleParserTest();
5806 runJUnitTest(__test, __test.test_parseTypeParameterList_multiple);
5807 });
5808 _ut.test('test_parseTypeParameterList_parameterizedWithTrailingEquals', () {
5809 final __test = new SimpleParserTest();
5810 runJUnitTest(__test, __test.test_parseTypeParameterList_parameterizedWit hTrailingEquals);
5811 });
5812 _ut.test('test_parseTypeParameterList_single', () {
5813 final __test = new SimpleParserTest();
5814 runJUnitTest(__test, __test.test_parseTypeParameterList_single);
5815 });
5816 _ut.test('test_parseTypeParameterList_withTrailingEquals', () {
5817 final __test = new SimpleParserTest();
5818 runJUnitTest(__test, __test.test_parseTypeParameterList_withTrailingEqua ls);
5819 });
5820 _ut.test('test_parseTypeParameter_bounded', () {
5821 final __test = new SimpleParserTest();
5822 runJUnitTest(__test, __test.test_parseTypeParameter_bounded);
5823 });
5824 _ut.test('test_parseTypeParameter_simple', () {
5825 final __test = new SimpleParserTest();
5826 runJUnitTest(__test, __test.test_parseTypeParameter_simple);
5827 });
5828 _ut.test('test_parseUnaryExpression_decrement_normal', () {
5829 final __test = new SimpleParserTest();
5830 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_normal);
5831 });
5832 _ut.test('test_parseUnaryExpression_decrement_super', () {
5833 final __test = new SimpleParserTest();
5834 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super);
5835 });
5836 _ut.test('test_parseUnaryExpression_decrement_super_propertyAccess', () {
5837 final __test = new SimpleParserTest();
5838 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super_pr opertyAccess);
5839 });
5840 _ut.test('test_parseUnaryExpression_increment_normal', () {
5841 final __test = new SimpleParserTest();
5842 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_normal);
5843 });
5844 _ut.test('test_parseUnaryExpression_increment_super_index', () {
5845 final __test = new SimpleParserTest();
5846 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_super_in dex);
5847 });
5848 _ut.test('test_parseUnaryExpression_increment_super_propertyAccess', () {
5849 final __test = new SimpleParserTest();
5850 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_super_pr opertyAccess);
5851 });
5852 _ut.test('test_parseUnaryExpression_minus_normal', () {
5853 final __test = new SimpleParserTest();
5854 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_normal);
5855 });
5856 _ut.test('test_parseUnaryExpression_minus_super', () {
5857 final __test = new SimpleParserTest();
5858 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_super);
5859 });
5860 _ut.test('test_parseUnaryExpression_not_normal', () {
5861 final __test = new SimpleParserTest();
5862 runJUnitTest(__test, __test.test_parseUnaryExpression_not_normal);
5863 });
5864 _ut.test('test_parseUnaryExpression_not_super', () {
5865 final __test = new SimpleParserTest();
5866 runJUnitTest(__test, __test.test_parseUnaryExpression_not_super);
5867 });
5868 _ut.test('test_parseUnaryExpression_tilda_normal', () {
5869 final __test = new SimpleParserTest();
5870 runJUnitTest(__test, __test.test_parseUnaryExpression_tilda_normal);
5871 });
5872 _ut.test('test_parseUnaryExpression_tilda_super', () {
5873 final __test = new SimpleParserTest();
5874 runJUnitTest(__test, __test.test_parseUnaryExpression_tilda_super);
5875 });
5876 _ut.test('test_parseVariableDeclarationList2_type', () {
5877 final __test = new SimpleParserTest();
5878 runJUnitTest(__test, __test.test_parseVariableDeclarationList2_type);
5879 });
5880 _ut.test('test_parseVariableDeclarationList2_var', () {
5881 final __test = new SimpleParserTest();
5882 runJUnitTest(__test, __test.test_parseVariableDeclarationList2_var);
5883 });
5884 _ut.test('test_parseVariableDeclarationList_const_noType', () {
5885 final __test = new SimpleParserTest();
5886 runJUnitTest(__test, __test.test_parseVariableDeclarationList_const_noTy pe);
5887 });
5888 _ut.test('test_parseVariableDeclarationList_const_type', () {
5889 final __test = new SimpleParserTest();
5890 runJUnitTest(__test, __test.test_parseVariableDeclarationList_const_type );
5891 });
5892 _ut.test('test_parseVariableDeclarationList_final_noType', () {
5893 final __test = new SimpleParserTest();
5894 runJUnitTest(__test, __test.test_parseVariableDeclarationList_final_noTy pe);
5895 });
5896 _ut.test('test_parseVariableDeclarationList_final_type', () {
5897 final __test = new SimpleParserTest();
5898 runJUnitTest(__test, __test.test_parseVariableDeclarationList_final_type );
5899 });
5900 _ut.test('test_parseVariableDeclarationList_type_multiple', () {
5901 final __test = new SimpleParserTest();
5902 runJUnitTest(__test, __test.test_parseVariableDeclarationList_type_multi ple);
5903 });
5904 _ut.test('test_parseVariableDeclarationList_type_single', () {
5905 final __test = new SimpleParserTest();
5906 runJUnitTest(__test, __test.test_parseVariableDeclarationList_type_singl e);
5907 });
5908 _ut.test('test_parseVariableDeclarationList_var_multiple', () {
5909 final __test = new SimpleParserTest();
5910 runJUnitTest(__test, __test.test_parseVariableDeclarationList_var_multip le);
5911 });
5912 _ut.test('test_parseVariableDeclarationList_var_single', () {
5913 final __test = new SimpleParserTest();
5914 runJUnitTest(__test, __test.test_parseVariableDeclarationList_var_single );
5915 });
5916 _ut.test('test_parseVariableDeclarationStatement_multiple', () {
5917 final __test = new SimpleParserTest();
5918 runJUnitTest(__test, __test.test_parseVariableDeclarationStatement_multi ple);
5919 });
5920 _ut.test('test_parseVariableDeclarationStatement_single', () {
5921 final __test = new SimpleParserTest();
5922 runJUnitTest(__test, __test.test_parseVariableDeclarationStatement_singl e);
5923 });
5924 _ut.test('test_parseVariableDeclaration_equals', () {
5925 final __test = new SimpleParserTest();
5926 runJUnitTest(__test, __test.test_parseVariableDeclaration_equals);
5927 });
5928 _ut.test('test_parseVariableDeclaration_noEquals', () {
5929 final __test = new SimpleParserTest();
5930 runJUnitTest(__test, __test.test_parseVariableDeclaration_noEquals);
5931 });
5932 _ut.test('test_parseWhileStatement', () {
5933 final __test = new SimpleParserTest();
5934 runJUnitTest(__test, __test.test_parseWhileStatement);
5935 });
5936 _ut.test('test_parseWithClause_multiple', () {
5937 final __test = new SimpleParserTest();
5938 runJUnitTest(__test, __test.test_parseWithClause_multiple);
5939 });
5940 _ut.test('test_parseWithClause_single', () {
5941 final __test = new SimpleParserTest();
5942 runJUnitTest(__test, __test.test_parseWithClause_single);
5943 });
5944 _ut.test('test_skipPrefixedIdentifier_invalid', () {
5945 final __test = new SimpleParserTest();
5946 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_invalid);
5947 });
5948 _ut.test('test_skipPrefixedIdentifier_notPrefixed', () {
5949 final __test = new SimpleParserTest();
5950 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_notPrefixed);
5951 });
5952 _ut.test('test_skipPrefixedIdentifier_prefixed', () {
5953 final __test = new SimpleParserTest();
5954 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_prefixed);
5955 });
5956 _ut.test('test_skipReturnType_invalid', () {
5957 final __test = new SimpleParserTest();
5958 runJUnitTest(__test, __test.test_skipReturnType_invalid);
5959 });
5960 _ut.test('test_skipReturnType_type', () {
5961 final __test = new SimpleParserTest();
5962 runJUnitTest(__test, __test.test_skipReturnType_type);
5963 });
5964 _ut.test('test_skipReturnType_void', () {
5965 final __test = new SimpleParserTest();
5966 runJUnitTest(__test, __test.test_skipReturnType_void);
5967 });
5968 _ut.test('test_skipSimpleIdentifier_identifier', () {
5969 final __test = new SimpleParserTest();
5970 runJUnitTest(__test, __test.test_skipSimpleIdentifier_identifier);
5971 });
5972 _ut.test('test_skipSimpleIdentifier_invalid', () {
5973 final __test = new SimpleParserTest();
5974 runJUnitTest(__test, __test.test_skipSimpleIdentifier_invalid);
5975 });
5976 _ut.test('test_skipSimpleIdentifier_pseudoKeyword', () {
5977 final __test = new SimpleParserTest();
5978 runJUnitTest(__test, __test.test_skipSimpleIdentifier_pseudoKeyword);
5979 });
5980 _ut.test('test_skipStringLiteral_adjacent', () {
5981 final __test = new SimpleParserTest();
5982 runJUnitTest(__test, __test.test_skipStringLiteral_adjacent);
5983 });
5984 _ut.test('test_skipStringLiteral_interpolated', () {
5985 final __test = new SimpleParserTest();
5986 runJUnitTest(__test, __test.test_skipStringLiteral_interpolated);
5987 });
5988 _ut.test('test_skipStringLiteral_invalid', () {
5989 final __test = new SimpleParserTest();
5990 runJUnitTest(__test, __test.test_skipStringLiteral_invalid);
5991 });
5992 _ut.test('test_skipStringLiteral_single', () {
5993 final __test = new SimpleParserTest();
5994 runJUnitTest(__test, __test.test_skipStringLiteral_single);
5995 });
5996 _ut.test('test_skipTypeArgumentList_invalid', () {
5997 final __test = new SimpleParserTest();
5998 runJUnitTest(__test, __test.test_skipTypeArgumentList_invalid);
5999 });
6000 _ut.test('test_skipTypeArgumentList_multiple', () {
6001 final __test = new SimpleParserTest();
6002 runJUnitTest(__test, __test.test_skipTypeArgumentList_multiple);
6003 });
6004 _ut.test('test_skipTypeArgumentList_single', () {
6005 final __test = new SimpleParserTest();
6006 runJUnitTest(__test, __test.test_skipTypeArgumentList_single);
6007 });
6008 _ut.test('test_skipTypeName_invalid', () {
6009 final __test = new SimpleParserTest();
6010 runJUnitTest(__test, __test.test_skipTypeName_invalid);
6011 });
6012 _ut.test('test_skipTypeName_parameterized', () {
6013 final __test = new SimpleParserTest();
6014 runJUnitTest(__test, __test.test_skipTypeName_parameterized);
6015 });
6016 _ut.test('test_skipTypeName_simple', () {
6017 final __test = new SimpleParserTest();
6018 runJUnitTest(__test, __test.test_skipTypeName_simple);
6019 });
6020 });
6021 }
6022 }
6023 class AnalysisErrorListener_24 implements AnalysisErrorListener {
6024 void onError(AnalysisError event) {
6025 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event. offset}, ${event.length})");
6026 }
6027 }
6028 /**
6029 * The class `ComplexParserTest` defines parser tests that test the parsing of m ore complex
6030 * code fragments or the interactions between multiple parsing methods. For exam ple, tests to ensure
6031 * that the precedence of operations is being handled correctly should be define d in this class.
6032 *
6033 * Simpler tests should be defined in the class [SimpleParserTest].
6034 */
6035 class ComplexParserTest extends ParserTestCase {
6036 void test_additiveExpression_normal() {
6037 BinaryExpression expression = ParserTestCase.parseExpression("x + y - z", [] );
6038 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6039 }
6040 void test_additiveExpression_noSpaces() {
6041 BinaryExpression expression = ParserTestCase.parseExpression("i+1", []);
6042 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6043 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightOperand);
6044 }
6045 void test_additiveExpression_precedence_multiplicative_left() {
6046 BinaryExpression expression = ParserTestCase.parseExpression("x * y + z", [] );
6047 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6048 }
6049 void test_additiveExpression_precedence_multiplicative_left_withSuper() {
6050 BinaryExpression expression = ParserTestCase.parseExpression("super * y - z" , []);
6051 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6052 }
6053 void test_additiveExpression_precedence_multiplicative_right() {
6054 BinaryExpression expression = ParserTestCase.parseExpression("x + y * z", [] );
6055 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6056 }
6057 void test_additiveExpression_super() {
6058 BinaryExpression expression = ParserTestCase.parseExpression("super + y - z" , []);
6059 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6060 }
6061 void test_assignableExpression_arguments_normal_chain() {
6062 PropertyAccess propertyAccess1 = ParserTestCase.parseExpression("a(b)(c).d(e ).f", []);
6063 JUnitTestCase.assertEquals("f", propertyAccess1.propertyName.name);
6064 MethodInvocation invocation2 = EngineTestCase.assertInstanceOf(MethodInvocat ion, propertyAccess1.target);
6065 JUnitTestCase.assertEquals("d", invocation2.methodName.name);
6066 ArgumentList argumentList2 = invocation2.argumentList;
6067 JUnitTestCase.assertNotNull(argumentList2);
6068 EngineTestCase.assertSize(1, argumentList2.arguments);
6069 FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf(F unctionExpressionInvocation, invocation2.target);
6070 ArgumentList argumentList3 = invocation3.argumentList;
6071 JUnitTestCase.assertNotNull(argumentList3);
6072 EngineTestCase.assertSize(1, argumentList3.arguments);
6073 MethodInvocation invocation4 = EngineTestCase.assertInstanceOf(MethodInvocat ion, invocation3.function);
6074 JUnitTestCase.assertEquals("a", invocation4.methodName.name);
6075 ArgumentList argumentList4 = invocation4.argumentList;
6076 JUnitTestCase.assertNotNull(argumentList4);
6077 EngineTestCase.assertSize(1, argumentList4.arguments);
6078 }
6079 void test_assignmentExpression_compound() {
6080 AssignmentExpression expression = ParserTestCase.parseExpression("x = y = 0" , []);
6081 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide);
6082 EngineTestCase.assertInstanceOf(AssignmentExpression, expression.rightHandSi de);
6083 }
6084 void test_assignmentExpression_indexExpression() {
6085 AssignmentExpression expression = ParserTestCase.parseExpression("x[1] = 0", []);
6086 EngineTestCase.assertInstanceOf(IndexExpression, expression.leftHandSide);
6087 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide);
6088 }
6089 void test_assignmentExpression_prefixedIdentifier() {
6090 AssignmentExpression expression = ParserTestCase.parseExpression("x.y = 0", []);
6091 EngineTestCase.assertInstanceOf(PrefixedIdentifier, expression.leftHandSide) ;
6092 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide);
6093 }
6094 void test_assignmentExpression_propertyAccess() {
6095 AssignmentExpression expression = ParserTestCase.parseExpression("super.y = 0", []);
6096 EngineTestCase.assertInstanceOf(PropertyAccess, expression.leftHandSide);
6097 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide);
6098 }
6099 void test_bitwiseAndExpression_normal() {
6100 BinaryExpression expression = ParserTestCase.parseExpression("x & y & z", [] );
6101 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6102 }
6103 void test_bitwiseAndExpression_precedence_equality_left() {
6104 BinaryExpression expression = ParserTestCase.parseExpression("x == y && z", []);
6105 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6106 }
6107 void test_bitwiseAndExpression_precedence_equality_right() {
6108 BinaryExpression expression = ParserTestCase.parseExpression("x && y == z", []);
6109 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6110 }
6111 void test_bitwiseAndExpression_super() {
6112 BinaryExpression expression = ParserTestCase.parseExpression("super & y & z" , []);
6113 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6114 }
6115 void test_bitwiseOrExpression_normal() {
6116 BinaryExpression expression = ParserTestCase.parseExpression("x | y | z", [] );
6117 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6118 }
6119 void test_bitwiseOrExpression_precedence_xor_left() {
6120 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y | z", [] );
6121 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6122 }
6123 void test_bitwiseOrExpression_precedence_xor_right() {
6124 BinaryExpression expression = ParserTestCase.parseExpression("x | y ^ z", [] );
6125 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6126 }
6127 void test_bitwiseOrExpression_super() {
6128 BinaryExpression expression = ParserTestCase.parseExpression("super | y | z" , []);
6129 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6130 }
6131 void test_bitwiseXorExpression_normal() {
6132 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y ^ z", [] );
6133 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6134 }
6135 void test_bitwiseXorExpression_precedence_and_left() {
6136 BinaryExpression expression = ParserTestCase.parseExpression("x & y ^ z", [] );
6137 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6138 }
6139 void test_bitwiseXorExpression_precedence_and_right() {
6140 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z", [] );
6141 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6142 }
6143 void test_bitwiseXorExpression_super() {
6144 BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z" , []);
6145 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6146 }
6147 void test_cascade_withAssignment() {
6148 CascadeExpression cascade = ParserTestCase.parseExpression("new Map()..[3] = 4 ..[0] = 11;", []);
6149 Expression target = cascade.target;
6150 for (Expression section in cascade.cascadeSections) {
6151 EngineTestCase.assertInstanceOf(AssignmentExpression, section);
6152 Expression lhs = ((section as AssignmentExpression)).leftHandSide;
6153 EngineTestCase.assertInstanceOf(IndexExpression, lhs);
6154 IndexExpression index = lhs as IndexExpression;
6155 JUnitTestCase.assertTrue(index.isCascaded);
6156 JUnitTestCase.assertSame(target, index.realTarget);
6157 }
6158 }
6159 void test_conditionalExpression_precedence_logicalOrExpression() {
6160 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y : z", []);
6161 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition);
6162 }
6163 void test_constructor_initializer_withParenthesizedExpression() {
6164 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr eateSource([
6165 "class C {",
6166 " C() :",
6167 " this.a = (b == null ? c : d) {",
6168 " }",
6169 "}"]), []);
6170 NodeList<CompilationUnitMember> declarations = unit.declarations;
6171 EngineTestCase.assertSize(1, declarations);
6172 }
6173 void test_equalityExpression_normal() {
6174 BinaryExpression expression = ParserTestCase.parseExpression("x == y != z", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
6175 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6176 }
6177 void test_equalityExpression_precedence_relational_left() {
6178 BinaryExpression expression = ParserTestCase.parseExpression("x is y == z", []);
6179 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand);
6180 }
6181 void test_equalityExpression_precedence_relational_right() {
6182 BinaryExpression expression = ParserTestCase.parseExpression("x == y is z", []);
6183 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand);
6184 }
6185 void test_equalityExpression_super() {
6186 BinaryExpression expression = ParserTestCase.parseExpression("super == y != z", [ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
6187 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6188 }
6189 void test_logicalAndExpression() {
6190 BinaryExpression expression = ParserTestCase.parseExpression("x && y && z", []);
6191 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6192 }
6193 void test_logicalAndExpression_precedence_bitwiseOr_left() {
6194 BinaryExpression expression = ParserTestCase.parseExpression("x | y < z", [] );
6195 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6196 }
6197 void test_logicalAndExpression_precedence_bitwiseOr_right() {
6198 BinaryExpression expression = ParserTestCase.parseExpression("x < y | z", [] );
6199 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6200 }
6201 void test_logicalOrExpression() {
6202 BinaryExpression expression = ParserTestCase.parseExpression("x || y || z", []);
6203 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6204 }
6205 void test_logicalOrExpression_precedence_logicalAnd_left() {
6206 BinaryExpression expression = ParserTestCase.parseExpression("x && y || z", []);
6207 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6208 }
6209 void test_logicalOrExpression_precedence_logicalAnd_right() {
6210 BinaryExpression expression = ParserTestCase.parseExpression("x || y && z", []);
6211 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6212 }
6213 void test_multipleLabels_statement() {
6214 LabeledStatement statement = ParserTestCase.parseStatement("a: b: c: return x;", []);
6215 EngineTestCase.assertSize(3, statement.labels);
6216 EngineTestCase.assertInstanceOf(ReturnStatement, statement.statement);
6217 }
6218 void test_multiplicativeExpression_normal() {
6219 BinaryExpression expression = ParserTestCase.parseExpression("x * y / z", [] );
6220 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6221 }
6222 void test_multiplicativeExpression_precedence_unary_left() {
6223 BinaryExpression expression = ParserTestCase.parseExpression("-x * y", []);
6224 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand);
6225 }
6226 void test_multiplicativeExpression_precedence_unary_right() {
6227 BinaryExpression expression = ParserTestCase.parseExpression("x * -y", []);
6228 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand);
6229 }
6230 void test_multiplicativeExpression_super() {
6231 BinaryExpression expression = ParserTestCase.parseExpression("super * y / z" , []);
6232 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6233 }
6234 void test_relationalExpression_precedence_shift_right() {
6235 IsExpression expression = ParserTestCase.parseExpression("x << y is z", []);
6236 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression);
6237 }
6238 void test_shiftExpression_normal() {
6239 BinaryExpression expression = ParserTestCase.parseExpression("x >> 4 << 3", []);
6240 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6241 }
6242 void test_shiftExpression_precedence_additive_left() {
6243 BinaryExpression expression = ParserTestCase.parseExpression("x + y << z", [ ]);
6244 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6245 }
6246 void test_shiftExpression_precedence_additive_right() {
6247 BinaryExpression expression = ParserTestCase.parseExpression("x << y + z", [ ]);
6248 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6249 }
6250 void test_shiftExpression_super() {
6251 BinaryExpression expression = ParserTestCase.parseExpression("super >> 4 << 3", []);
6252 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6253 }
6254 void test_topLevelVariable_withMetadata() {
6255 ParserTestCase.parseCompilationUnit("String @A string;", []);
6256 }
6257 static dartSuite() {
6258 _ut.group('ComplexParserTest', () {
6259 _ut.test('test_additiveExpression_noSpaces', () {
6260 final __test = new ComplexParserTest();
6261 runJUnitTest(__test, __test.test_additiveExpression_noSpaces);
6262 });
6263 _ut.test('test_additiveExpression_normal', () {
6264 final __test = new ComplexParserTest();
6265 runJUnitTest(__test, __test.test_additiveExpression_normal);
6266 });
6267 _ut.test('test_additiveExpression_precedence_multiplicative_left', () {
6268 final __test = new ComplexParserTest();
6269 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic ative_left);
6270 });
6271 _ut.test('test_additiveExpression_precedence_multiplicative_left_withSuper ', () {
6272 final __test = new ComplexParserTest();
6273 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic ative_left_withSuper);
6274 });
6275 _ut.test('test_additiveExpression_precedence_multiplicative_right', () {
6276 final __test = new ComplexParserTest();
6277 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic ative_right);
6278 });
6279 _ut.test('test_additiveExpression_super', () {
6280 final __test = new ComplexParserTest();
6281 runJUnitTest(__test, __test.test_additiveExpression_super);
6282 });
6283 _ut.test('test_assignableExpression_arguments_normal_chain', () {
6284 final __test = new ComplexParserTest();
6285 runJUnitTest(__test, __test.test_assignableExpression_arguments_normal_c hain);
6286 });
6287 _ut.test('test_assignmentExpression_compound', () {
6288 final __test = new ComplexParserTest();
6289 runJUnitTest(__test, __test.test_assignmentExpression_compound);
6290 });
6291 _ut.test('test_assignmentExpression_indexExpression', () {
6292 final __test = new ComplexParserTest();
6293 runJUnitTest(__test, __test.test_assignmentExpression_indexExpression);
6294 });
6295 _ut.test('test_assignmentExpression_prefixedIdentifier', () {
6296 final __test = new ComplexParserTest();
6297 runJUnitTest(__test, __test.test_assignmentExpression_prefixedIdentifier );
6298 });
6299 _ut.test('test_assignmentExpression_propertyAccess', () {
6300 final __test = new ComplexParserTest();
6301 runJUnitTest(__test, __test.test_assignmentExpression_propertyAccess);
6302 });
6303 _ut.test('test_bitwiseAndExpression_normal', () {
6304 final __test = new ComplexParserTest();
6305 runJUnitTest(__test, __test.test_bitwiseAndExpression_normal);
6306 });
6307 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () {
6308 final __test = new ComplexParserTest();
6309 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit y_left);
6310 });
6311 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () {
6312 final __test = new ComplexParserTest();
6313 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit y_right);
6314 });
6315 _ut.test('test_bitwiseAndExpression_super', () {
6316 final __test = new ComplexParserTest();
6317 runJUnitTest(__test, __test.test_bitwiseAndExpression_super);
6318 });
6319 _ut.test('test_bitwiseOrExpression_normal', () {
6320 final __test = new ComplexParserTest();
6321 runJUnitTest(__test, __test.test_bitwiseOrExpression_normal);
6322 });
6323 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () {
6324 final __test = new ComplexParserTest();
6325 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left );
6326 });
6327 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () {
6328 final __test = new ComplexParserTest();
6329 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ t);
6330 });
6331 _ut.test('test_bitwiseOrExpression_super', () {
6332 final __test = new ComplexParserTest();
6333 runJUnitTest(__test, __test.test_bitwiseOrExpression_super);
6334 });
6335 _ut.test('test_bitwiseXorExpression_normal', () {
6336 final __test = new ComplexParserTest();
6337 runJUnitTest(__test, __test.test_bitwiseXorExpression_normal);
6338 });
6339 _ut.test('test_bitwiseXorExpression_precedence_and_left', () {
6340 final __test = new ComplexParserTest();
6341 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef t);
6342 });
6343 _ut.test('test_bitwiseXorExpression_precedence_and_right', () {
6344 final __test = new ComplexParserTest();
6345 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig ht);
6346 });
6347 _ut.test('test_bitwiseXorExpression_super', () {
6348 final __test = new ComplexParserTest();
6349 runJUnitTest(__test, __test.test_bitwiseXorExpression_super);
6350 });
6351 _ut.test('test_cascade_withAssignment', () {
6352 final __test = new ComplexParserTest();
6353 runJUnitTest(__test, __test.test_cascade_withAssignment);
6354 });
6355 _ut.test('test_conditionalExpression_precedence_logicalOrExpression', () {
6356 final __test = new ComplexParserTest();
6357 runJUnitTest(__test, __test.test_conditionalExpression_precedence_logica lOrExpression);
6358 });
6359 _ut.test('test_constructor_initializer_withParenthesizedExpression', () {
6360 final __test = new ComplexParserTest();
6361 runJUnitTest(__test, __test.test_constructor_initializer_withParenthesiz edExpression);
6362 });
6363 _ut.test('test_equalityExpression_normal', () {
6364 final __test = new ComplexParserTest();
6365 runJUnitTest(__test, __test.test_equalityExpression_normal);
6366 });
6367 _ut.test('test_equalityExpression_precedence_relational_left', () {
6368 final __test = new ComplexParserTest();
6369 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa l_left);
6370 });
6371 _ut.test('test_equalityExpression_precedence_relational_right', () {
6372 final __test = new ComplexParserTest();
6373 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa l_right);
6374 });
6375 _ut.test('test_equalityExpression_super', () {
6376 final __test = new ComplexParserTest();
6377 runJUnitTest(__test, __test.test_equalityExpression_super);
6378 });
6379 _ut.test('test_logicalAndExpression', () {
6380 final __test = new ComplexParserTest();
6381 runJUnitTest(__test, __test.test_logicalAndExpression);
6382 });
6383 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () {
6384 final __test = new ComplexParserTest();
6385 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise Or_left);
6386 });
6387 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () {
6388 final __test = new ComplexParserTest();
6389 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise Or_right);
6390 });
6391 _ut.test('test_logicalOrExpression', () {
6392 final __test = new ComplexParserTest();
6393 runJUnitTest(__test, __test.test_logicalOrExpression);
6394 });
6395 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () {
6396 final __test = new ComplexParserTest();
6397 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_left);
6398 });
6399 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () {
6400 final __test = new ComplexParserTest();
6401 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_right);
6402 });
6403 _ut.test('test_multipleLabels_statement', () {
6404 final __test = new ComplexParserTest();
6405 runJUnitTest(__test, __test.test_multipleLabels_statement);
6406 });
6407 _ut.test('test_multiplicativeExpression_normal', () {
6408 final __test = new ComplexParserTest();
6409 runJUnitTest(__test, __test.test_multiplicativeExpression_normal);
6410 });
6411 _ut.test('test_multiplicativeExpression_precedence_unary_left', () {
6412 final __test = new ComplexParserTest();
6413 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una ry_left);
6414 });
6415 _ut.test('test_multiplicativeExpression_precedence_unary_right', () {
6416 final __test = new ComplexParserTest();
6417 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una ry_right);
6418 });
6419 _ut.test('test_multiplicativeExpression_super', () {
6420 final __test = new ComplexParserTest();
6421 runJUnitTest(__test, __test.test_multiplicativeExpression_super);
6422 });
6423 _ut.test('test_relationalExpression_precedence_shift_right', () {
6424 final __test = new ComplexParserTest();
6425 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r ight);
6426 });
6427 _ut.test('test_shiftExpression_normal', () {
6428 final __test = new ComplexParserTest();
6429 runJUnitTest(__test, __test.test_shiftExpression_normal);
6430 });
6431 _ut.test('test_shiftExpression_precedence_additive_left', () {
6432 final __test = new ComplexParserTest();
6433 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_lef t);
6434 });
6435 _ut.test('test_shiftExpression_precedence_additive_right', () {
6436 final __test = new ComplexParserTest();
6437 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_rig ht);
6438 });
6439 _ut.test('test_shiftExpression_super', () {
6440 final __test = new ComplexParserTest();
6441 runJUnitTest(__test, __test.test_shiftExpression_super);
6442 });
6443 _ut.test('test_topLevelVariable_withMetadata', () {
6444 final __test = new ComplexParserTest();
6445 runJUnitTest(__test, __test.test_topLevelVariable_withMetadata);
6446 });
6447 });
6448 }
6449 }
6450 /**
6451 * Instances of the class `ASTValidator` are used to validate the correct constr uction of an
6452 * AST structure.
6453 */
6454 class ASTValidator extends UnifyingASTVisitor<Object> {
6455
6456 /**
6457 * A list containing the errors found while traversing the AST structure.
6458 */
6459 List<String> _errors = new List<String>();
6460
6461 /**
6462 * Assert that no errors were found while traversing any of the AST structures that have been
6463 * visited.
6464 */
6465 void assertValid() {
6466 if (!_errors.isEmpty) {
6467 JavaStringBuilder builder = new JavaStringBuilder();
6468 builder.append("Invalid AST structure:");
6469 for (String message in _errors) {
6470 builder.append("\r\n ");
6471 builder.append(message);
6472 }
6473 JUnitTestCase.fail(builder.toString());
6474 }
6475 }
6476 Object visitNode(ASTNode node) {
6477 validate(node);
6478 return super.visitNode(node);
6479 }
6480
6481 /**
6482 * Validate that the given AST node is correctly constructed.
6483 *
6484 * @param node the AST node being validated
6485 */
6486 void validate(ASTNode node) {
6487 ASTNode parent = node.parent;
6488 if (node is CompilationUnit) {
6489 if (parent != null) {
6490 _errors.add("Compilation units should not have a parent");
6491 }
6492 } else {
6493 if (parent == null) {
6494 _errors.add("No parent for ${node.runtimeType.toString()}");
6495 }
6496 }
6497 if (node.beginToken == null) {
6498 _errors.add("No begin token for ${node.runtimeType.toString()}");
6499 }
6500 if (node.endToken == null) {
6501 _errors.add("No end token for ${node.runtimeType.toString()}");
6502 }
6503 int nodeStart = node.offset;
6504 int nodeLength = node.length;
6505 if (nodeStart < 0 || nodeLength < 0) {
6506 _errors.add("No source info for ${node.runtimeType.toString()}");
6507 }
6508 if (parent != null) {
6509 int nodeEnd = nodeStart + nodeLength;
6510 int parentStart = parent.offset;
6511 int parentEnd = parentStart + parent.length;
6512 if (nodeStart < parentStart) {
6513 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType. toString()} inside ${parent.runtimeType.toString()} (${parentStart})");
6514 }
6515 if (nodeEnd > parentEnd) {
6516 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt ring()} inside ${parent.runtimeType.toString()} (${parentStart})");
6517 }
6518 }
6519 }
6520 }
6521 class ParserTestCase extends EngineTestCase {
6522
6523 /**
6524 * An empty array of objects used as arguments to zero-argument methods.
6525 */
6526 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0);
6527
6528 /**
6529 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
6530 * type of parameters and will be invoked with the given arguments.
6531 *
6532 * The given source is scanned and the parser is initialized to start with the first token in the
6533 * source before the parse method is invoked.
6534 *
6535 * @param methodName the name of the parse method that should be invoked to pa rse the source
6536 * @param objects the values of the arguments to the method
6537 * @param source the source to be parsed by the parse method
6538 * @return the result of invoking the method
6539 * @throws Exception if the method could not be invoked or throws an exception
6540 * @throws AssertionFailedError if the result is `null` or if any errors are p roduced
6541 */
6542 static Object parse(String methodName, List<Object> objects, String source) => parse3(methodName, objects, source, new List<AnalysisError>(0));
6543
6544 /**
6545 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
6546 * type of parameters and will be invoked with the given arguments.
6547 *
6548 * The given source is scanned and the parser is initialized to start with the first token in the
6549 * source before the parse method is invoked.
6550 *
6551 * @param methodName the name of the parse method that should be invoked to pa rse the source
6552 * @param objects the values of the arguments to the method
6553 * @param source the source to be parsed by the parse method
6554 * @param errorCodes the error codes of the errors that should be generated
6555 * @return the result of invoking the method
6556 * @throws Exception if the method could not be invoked or throws an exception
6557 * @throws AssertionFailedError if the result is `null` or the errors produced while
6558 * scanning and parsing the source do not match the expected errors
6559 */
6560 static Object parse3(String methodName, List<Object> objects, String source, L ist<AnalysisError> errors) {
6561 GatheringErrorListener listener = new GatheringErrorListener();
6562 Object result = invokeParserMethod(methodName, objects, source, listener);
6563 listener.assertErrors(errors);
6564 return result;
6565 }
6566
6567 /**
6568 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
6569 * type of parameters and will be invoked with the given arguments.
6570 *
6571 * The given source is scanned and the parser is initialized to start with the first token in the
6572 * source before the parse method is invoked.
6573 *
6574 * @param methodName the name of the parse method that should be invoked to pa rse the source
6575 * @param objects the values of the arguments to the method
6576 * @param source the source to be parsed by the parse method
6577 * @param errorCodes the error codes of the errors that should be generated
6578 * @return the result of invoking the method
6579 * @throws Exception if the method could not be invoked or throws an exception
6580 * @throws AssertionFailedError if the result is `null` or the errors produced while
6581 * scanning and parsing the source do not match the expected errors
6582 */
6583 static Object parse4(String methodName, List<Object> objects, String source, L ist<ErrorCode> errorCodes) {
6584 GatheringErrorListener listener = new GatheringErrorListener();
6585 Object result = invokeParserMethod(methodName, objects, source, listener);
6586 listener.assertErrors2(errorCodes);
6587 return result;
6588 }
6589
6590 /**
6591 * Invoke a parse method in [Parser]. The method is assumed to have no argumen ts.
6592 *
6593 * The given source is scanned and the parser is initialized to start with the first token in the
6594 * source before the parse method is invoked.
6595 *
6596 * @param methodName the name of the parse method that should be invoked to pa rse the source
6597 * @param source the source to be parsed by the parse method
6598 * @param errorCodes the error codes of the errors that should be generated
6599 * @return the result of invoking the method
6600 * @throws Exception if the method could not be invoked or throws an exception
6601 * @throws AssertionFailedError if the result is `null` or the errors produced while
6602 * scanning and parsing the source do not match the expected errors
6603 */
6604 static Object parse5(String methodName, String source, List<ErrorCode> errorCo des) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
6605
6606 /**
6607 * Parse the given source as a compilation unit.
6608 *
6609 * @param source the source to be parsed
6610 * @param errorCodes the error codes of the errors that are expected to be fou nd
6611 * @return the compilation unit that was parsed
6612 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do
6613 * not match those that are expected, or if the result would have be en `null`
6614 */
6615 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err orCodes) {
6616 GatheringErrorListener listener = new GatheringErrorListener();
6617 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
6618 listener.setLineInfo(new TestSource(), scanner.lineStarts);
6619 Token token = scanner.tokenize();
6620 Parser parser = new Parser(null, listener);
6621 CompilationUnit unit = parser.parseCompilationUnit(token);
6622 JUnitTestCase.assertNotNull(unit);
6623 listener.assertErrors2(errorCodes);
6624 return unit;
6625 }
6626
6627 /**
6628 * Parse the given source as an expression.
6629 *
6630 * @param source the source to be parsed
6631 * @param errorCodes the error codes of the errors that are expected to be fou nd
6632 * @return the expression that was parsed
6633 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do
6634 * not match those that are expected, or if the result would have be en `null`
6635 */
6636 static Expression parseExpression(String source, List<ErrorCode> errorCodes) {
6637 GatheringErrorListener listener = new GatheringErrorListener();
6638 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
6639 listener.setLineInfo(new TestSource(), scanner.lineStarts);
6640 Token token = scanner.tokenize();
6641 Parser parser = new Parser(null, listener);
6642 Expression expression = parser.parseExpression(token);
6643 JUnitTestCase.assertNotNull(expression);
6644 listener.assertErrors2(errorCodes);
6645 return expression as Expression;
6646 }
6647
6648 /**
6649 * Parse the given source as a statement.
6650 *
6651 * @param source the source to be parsed
6652 * @param errorCodes the error codes of the errors that are expected to be fou nd
6653 * @return the statement that was parsed
6654 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do
6655 * not match those that are expected, or if the result would have be en `null`
6656 */
6657 static Statement parseStatement(String source, List<ErrorCode> errorCodes) {
6658 GatheringErrorListener listener = new GatheringErrorListener();
6659 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
6660 listener.setLineInfo(new TestSource(), scanner.lineStarts);
6661 Token token = scanner.tokenize();
6662 Parser parser = new Parser(null, listener);
6663 Statement statement = parser.parseStatement(token);
6664 JUnitTestCase.assertNotNull(statement);
6665 listener.assertErrors2(errorCodes);
6666 return statement as Statement;
6667 }
6668
6669 /**
6670 * Parse the given source as a sequence of statements.
6671 *
6672 * @param source the source to be parsed
6673 * @param expectedCount the number of statements that are expected
6674 * @param errorCodes the error codes of the errors that are expected to be fou nd
6675 * @return the statements that were parsed
6676 * @throws Exception if the source could not be parsed, if the number of state ments does not match
6677 * the expected count, if the compilation errors in the source do no t match those that
6678 * are expected, or if the result would have been `null`
6679 */
6680 static List<Statement> parseStatements(String source, int expectedCount, List< ErrorCode> errorCodes) {
6681 GatheringErrorListener listener = new GatheringErrorListener();
6682 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
6683 listener.setLineInfo(new TestSource(), scanner.lineStarts);
6684 Token token = scanner.tokenize();
6685 Parser parser = new Parser(null, listener);
6686 List<Statement> statements = parser.parseStatements(token);
6687 EngineTestCase.assertSize(expectedCount, statements);
6688 listener.assertErrors2(errorCodes);
6689 return statements;
6690 }
6691
6692 /**
6693 * Invoke a method in [Parser]. The method is assumed to have the given number and type of
6694 * parameters and will be invoked with the given arguments.
6695 *
6696 * The given source is scanned and the parser is initialized to start with the first token in the
6697 * source before the method is invoked.
6698 *
6699 * @param methodName the name of the method that should be invoked
6700 * @param objects the values of the arguments to the method
6701 * @param source the source to be processed by the parse method
6702 * @param listener the error listener that will be used for both scanning and parsing
6703 * @return the result of invoking the method
6704 * @throws Exception if the method could not be invoked or throws an exception
6705 * @throws AssertionFailedError if the result is `null` or the errors produced while
6706 * scanning and parsing the source do not match the expected errors
6707 */
6708 static Object invokeParserMethod(String methodName, List<Object> objects, Stri ng source, GatheringErrorListener listener) {
6709 Scanner scanner = new Scanner(null, new CharSequenceReader(new CharSequence( source)), listener);
6710 Token tokenStream = scanner.tokenize();
6711 listener.setLineInfo(new TestSource(), scanner.lineStarts);
6712 Parser parser = new Parser(null, listener);
6713 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr eam);
6714 if (!listener.hasErrors()) {
6715 JUnitTestCase.assertNotNull(result);
6716 }
6717 return result as Object;
6718 }
6719
6720 /**
6721 * Invoke a method in [Parser]. The method is assumed to have no arguments.
6722 *
6723 * The given source is scanned and the parser is initialized to start with the first token in the
6724 * source before the method is invoked.
6725 *
6726 * @param methodName the name of the method that should be invoked
6727 * @param source the source to be processed by the parse method
6728 * @param listener the error listener that will be used for both scanning and parsing
6729 * @return the result of invoking the method
6730 * @throws Exception if the method could not be invoked or throws an exception
6731 * @throws AssertionFailedError if the result is `null` or the errors produced while
6732 * scanning and parsing the source do not match the expected errors
6733 */
6734 static Object invokeParserMethod2(String methodName, String source, GatheringE rrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, sourc e, listener);
6735
6736 /**
6737 * Return a CommentAndMetadata object with the given values that can be used f or testing.
6738 *
6739 * @param comment the comment to be wrapped in the object
6740 * @param annotations the annotations to be wrapped in the object
6741 * @return a CommentAndMetadata object that can be used for testing
6742 */
6743 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota tions) {
6744 List<Annotation> metadata = new List<Annotation>();
6745 for (Annotation annotation in annotations) {
6746 metadata.add(annotation);
6747 }
6748 return new CommentAndMetadata(comment, metadata);
6749 }
6750
6751 /**
6752 * Return an empty CommentAndMetadata object that can be used for testing.
6753 *
6754 * @return an empty CommentAndMetadata object that can be used for testing
6755 */
6756 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n ew List<Annotation>());
6757 static dartSuite() {
6758 _ut.group('ParserTestCase', () {
6759 });
6760 }
6761 }
6762 /**
6763 * The class `RecoveryParserTest` defines parser tests that test the parsing of invalid code
6764 * sequences to ensure that the correct recovery steps are taken in the parser.
6765 */
6766 class RecoveryParserTest extends ParserTestCase {
6767 void fail_incomplete_returnType() {
6768 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource([
6769 "Map<Symbol, convertStringToSymbolMap(Map<String, dynamic> map) {",
6770 " if (map == null) return null;",
6771 " Map<Symbol, dynamic> result = new Map<Symbol, dynamic>();",
6772 " map.forEach((name, value) {",
6773 " result[new Symbol(name)] = value;",
6774 " });",
6775 " return result;",
6776 "}"]), []);
6777 }
6778 void test_additiveExpression_missing_LHS() {
6779 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE rrorCode.MISSING_IDENTIFIER]);
6780 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6781 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6782 }
6783 void test_additiveExpression_missing_LHS_RHS() {
6784 BinaryExpression expression = ParserTestCase.parseExpression("+", [
6785 ParserErrorCode.MISSING_IDENTIFIER,
6786 ParserErrorCode.MISSING_IDENTIFIER]);
6787 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6788 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6789 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6790 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6791 }
6792 void test_additiveExpression_missing_RHS() {
6793 BinaryExpression expression = ParserTestCase.parseExpression("x +", [ParserE rrorCode.MISSING_IDENTIFIER]);
6794 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6795 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6796 }
6797 void test_additiveExpression_missing_RHS_super() {
6798 BinaryExpression expression = ParserTestCase.parseExpression("super +", [Par serErrorCode.MISSING_IDENTIFIER]);
6799 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6800 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6801 }
6802 void test_additiveExpression_precedence_multiplicative_left() {
6803 BinaryExpression expression = ParserTestCase.parseExpression("* +", [
6804 ParserErrorCode.MISSING_IDENTIFIER,
6805 ParserErrorCode.MISSING_IDENTIFIER,
6806 ParserErrorCode.MISSING_IDENTIFIER]);
6807 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6808 }
6809 void test_additiveExpression_precedence_multiplicative_right() {
6810 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [
6811 ParserErrorCode.MISSING_IDENTIFIER,
6812 ParserErrorCode.MISSING_IDENTIFIER,
6813 ParserErrorCode.MISSING_IDENTIFIER]);
6814 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6815 }
6816 void test_additiveExpression_super() {
6817 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [
6818 ParserErrorCode.MISSING_IDENTIFIER,
6819 ParserErrorCode.MISSING_IDENTIFIER]);
6820 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6821 }
6822 void test_assignmentExpression_missing_compound1() {
6823 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
6824 Expression syntheticExpression = expression.leftHandSide;
6825 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6826 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
6827 }
6828 void test_assignmentExpression_missing_compound2() {
6829 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0", [ParserErrorCode.MISSING_IDENTIFIER]);
6830 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp ression)).leftHandSide;
6831 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6832 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
6833 }
6834 void test_assignmentExpression_missing_compound3() {
6835 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =", [ParserErrorCode.MISSING_IDENTIFIER]);
6836 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp ression)).rightHandSide;
6837 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6838 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
6839 }
6840 void test_assignmentExpression_missing_LHS() {
6841 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", [Par serErrorCode.MISSING_IDENTIFIER]);
6842 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide);
6843 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic);
6844 }
6845 void test_assignmentExpression_missing_RHS() {
6846 AssignmentExpression expression = ParserTestCase.parseExpression("x =", [Par serErrorCode.MISSING_IDENTIFIER]);
6847 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide);
6848 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic);
6849 }
6850 void test_bitwiseAndExpression_missing_LHS() {
6851 BinaryExpression expression = ParserTestCase.parseExpression("& y", [ParserE rrorCode.MISSING_IDENTIFIER]);
6852 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6853 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6854 }
6855 void test_bitwiseAndExpression_missing_LHS_RHS() {
6856 BinaryExpression expression = ParserTestCase.parseExpression("&", [
6857 ParserErrorCode.MISSING_IDENTIFIER,
6858 ParserErrorCode.MISSING_IDENTIFIER]);
6859 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6860 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6861 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6862 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6863 }
6864 void test_bitwiseAndExpression_missing_RHS() {
6865 BinaryExpression expression = ParserTestCase.parseExpression("x &", [ParserE rrorCode.MISSING_IDENTIFIER]);
6866 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6867 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6868 }
6869 void test_bitwiseAndExpression_missing_RHS_super() {
6870 BinaryExpression expression = ParserTestCase.parseExpression("super &", [Par serErrorCode.MISSING_IDENTIFIER]);
6871 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6872 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6873 }
6874 void test_bitwiseAndExpression_precedence_equality_left() {
6875 BinaryExpression expression = ParserTestCase.parseExpression("== &&", [
6876 ParserErrorCode.MISSING_IDENTIFIER,
6877 ParserErrorCode.MISSING_IDENTIFIER,
6878 ParserErrorCode.MISSING_IDENTIFIER]);
6879 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6880 }
6881 void test_bitwiseAndExpression_precedence_equality_right() {
6882 BinaryExpression expression = ParserTestCase.parseExpression("&& ==", [
6883 ParserErrorCode.MISSING_IDENTIFIER,
6884 ParserErrorCode.MISSING_IDENTIFIER,
6885 ParserErrorCode.MISSING_IDENTIFIER]);
6886 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6887 }
6888 void test_bitwiseAndExpression_super() {
6889 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
6890 ParserErrorCode.MISSING_IDENTIFIER,
6891 ParserErrorCode.MISSING_IDENTIFIER]);
6892 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6893 }
6894 void test_bitwiseOrExpression_missing_LHS() {
6895 BinaryExpression expression = ParserTestCase.parseExpression("| y", [ParserE rrorCode.MISSING_IDENTIFIER]);
6896 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6897 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6898 }
6899 void test_bitwiseOrExpression_missing_LHS_RHS() {
6900 BinaryExpression expression = ParserTestCase.parseExpression("|", [
6901 ParserErrorCode.MISSING_IDENTIFIER,
6902 ParserErrorCode.MISSING_IDENTIFIER]);
6903 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6904 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6905 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6906 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6907 }
6908 void test_bitwiseOrExpression_missing_RHS() {
6909 BinaryExpression expression = ParserTestCase.parseExpression("x |", [ParserE rrorCode.MISSING_IDENTIFIER]);
6910 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6911 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6912 }
6913 void test_bitwiseOrExpression_missing_RHS_super() {
6914 BinaryExpression expression = ParserTestCase.parseExpression("super |", [Par serErrorCode.MISSING_IDENTIFIER]);
6915 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6916 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6917 }
6918 void test_bitwiseOrExpression_precedence_xor_left() {
6919 BinaryExpression expression = ParserTestCase.parseExpression("^ |", [
6920 ParserErrorCode.MISSING_IDENTIFIER,
6921 ParserErrorCode.MISSING_IDENTIFIER,
6922 ParserErrorCode.MISSING_IDENTIFIER]);
6923 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6924 }
6925 void test_bitwiseOrExpression_precedence_xor_right() {
6926 BinaryExpression expression = ParserTestCase.parseExpression("| ^", [
6927 ParserErrorCode.MISSING_IDENTIFIER,
6928 ParserErrorCode.MISSING_IDENTIFIER,
6929 ParserErrorCode.MISSING_IDENTIFIER]);
6930 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6931 }
6932 void test_bitwiseOrExpression_super() {
6933 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
6934 ParserErrorCode.MISSING_IDENTIFIER,
6935 ParserErrorCode.MISSING_IDENTIFIER]);
6936 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6937 }
6938 void test_bitwiseXorExpression_missing_LHS() {
6939 BinaryExpression expression = ParserTestCase.parseExpression("^ y", [ParserE rrorCode.MISSING_IDENTIFIER]);
6940 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6941 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6942 }
6943 void test_bitwiseXorExpression_missing_LHS_RHS() {
6944 BinaryExpression expression = ParserTestCase.parseExpression("^", [
6945 ParserErrorCode.MISSING_IDENTIFIER,
6946 ParserErrorCode.MISSING_IDENTIFIER]);
6947 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6948 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6949 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6950 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6951 }
6952 void test_bitwiseXorExpression_missing_RHS() {
6953 BinaryExpression expression = ParserTestCase.parseExpression("x ^", [ParserE rrorCode.MISSING_IDENTIFIER]);
6954 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6955 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6956 }
6957 void test_bitwiseXorExpression_missing_RHS_super() {
6958 BinaryExpression expression = ParserTestCase.parseExpression("super ^", [Par serErrorCode.MISSING_IDENTIFIER]);
6959 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
6960 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
6961 }
6962 void test_bitwiseXorExpression_precedence_and_left() {
6963 BinaryExpression expression = ParserTestCase.parseExpression("& ^", [
6964 ParserErrorCode.MISSING_IDENTIFIER,
6965 ParserErrorCode.MISSING_IDENTIFIER,
6966 ParserErrorCode.MISSING_IDENTIFIER]);
6967 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6968 }
6969 void test_bitwiseXorExpression_precedence_and_right() {
6970 BinaryExpression expression = ParserTestCase.parseExpression("^ &", [
6971 ParserErrorCode.MISSING_IDENTIFIER,
6972 ParserErrorCode.MISSING_IDENTIFIER,
6973 ParserErrorCode.MISSING_IDENTIFIER]);
6974 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6975 }
6976 void test_bitwiseXorExpression_super() {
6977 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
6978 ParserErrorCode.MISSING_IDENTIFIER,
6979 ParserErrorCode.MISSING_IDENTIFIER]);
6980 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6981 }
6982 void test_classTypeAlias_withBody() {
6983 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {} ", "class B = Object with A {}"]), [ParserErrorCode.EXPECTED_TOKEN]);
6984 }
6985 void test_conditionalExpression_missingElse() {
6986 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]);
6987 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression) ;
6988 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic);
6989 }
6990 void test_conditionalExpression_missingThen() {
6991 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]);
6992 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression) ;
6993 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic);
6994 }
6995 void test_equalityExpression_missing_LHS() {
6996 BinaryExpression expression = ParserTestCase.parseExpression("== y", [Parser ErrorCode.MISSING_IDENTIFIER]);
6997 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6998 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
6999 }
7000 void test_equalityExpression_missing_LHS_RHS() {
7001 BinaryExpression expression = ParserTestCase.parseExpression("==", [
7002 ParserErrorCode.MISSING_IDENTIFIER,
7003 ParserErrorCode.MISSING_IDENTIFIER]);
7004 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7005 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7006 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7007 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7008 }
7009 void test_equalityExpression_missing_RHS() {
7010 BinaryExpression expression = ParserTestCase.parseExpression("x ==", [Parser ErrorCode.MISSING_IDENTIFIER]);
7011 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7012 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7013 }
7014 void test_equalityExpression_missing_RHS_super() {
7015 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [Pa rserErrorCode.MISSING_IDENTIFIER]);
7016 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7017 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7018 }
7019 void test_equalityExpression_precedence_relational_left() {
7020 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [
7021 ParserErrorCode.EXPECTED_TYPE_NAME,
7022 ParserErrorCode.MISSING_IDENTIFIER,
7023 ParserErrorCode.MISSING_IDENTIFIER]);
7024 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand);
7025 }
7026 void test_equalityExpression_precedence_relational_right() {
7027 BinaryExpression expression = ParserTestCase.parseExpression("== is", [
7028 ParserErrorCode.EXPECTED_TYPE_NAME,
7029 ParserErrorCode.MISSING_IDENTIFIER,
7030 ParserErrorCode.MISSING_IDENTIFIER]);
7031 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand);
7032 }
7033 void test_equalityExpression_super() {
7034 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", [
7035 ParserErrorCode.MISSING_IDENTIFIER,
7036 ParserErrorCode.MISSING_IDENTIFIER,
7037 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
7038 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7039 }
7040 void test_expressionList_multiple_end() {
7041 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2, 3, 4", [ParserErrorCode.MISSING_IDENTIFIER]);
7042 EngineTestCase.assertSize(4, result);
7043 Expression syntheticExpression = result[0];
7044 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
7045 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
7046 }
7047 void test_expressionList_multiple_middle() {
7048 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , , 4", [ParserErrorCode.MISSING_IDENTIFIER]);
7049 EngineTestCase.assertSize(4, result);
7050 Expression syntheticExpression = result[2];
7051 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
7052 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
7053 }
7054 void test_expressionList_multiple_start() {
7055 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3,", [ParserErrorCode.MISSING_IDENTIFIER]);
7056 EngineTestCase.assertSize(4, result);
7057 Expression syntheticExpression = result[3];
7058 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
7059 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
7060 }
7061 void test_incomplete_topLevelVariable() {
7062 CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [Parser ErrorCode.EXPECTED_EXECUTABLE]);
7063 NodeList<CompilationUnitMember> declarations = unit.declarations;
7064 EngineTestCase.assertSize(1, declarations);
7065 CompilationUnitMember member = declarations[0];
7066 EngineTestCase.assertInstanceOf(TopLevelVariableDeclaration, member);
7067 NodeList<VariableDeclaration> variables = ((member as TopLevelVariableDeclar ation)).variables.variables;
7068 EngineTestCase.assertSize(1, variables);
7069 SimpleIdentifier name = variables[0].name;
7070 JUnitTestCase.assertTrue(name.isSynthetic);
7071 }
7072 void test_isExpression_noType() {
7073 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T exte nds Foo> {m(x){if (x is ) return;if (x is !)}}", [
7074 ParserErrorCode.EXPECTED_TYPE_NAME,
7075 ParserErrorCode.EXPECTED_TYPE_NAME,
7076 ParserErrorCode.MISSING_STATEMENT]);
7077 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
7078 MethodDeclaration method = declaration.members[0] as MethodDeclaration;
7079 BlockFunctionBody body = method.body as BlockFunctionBody;
7080 IfStatement ifStatement = body.block.statements[1] as IfStatement;
7081 IsExpression expression = ifStatement.condition as IsExpression;
7082 JUnitTestCase.assertNotNull(expression.expression);
7083 JUnitTestCase.assertNotNull(expression.isOperator);
7084 JUnitTestCase.assertNotNull(expression.notOperator);
7085 TypeName type = expression.type;
7086 JUnitTestCase.assertNotNull(type);
7087 JUnitTestCase.assertTrue(type.name.isSynthetic);
7088 EngineTestCase.assertInstanceOf(EmptyStatement, ifStatement.thenStatement);
7089 }
7090 void test_logicalAndExpression_missing_LHS() {
7091 BinaryExpression expression = ParserTestCase.parseExpression("&& y", [Parser ErrorCode.MISSING_IDENTIFIER]);
7092 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7093 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7094 }
7095 void test_logicalAndExpression_missing_LHS_RHS() {
7096 BinaryExpression expression = ParserTestCase.parseExpression("&&", [
7097 ParserErrorCode.MISSING_IDENTIFIER,
7098 ParserErrorCode.MISSING_IDENTIFIER]);
7099 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7100 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7101 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7102 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7103 }
7104 void test_logicalAndExpression_missing_RHS() {
7105 BinaryExpression expression = ParserTestCase.parseExpression("x &&", [Parser ErrorCode.MISSING_IDENTIFIER]);
7106 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7107 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7108 }
7109 void test_logicalAndExpression_precedence_bitwiseOr_left() {
7110 BinaryExpression expression = ParserTestCase.parseExpression("| &&", [
7111 ParserErrorCode.MISSING_IDENTIFIER,
7112 ParserErrorCode.MISSING_IDENTIFIER,
7113 ParserErrorCode.MISSING_IDENTIFIER]);
7114 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7115 }
7116 void test_logicalAndExpression_precedence_bitwiseOr_right() {
7117 BinaryExpression expression = ParserTestCase.parseExpression("&& |", [
7118 ParserErrorCode.MISSING_IDENTIFIER,
7119 ParserErrorCode.MISSING_IDENTIFIER,
7120 ParserErrorCode.MISSING_IDENTIFIER]);
7121 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
7122 }
7123 void test_logicalOrExpression_missing_LHS() {
7124 BinaryExpression expression = ParserTestCase.parseExpression("|| y", [Parser ErrorCode.MISSING_IDENTIFIER]);
7125 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7126 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7127 }
7128 void test_logicalOrExpression_missing_LHS_RHS() {
7129 BinaryExpression expression = ParserTestCase.parseExpression("||", [
7130 ParserErrorCode.MISSING_IDENTIFIER,
7131 ParserErrorCode.MISSING_IDENTIFIER]);
7132 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7133 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7134 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7135 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7136 }
7137 void test_logicalOrExpression_missing_RHS() {
7138 BinaryExpression expression = ParserTestCase.parseExpression("x ||", [Parser ErrorCode.MISSING_IDENTIFIER]);
7139 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7140 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7141 }
7142 void test_logicalOrExpression_precedence_logicalAnd_left() {
7143 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", [
7144 ParserErrorCode.MISSING_IDENTIFIER,
7145 ParserErrorCode.MISSING_IDENTIFIER,
7146 ParserErrorCode.MISSING_IDENTIFIER]);
7147 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7148 }
7149 void test_logicalOrExpression_precedence_logicalAnd_right() {
7150 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [
7151 ParserErrorCode.MISSING_IDENTIFIER,
7152 ParserErrorCode.MISSING_IDENTIFIER,
7153 ParserErrorCode.MISSING_IDENTIFIER]);
7154 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
7155 }
7156 void test_multiplicativeExpression_missing_LHS() {
7157 BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserE rrorCode.MISSING_IDENTIFIER]);
7158 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7159 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7160 }
7161 void test_multiplicativeExpression_missing_LHS_RHS() {
7162 BinaryExpression expression = ParserTestCase.parseExpression("*", [
7163 ParserErrorCode.MISSING_IDENTIFIER,
7164 ParserErrorCode.MISSING_IDENTIFIER]);
7165 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7166 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7167 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7168 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7169 }
7170 void test_multiplicativeExpression_missing_RHS() {
7171 BinaryExpression expression = ParserTestCase.parseExpression("x *", [ParserE rrorCode.MISSING_IDENTIFIER]);
7172 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7173 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7174 }
7175 void test_multiplicativeExpression_missing_RHS_super() {
7176 BinaryExpression expression = ParserTestCase.parseExpression("super *", [Par serErrorCode.MISSING_IDENTIFIER]);
7177 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7178 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7179 }
7180 void test_multiplicativeExpression_precedence_unary_left() {
7181 BinaryExpression expression = ParserTestCase.parseExpression("-x *", [Parser ErrorCode.MISSING_IDENTIFIER]);
7182 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand);
7183 }
7184 void test_multiplicativeExpression_precedence_unary_right() {
7185 BinaryExpression expression = ParserTestCase.parseExpression("* -y", [Parser ErrorCode.MISSING_IDENTIFIER]);
7186 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand);
7187 }
7188 void test_multiplicativeExpression_super() {
7189 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", [
7190 ParserErrorCode.MISSING_IDENTIFIER,
7191 ParserErrorCode.MISSING_IDENTIFIER,
7192 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
7193 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7194 }
7195 void test_prefixExpression_missing_operand_minus() {
7196 PrefixExpression expression = ParserTestCase.parseExpression("-", [ParserErr orCode.MISSING_IDENTIFIER]);
7197 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand);
7198 JUnitTestCase.assertTrue(expression.operand.isSynthetic);
7199 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
7200 }
7201 void test_relationalExpression_missing_LHS() {
7202 IsExpression expression = ParserTestCase.parseExpression("is y", [ParserErro rCode.MISSING_IDENTIFIER]);
7203 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression);
7204 JUnitTestCase.assertTrue(expression.expression.isSynthetic);
7205 }
7206 void test_relationalExpression_missing_LHS_RHS() {
7207 IsExpression expression = ParserTestCase.parseExpression("is", [
7208 ParserErrorCode.EXPECTED_TYPE_NAME,
7209 ParserErrorCode.MISSING_IDENTIFIER]);
7210 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression);
7211 JUnitTestCase.assertTrue(expression.expression.isSynthetic);
7212 EngineTestCase.assertInstanceOf(TypeName, expression.type);
7213 JUnitTestCase.assertTrue(expression.type.isSynthetic);
7214 }
7215 void test_relationalExpression_missing_RHS() {
7216 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro rCode.EXPECTED_TYPE_NAME]);
7217 EngineTestCase.assertInstanceOf(TypeName, expression.type);
7218 JUnitTestCase.assertTrue(expression.type.isSynthetic);
7219 }
7220 void test_relationalExpression_precedence_shift_right() {
7221 IsExpression expression = ParserTestCase.parseExpression("<< is", [
7222 ParserErrorCode.EXPECTED_TYPE_NAME,
7223 ParserErrorCode.MISSING_IDENTIFIER,
7224 ParserErrorCode.MISSING_IDENTIFIER]);
7225 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression);
7226 }
7227 void test_shiftExpression_missing_LHS() {
7228 BinaryExpression expression = ParserTestCase.parseExpression("<< y", [Parser ErrorCode.MISSING_IDENTIFIER]);
7229 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7230 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7231 }
7232 void test_shiftExpression_missing_LHS_RHS() {
7233 BinaryExpression expression = ParserTestCase.parseExpression("<<", [
7234 ParserErrorCode.MISSING_IDENTIFIER,
7235 ParserErrorCode.MISSING_IDENTIFIER]);
7236 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
7237 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
7238 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7239 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7240 }
7241 void test_shiftExpression_missing_RHS() {
7242 BinaryExpression expression = ParserTestCase.parseExpression("x <<", [Parser ErrorCode.MISSING_IDENTIFIER]);
7243 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7244 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7245 }
7246 void test_shiftExpression_missing_RHS_super() {
7247 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [Pa rserErrorCode.MISSING_IDENTIFIER]);
7248 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand);
7249 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic);
7250 }
7251 void test_shiftExpression_precedence_unary_left() {
7252 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [
7253 ParserErrorCode.MISSING_IDENTIFIER,
7254 ParserErrorCode.MISSING_IDENTIFIER,
7255 ParserErrorCode.MISSING_IDENTIFIER]);
7256 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7257 }
7258 void test_shiftExpression_precedence_unary_right() {
7259 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [
7260 ParserErrorCode.MISSING_IDENTIFIER,
7261 ParserErrorCode.MISSING_IDENTIFIER,
7262 ParserErrorCode.MISSING_IDENTIFIER]);
7263 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
7264 }
7265 void test_shiftExpression_super() {
7266 BinaryExpression expression = ParserTestCase.parseExpression("super << <<", [
7267 ParserErrorCode.MISSING_IDENTIFIER,
7268 ParserErrorCode.MISSING_IDENTIFIER]);
7269 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
7270 }
7271 void test_typedef_eof() {
7272 CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [
7273 ParserErrorCode.EXPECTED_TOKEN,
7274 ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]);
7275 NodeList<CompilationUnitMember> declarations = unit.declarations;
7276 EngineTestCase.assertSize(1, declarations);
7277 CompilationUnitMember member = declarations[0];
7278 EngineTestCase.assertInstanceOf(FunctionTypeAlias, member);
7279 }
7280 static dartSuite() {
7281 _ut.group('RecoveryParserTest', () {
7282 _ut.test('test_additiveExpression_missing_LHS', () {
7283 final __test = new RecoveryParserTest();
7284 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS);
7285 });
7286 _ut.test('test_additiveExpression_missing_LHS_RHS', () {
7287 final __test = new RecoveryParserTest();
7288 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS_RHS);
7289 });
7290 _ut.test('test_additiveExpression_missing_RHS', () {
7291 final __test = new RecoveryParserTest();
7292 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS);
7293 });
7294 _ut.test('test_additiveExpression_missing_RHS_super', () {
7295 final __test = new RecoveryParserTest();
7296 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS_super);
7297 });
7298 _ut.test('test_additiveExpression_precedence_multiplicative_left', () {
7299 final __test = new RecoveryParserTest();
7300 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic ative_left);
7301 });
7302 _ut.test('test_additiveExpression_precedence_multiplicative_right', () {
7303 final __test = new RecoveryParserTest();
7304 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic ative_right);
7305 });
7306 _ut.test('test_additiveExpression_super', () {
7307 final __test = new RecoveryParserTest();
7308 runJUnitTest(__test, __test.test_additiveExpression_super);
7309 });
7310 _ut.test('test_assignmentExpression_missing_LHS', () {
7311 final __test = new RecoveryParserTest();
7312 runJUnitTest(__test, __test.test_assignmentExpression_missing_LHS);
7313 });
7314 _ut.test('test_assignmentExpression_missing_RHS', () {
7315 final __test = new RecoveryParserTest();
7316 runJUnitTest(__test, __test.test_assignmentExpression_missing_RHS);
7317 });
7318 _ut.test('test_assignmentExpression_missing_compound1', () {
7319 final __test = new RecoveryParserTest();
7320 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound1) ;
7321 });
7322 _ut.test('test_assignmentExpression_missing_compound2', () {
7323 final __test = new RecoveryParserTest();
7324 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound2) ;
7325 });
7326 _ut.test('test_assignmentExpression_missing_compound3', () {
7327 final __test = new RecoveryParserTest();
7328 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound3) ;
7329 });
7330 _ut.test('test_bitwiseAndExpression_missing_LHS', () {
7331 final __test = new RecoveryParserTest();
7332 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS);
7333 });
7334 _ut.test('test_bitwiseAndExpression_missing_LHS_RHS', () {
7335 final __test = new RecoveryParserTest();
7336 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS_RHS);
7337 });
7338 _ut.test('test_bitwiseAndExpression_missing_RHS', () {
7339 final __test = new RecoveryParserTest();
7340 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS);
7341 });
7342 _ut.test('test_bitwiseAndExpression_missing_RHS_super', () {
7343 final __test = new RecoveryParserTest();
7344 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS_super) ;
7345 });
7346 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () {
7347 final __test = new RecoveryParserTest();
7348 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit y_left);
7349 });
7350 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () {
7351 final __test = new RecoveryParserTest();
7352 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit y_right);
7353 });
7354 _ut.test('test_bitwiseAndExpression_super', () {
7355 final __test = new RecoveryParserTest();
7356 runJUnitTest(__test, __test.test_bitwiseAndExpression_super);
7357 });
7358 _ut.test('test_bitwiseOrExpression_missing_LHS', () {
7359 final __test = new RecoveryParserTest();
7360 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS);
7361 });
7362 _ut.test('test_bitwiseOrExpression_missing_LHS_RHS', () {
7363 final __test = new RecoveryParserTest();
7364 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS_RHS);
7365 });
7366 _ut.test('test_bitwiseOrExpression_missing_RHS', () {
7367 final __test = new RecoveryParserTest();
7368 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS);
7369 });
7370 _ut.test('test_bitwiseOrExpression_missing_RHS_super', () {
7371 final __test = new RecoveryParserTest();
7372 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS_super);
7373 });
7374 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () {
7375 final __test = new RecoveryParserTest();
7376 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left );
7377 });
7378 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () {
7379 final __test = new RecoveryParserTest();
7380 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ t);
7381 });
7382 _ut.test('test_bitwiseOrExpression_super', () {
7383 final __test = new RecoveryParserTest();
7384 runJUnitTest(__test, __test.test_bitwiseOrExpression_super);
7385 });
7386 _ut.test('test_bitwiseXorExpression_missing_LHS', () {
7387 final __test = new RecoveryParserTest();
7388 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS);
7389 });
7390 _ut.test('test_bitwiseXorExpression_missing_LHS_RHS', () {
7391 final __test = new RecoveryParserTest();
7392 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS_RHS);
7393 });
7394 _ut.test('test_bitwiseXorExpression_missing_RHS', () {
7395 final __test = new RecoveryParserTest();
7396 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS);
7397 });
7398 _ut.test('test_bitwiseXorExpression_missing_RHS_super', () {
7399 final __test = new RecoveryParserTest();
7400 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS_super) ;
7401 });
7402 _ut.test('test_bitwiseXorExpression_precedence_and_left', () {
7403 final __test = new RecoveryParserTest();
7404 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef t);
7405 });
7406 _ut.test('test_bitwiseXorExpression_precedence_and_right', () {
7407 final __test = new RecoveryParserTest();
7408 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig ht);
7409 });
7410 _ut.test('test_bitwiseXorExpression_super', () {
7411 final __test = new RecoveryParserTest();
7412 runJUnitTest(__test, __test.test_bitwiseXorExpression_super);
7413 });
7414 _ut.test('test_classTypeAlias_withBody', () {
7415 final __test = new RecoveryParserTest();
7416 runJUnitTest(__test, __test.test_classTypeAlias_withBody);
7417 });
7418 _ut.test('test_conditionalExpression_missingElse', () {
7419 final __test = new RecoveryParserTest();
7420 runJUnitTest(__test, __test.test_conditionalExpression_missingElse);
7421 });
7422 _ut.test('test_conditionalExpression_missingThen', () {
7423 final __test = new RecoveryParserTest();
7424 runJUnitTest(__test, __test.test_conditionalExpression_missingThen);
7425 });
7426 _ut.test('test_equalityExpression_missing_LHS', () {
7427 final __test = new RecoveryParserTest();
7428 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS);
7429 });
7430 _ut.test('test_equalityExpression_missing_LHS_RHS', () {
7431 final __test = new RecoveryParserTest();
7432 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS_RHS);
7433 });
7434 _ut.test('test_equalityExpression_missing_RHS', () {
7435 final __test = new RecoveryParserTest();
7436 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS);
7437 });
7438 _ut.test('test_equalityExpression_missing_RHS_super', () {
7439 final __test = new RecoveryParserTest();
7440 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS_super);
7441 });
7442 _ut.test('test_equalityExpression_precedence_relational_left', () {
7443 final __test = new RecoveryParserTest();
7444 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa l_left);
7445 });
7446 _ut.test('test_equalityExpression_precedence_relational_right', () {
7447 final __test = new RecoveryParserTest();
7448 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa l_right);
7449 });
7450 _ut.test('test_equalityExpression_super', () {
7451 final __test = new RecoveryParserTest();
7452 runJUnitTest(__test, __test.test_equalityExpression_super);
7453 });
7454 _ut.test('test_expressionList_multiple_end', () {
7455 final __test = new RecoveryParserTest();
7456 runJUnitTest(__test, __test.test_expressionList_multiple_end);
7457 });
7458 _ut.test('test_expressionList_multiple_middle', () {
7459 final __test = new RecoveryParserTest();
7460 runJUnitTest(__test, __test.test_expressionList_multiple_middle);
7461 });
7462 _ut.test('test_expressionList_multiple_start', () {
7463 final __test = new RecoveryParserTest();
7464 runJUnitTest(__test, __test.test_expressionList_multiple_start);
7465 });
7466 _ut.test('test_incomplete_topLevelVariable', () {
7467 final __test = new RecoveryParserTest();
7468 runJUnitTest(__test, __test.test_incomplete_topLevelVariable);
7469 });
7470 _ut.test('test_isExpression_noType', () {
7471 final __test = new RecoveryParserTest();
7472 runJUnitTest(__test, __test.test_isExpression_noType);
7473 });
7474 _ut.test('test_logicalAndExpression_missing_LHS', () {
7475 final __test = new RecoveryParserTest();
7476 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS);
7477 });
7478 _ut.test('test_logicalAndExpression_missing_LHS_RHS', () {
7479 final __test = new RecoveryParserTest();
7480 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS_RHS);
7481 });
7482 _ut.test('test_logicalAndExpression_missing_RHS', () {
7483 final __test = new RecoveryParserTest();
7484 runJUnitTest(__test, __test.test_logicalAndExpression_missing_RHS);
7485 });
7486 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () {
7487 final __test = new RecoveryParserTest();
7488 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise Or_left);
7489 });
7490 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () {
7491 final __test = new RecoveryParserTest();
7492 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise Or_right);
7493 });
7494 _ut.test('test_logicalOrExpression_missing_LHS', () {
7495 final __test = new RecoveryParserTest();
7496 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS);
7497 });
7498 _ut.test('test_logicalOrExpression_missing_LHS_RHS', () {
7499 final __test = new RecoveryParserTest();
7500 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS_RHS);
7501 });
7502 _ut.test('test_logicalOrExpression_missing_RHS', () {
7503 final __test = new RecoveryParserTest();
7504 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS);
7505 });
7506 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () {
7507 final __test = new RecoveryParserTest();
7508 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_left);
7509 });
7510 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () {
7511 final __test = new RecoveryParserTest();
7512 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_right);
7513 });
7514 _ut.test('test_multiplicativeExpression_missing_LHS', () {
7515 final __test = new RecoveryParserTest();
7516 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS);
7517 });
7518 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () {
7519 final __test = new RecoveryParserTest();
7520 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH S);
7521 });
7522 _ut.test('test_multiplicativeExpression_missing_RHS', () {
7523 final __test = new RecoveryParserTest();
7524 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS);
7525 });
7526 _ut.test('test_multiplicativeExpression_missing_RHS_super', () {
7527 final __test = new RecoveryParserTest();
7528 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS_su per);
7529 });
7530 _ut.test('test_multiplicativeExpression_precedence_unary_left', () {
7531 final __test = new RecoveryParserTest();
7532 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una ry_left);
7533 });
7534 _ut.test('test_multiplicativeExpression_precedence_unary_right', () {
7535 final __test = new RecoveryParserTest();
7536 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una ry_right);
7537 });
7538 _ut.test('test_multiplicativeExpression_super', () {
7539 final __test = new RecoveryParserTest();
7540 runJUnitTest(__test, __test.test_multiplicativeExpression_super);
7541 });
7542 _ut.test('test_prefixExpression_missing_operand_minus', () {
7543 final __test = new RecoveryParserTest();
7544 runJUnitTest(__test, __test.test_prefixExpression_missing_operand_minus) ;
7545 });
7546 _ut.test('test_relationalExpression_missing_LHS', () {
7547 final __test = new RecoveryParserTest();
7548 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS);
7549 });
7550 _ut.test('test_relationalExpression_missing_LHS_RHS', () {
7551 final __test = new RecoveryParserTest();
7552 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS_RHS);
7553 });
7554 _ut.test('test_relationalExpression_missing_RHS', () {
7555 final __test = new RecoveryParserTest();
7556 runJUnitTest(__test, __test.test_relationalExpression_missing_RHS);
7557 });
7558 _ut.test('test_relationalExpression_precedence_shift_right', () {
7559 final __test = new RecoveryParserTest();
7560 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r ight);
7561 });
7562 _ut.test('test_shiftExpression_missing_LHS', () {
7563 final __test = new RecoveryParserTest();
7564 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS);
7565 });
7566 _ut.test('test_shiftExpression_missing_LHS_RHS', () {
7567 final __test = new RecoveryParserTest();
7568 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS_RHS);
7569 });
7570 _ut.test('test_shiftExpression_missing_RHS', () {
7571 final __test = new RecoveryParserTest();
7572 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS);
7573 });
7574 _ut.test('test_shiftExpression_missing_RHS_super', () {
7575 final __test = new RecoveryParserTest();
7576 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS_super);
7577 });
7578 _ut.test('test_shiftExpression_precedence_unary_left', () {
7579 final __test = new RecoveryParserTest();
7580 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left);
7581 });
7582 _ut.test('test_shiftExpression_precedence_unary_right', () {
7583 final __test = new RecoveryParserTest();
7584 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right) ;
7585 });
7586 _ut.test('test_shiftExpression_super', () {
7587 final __test = new RecoveryParserTest();
7588 runJUnitTest(__test, __test.test_shiftExpression_super);
7589 });
7590 _ut.test('test_typedef_eof', () {
7591 final __test = new RecoveryParserTest();
7592 runJUnitTest(__test, __test.test_typedef_eof);
7593 });
7594 });
7595 }
7596 }
7597 /**
7598 * The class `ErrorParserTest` defines parser tests that test the parsing of cod e to ensure
7599 * that errors are correctly reported, and in some cases, not reported.
7600 */
7601 class ErrorParserTest extends ParserTestCase {
7602 void fail_expectedListOrMapLiteral() {
7603 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
7604 JUnitTestCase.assertTrue(literal.isSynthetic);
7605 }
7606 void fail_illegalAssignmentToNonAssignable_superAssigned() {
7607 ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGN MENT_TO_NON_ASSIGNABLE]);
7608 }
7609 void fail_invalidCommentReference__new_nonIdentifier() {
7610 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [ ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7611 }
7612 void fail_invalidCommentReference__new_tooMuch() {
7613 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7614 }
7615 void fail_invalidCommentReference__nonNew_nonIdentifier() {
7616 ParserTestCase.parse4("parseCommentReference", <Object> ["42", 0], "", [Pars erErrorCode.INVALID_COMMENT_REFERENCE]);
7617 }
7618 void fail_invalidCommentReference__nonNew_tooMuch() {
7619 ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7620 }
7621 void fail_missingClosingParenthesis() {
7622 ParserTestCase.parse5("parseFormalParameterList", "(int a, int b ;", [Parser ErrorCode.MISSING_CLOSING_PARENTHESIS]);
7623 }
7624 void fail_missingFunctionParameters_local_nonVoid_block() {
7625 ParserTestCase.parseStatement("int f { return x;}", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]);
7626 }
7627 void fail_missingFunctionParameters_local_nonVoid_expression() {
7628 ParserTestCase.parseStatement("int f => x;", [ParserErrorCode.MISSING_FUNCTI ON_PARAMETERS]);
7629 }
7630 void fail_namedFunctionExpression() {
7631 Expression expression = ParserTestCase.parse5("parsePrimaryExpression", "f() {}", [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]);
7632 EngineTestCase.assertInstanceOf(FunctionExpression, expression);
7633 }
7634 void fail_unexpectedToken_invalidPostfixExpression() {
7635 ParserTestCase.parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]);
7636 }
7637 void fail_varAndType_local() {
7638 ParserTestCase.parseStatement("var int x;", [ParserErrorCode.VAR_AND_TYPE]);
7639 }
7640 void fail_varAndType_parameter() {
7641 ParserTestCase.parse5("parseFormalParameterList", "(var int x)", [ParserErro rCode.VAR_AND_TYPE]);
7642 }
7643 void test_abstractClassMember_constructor() {
7644 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7645 }
7646 void test_abstractClassMember_field() {
7647 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C f;", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7648 }
7649 void test_abstractClassMember_getter() {
7650 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7651 }
7652 void test_abstractClassMember_method() {
7653 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract m();", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7654 }
7655 void test_abstractClassMember_setter() {
7656 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract set m(v) ;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7657 }
7658 void test_abstractTopLevelFunction_function() {
7659 ParserTestCase.parseCompilationUnit("abstract f(v) {}", [ParserErrorCode.ABS TRACT_TOP_LEVEL_FUNCTION]);
7660 }
7661 void test_abstractTopLevelFunction_getter() {
7662 ParserTestCase.parseCompilationUnit("abstract get m {}", [ParserErrorCode.AB STRACT_TOP_LEVEL_FUNCTION]);
7663 }
7664 void test_abstractTopLevelFunction_setter() {
7665 ParserTestCase.parseCompilationUnit("abstract set m(v) {}", [ParserErrorCode .ABSTRACT_TOP_LEVEL_FUNCTION]);
7666 }
7667 void test_abstractTopLevelVariable() {
7668 ParserTestCase.parseCompilationUnit("abstract C f;", [ParserErrorCode.ABSTRA CT_TOP_LEVEL_VARIABLE]);
7669 }
7670 void test_abstractTypeDef() {
7671 ParserTestCase.parseCompilationUnit("abstract typedef F();", [ParserErrorCod e.ABSTRACT_TYPEDEF]);
7672 }
7673 void test_assertDoesNotTakeAssignment() {
7674 ParserTestCase.parse5("parseAssertStatement", "assert(b = true);", [ParserEr rorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]);
7675 }
7676 void test_assertDoesNotTakeCascades() {
7677 ParserTestCase.parse5("parseAssertStatement", "assert(new A()..m());", [Pars erErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]);
7678 }
7679 void test_assertDoesNotTakeRethrow() {
7680 ParserTestCase.parse5("parseAssertStatement", "assert(rethrow);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_RETHROW]);
7681 }
7682 void test_assertDoesNotTakeThrow() {
7683 ParserTestCase.parse5("parseAssertStatement", "assert(throw x);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_THROW]);
7684 }
7685 void test_breakOutsideOfLoop_breakInDoStatement() {
7686 ParserTestCase.parse5("parseDoStatement", "do {break;} while (x);", []);
7687 }
7688 void test_breakOutsideOfLoop_breakInForStatement() {
7689 ParserTestCase.parse5("parseForStatement", "for (; x;) {break;}", []);
7690 }
7691 void test_breakOutsideOfLoop_breakInIfStatement() {
7692 ParserTestCase.parse5("parseIfStatement", "if (x) {break;}", [ParserErrorCod e.BREAK_OUTSIDE_OF_LOOP]);
7693 }
7694 void test_breakOutsideOfLoop_breakInSwitchStatement() {
7695 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: break;}", []);
7696 }
7697 void test_breakOutsideOfLoop_breakInWhileStatement() {
7698 ParserTestCase.parse5("parseWhileStatement", "while (x) {break;}", []);
7699 }
7700 void test_breakOutsideOfLoop_functionExpression_inALoop() {
7701 ParserTestCase.parseStatement("for(; x;) {() {break;};}", [ParserErrorCode.B REAK_OUTSIDE_OF_LOOP]);
7702 }
7703 void test_breakOutsideOfLoop_functionExpression_withALoop() {
7704 ParserTestCase.parseStatement("() {for (; x;) {break;}};", []);
7705 }
7706 void test_constAndFinal() {
7707 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const final int x ;", [ParserErrorCode.CONST_AND_FINAL]);
7708 }
7709 void test_constAndVar() {
7710 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const var x;", [P arserErrorCode.CONST_AND_VAR]);
7711 }
7712 void test_constClass() {
7713 ParserTestCase.parseCompilationUnit("const class C {}", [ParserErrorCode.CON ST_CLASS]);
7714 }
7715 void test_constConstructorWithBody() {
7716 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const C() {}", [P arserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
7717 }
7718 void test_constFactory() {
7719 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const factory C() {}", [ParserErrorCode.CONST_FACTORY]);
7720 }
7721 void test_constMethod() {
7722 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const int m() {}" , [ParserErrorCode.CONST_METHOD]);
7723 }
7724 void test_constructorWithReturnType() {
7725 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "C C() {}", [Parse rErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
7726 }
7727 void test_constructorWithReturnType_var() {
7728 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var C() {}", [Par serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
7729 }
7730 void test_constTypedef() {
7731 ParserTestCase.parseCompilationUnit("const typedef F();", [ParserErrorCode.C ONST_TYPEDEF]);
7732 }
7733 void test_continueOutsideOfLoop_continueInDoStatement() {
7734 ParserTestCase.parse5("parseDoStatement", "do {continue;} while (x);", []);
7735 }
7736 void test_continueOutsideOfLoop_continueInForStatement() {
7737 ParserTestCase.parse5("parseForStatement", "for (; x;) {continue;}", []);
7738 }
7739 void test_continueOutsideOfLoop_continueInIfStatement() {
7740 ParserTestCase.parse5("parseIfStatement", "if (x) {continue;}", [ParserError Code.CONTINUE_OUTSIDE_OF_LOOP]);
7741 }
7742 void test_continueOutsideOfLoop_continueInSwitchStatement() {
7743 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
7744 }
7745 void test_continueOutsideOfLoop_continueInWhileStatement() {
7746 ParserTestCase.parse5("parseWhileStatement", "while (x) {continue;}", []);
7747 }
7748 void test_continueOutsideOfLoop_functionExpression_inALoop() {
7749 ParserTestCase.parseStatement("for(; x;) {() {continue;};}", [ParserErrorCod e.CONTINUE_OUTSIDE_OF_LOOP]);
7750 }
7751 void test_continueOutsideOfLoop_functionExpression_withALoop() {
7752 ParserTestCase.parseStatement("() {for (; x;) {continue;}};", []);
7753 }
7754 void test_continueWithoutLabelInCase_error() {
7755 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue; }", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]);
7756 }
7757 void test_continueWithoutLabelInCase_noError() {
7758 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
7759 }
7760 void test_continueWithoutLabelInCase_noError_switchInLoop() {
7761 ParserTestCase.parse5("parseWhileStatement", "while (a) { switch (b) {defaul t: continue;}}", []);
7762 }
7763 void test_deprecatedClassTypeAlias() {
7764 ParserTestCase.parseCompilationUnit("typedef C = abstract S with M;", [Parse rErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
7765 }
7766 void test_deprecatedClassTypeAlias_withGeneric() {
7767 ParserTestCase.parseCompilationUnit("typedef C<T> = abstract S<T> with M;", [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
7768 }
7769 void test_directiveAfterDeclaration_classBeforeDirective() {
7770 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Foo{} libr ary l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
7771 JUnitTestCase.assertNotNull(unit);
7772 }
7773 void test_directiveAfterDeclaration_classBetweenDirectives() {
7774 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library l;\nclas s Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
7775 JUnitTestCase.assertNotNull(unit);
7776 }
7777 void test_duplicatedModifier_const() {
7778 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
7779 }
7780 void test_duplicatedModifier_external() {
7781 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]);
7782 }
7783 void test_duplicatedModifier_factory() {
7784 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory factory C () {}", [ParserErrorCode.DUPLICATED_MODIFIER]);
7785 }
7786 void test_duplicatedModifier_final() {
7787 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
7788 }
7789 void test_duplicatedModifier_static() {
7790 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static static var m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
7791 }
7792 void test_duplicatedModifier_var() {
7793 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var var m;", [Par serErrorCode.DUPLICATED_MODIFIER]);
7794 }
7795 void test_duplicateLabelInSwitchStatement() {
7796 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {l1: case 0: break ; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
7797 }
7798 void test_equalityCannotBeEqualityOperand_eq_eq() {
7799 ParserTestCase.parseExpression("1 == 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
7800 }
7801 void test_equalityCannotBeEqualityOperand_eq_neq() {
7802 ParserTestCase.parseExpression("1 == 2 != 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
7803 }
7804 void test_equalityCannotBeEqualityOperand_neq_eq() {
7805 ParserTestCase.parseExpression("1 != 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
7806 }
7807 void test_expectedCaseOrDefault() {
7808 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [Parser ErrorCode.EXPECTED_CASE_OR_DEFAULT]);
7809 }
7810 void test_expectedClassMember_inClass_afterType() {
7811 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "heart 2 heart", [ ParserErrorCode.EXPECTED_CLASS_MEMBER]);
7812 }
7813 void test_expectedClassMember_inClass_beforeType() {
7814 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "4 score", [Parser ErrorCode.EXPECTED_CLASS_MEMBER]);
7815 }
7816 void test_expectedExecutable_inClass_afterVoid() {
7817 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void 2 void", [Pa rserErrorCode.EXPECTED_EXECUTABLE]);
7818 }
7819 void test_expectedExecutable_topLevel_afterType() {
7820 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "heart 2 heart", [ParserErrorCode.EXPECTED_EXECUTABLE]);
7821 }
7822 void test_expectedExecutable_topLevel_afterVoid() {
7823 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
7824 }
7825 void test_expectedExecutable_topLevel_beforeType() {
7826 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]);
7827 }
7828 void test_expectedInterpolationIdentifier() {
7829 ParserTestCase.parse5("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISS ING_IDENTIFIER]);
7830 }
7831 void test_expectedStringLiteral() {
7832 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
7833 JUnitTestCase.assertTrue(expression.isSynthetic);
7834 }
7835 void test_expectedToken_commaMissingInArgumentList() {
7836 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE CTED_TOKEN]);
7837 }
7838 void test_expectedToken_parseStatement_afterVoid() {
7839 ParserTestCase.parseStatement("void}", [
7840 ParserErrorCode.EXPECTED_TOKEN,
7841 ParserErrorCode.MISSING_IDENTIFIER]);
7842 }
7843 void test_expectedToken_semicolonAfterClass() {
7844 Token token = TokenFactory.token(Keyword.CLASS);
7845 ParserTestCase.parse4("parseClassTypeAlias", <Object> [emptyCommentAndMetada ta(), token], "A = B", [ParserErrorCode.EXPECTED_TOKEN]);
7846 }
7847 void test_expectedToken_semicolonMissingAfterExpression() {
7848 ParserTestCase.parseStatement("x", [ParserErrorCode.EXPECTED_TOKEN]);
7849 }
7850 void test_expectedToken_whileMissingInDoStatement() {
7851 ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN] );
7852 }
7853 void test_expectedTypeName_is() {
7854 ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]) ;
7855 }
7856 void test_exportDirectiveAfterPartDirective() {
7857 ParserTestCase.parseCompilationUnit("part 'a.dart'; export 'b.dart';", [Pars erErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
7858 }
7859 void test_externalAfterConst() {
7860 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const external C( );", [ParserErrorCode.EXTERNAL_AFTER_CONST]);
7861 }
7862 void test_externalAfterFactory() {
7863 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]);
7864 }
7865 void test_externalAfterStatic() {
7866 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static external i nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]);
7867 }
7868 void test_externalClass() {
7869 ParserTestCase.parseCompilationUnit("external class C {}", [ParserErrorCode. EXTERNAL_CLASS]);
7870 }
7871 void test_externalConstructorWithBody_factory() {
7872 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
7873 }
7874 void test_externalConstructorWithBody_named() {
7875 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external C.c() {} ", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
7876 }
7877 void test_externalField_const() {
7878 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7879 }
7880 void test_externalField_final() {
7881 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7882 }
7883 void test_externalField_static() {
7884 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7885 }
7886 void test_externalField_typed() {
7887 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external A f;", [ ParserErrorCode.EXTERNAL_FIELD]);
7888 }
7889 void test_externalField_untyped() {
7890 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]);
7891 }
7892 void test_externalGetterWithBody() {
7893 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]);
7894 }
7895 void test_externalMethodWithBody() {
7896 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]);
7897 }
7898 void test_externalOperatorWithBody() {
7899 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
7900 }
7901 void test_externalSetterWithBody() {
7902 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external set x(in t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]);
7903 }
7904 void test_externalTypedef() {
7905 ParserTestCase.parseCompilationUnit("external typedef F();", [ParserErrorCod e.EXTERNAL_TYPEDEF]);
7906 }
7907 void test_factoryTopLevelDeclaration_class() {
7908 ParserTestCase.parseCompilationUnit("factory class C {}", [ParserErrorCode.F ACTORY_TOP_LEVEL_DECLARATION]);
7909 }
7910 void test_factoryTopLevelDeclaration_typedef() {
7911 ParserTestCase.parseCompilationUnit("factory typedef F();", [ParserErrorCode .FACTORY_TOP_LEVEL_DECLARATION]);
7912 }
7913 void test_factoryWithoutBody() {
7914 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory C();", [P arserErrorCode.FACTORY_WITHOUT_BODY]);
7915 }
7916 void test_fieldInitializerOutsideConstructor() {
7917 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
7918 }
7919 void test_finalAndVar() {
7920 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final var x;", [P arserErrorCode.FINAL_AND_VAR]);
7921 }
7922 void test_finalClass() {
7923 ParserTestCase.parseCompilationUnit("final class C {}", [ParserErrorCode.FIN AL_CLASS]);
7924 }
7925 void test_finalConstructor() {
7926 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final C() {}", [P arserErrorCode.FINAL_CONSTRUCTOR]);
7927 }
7928 void test_finalMethod() {
7929 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final int m() {}" , [ParserErrorCode.FINAL_METHOD]);
7930 }
7931 void test_finalTypedef() {
7932 ParserTestCase.parseCompilationUnit("final typedef F();", [ParserErrorCode.F INAL_TYPEDEF]);
7933 }
7934 void test_functionTypedParameter_const() {
7935 ParserTestCase.parseCompilationUnit("void f(const x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]);
7936 }
7937 void test_functionTypedParameter_final() {
7938 ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]);
7939 }
7940 void test_functionTypedParameter_var() {
7941 ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.F UNCTION_TYPED_PARAMETER_VAR]);
7942 }
7943 void test_getterInFunction_block() {
7944 ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTE R_IN_FUNCTION]);
7945 }
7946 void test_getterInFunction_expression() {
7947 ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUN CTION]);
7948 }
7949 void test_getterWithParameters() {
7950 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
7951 }
7952 void test_illegalAssignmentToNonAssignable_superAssigned() {
7953 ParserTestCase.parseExpression("super = x;", [
7954 ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
7955 ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
7956 }
7957 void test_implementsBeforeExtends() {
7958 ParserTestCase.parseCompilationUnit("class A implements B extends C {}", [Pa rserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]);
7959 }
7960 void test_implementsBeforeWith() {
7961 ParserTestCase.parseCompilationUnit("class A extends B implements C with D { }", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]);
7962 }
7963 void test_importDirectiveAfterPartDirective() {
7964 ParserTestCase.parseCompilationUnit("part 'a.dart'; import 'b.dart';", [Pars erErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
7965 }
7966 void test_initializedVariableInForEach() {
7967 ParserTestCase.parse5("parseForStatement", "for (int a = 0 in foo) {}", [Par serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]);
7968 }
7969 void test_invalidCodePoint() {
7970 ParserTestCase.parse5("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN VALID_CODE_POINT]);
7971 }
7972 void test_invalidHexEscape_invalidDigit() {
7973 ParserTestCase.parse5("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV ALID_HEX_ESCAPE]);
7974 }
7975 void test_invalidHexEscape_tooFewDigits() {
7976 ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL ID_HEX_ESCAPE]);
7977 }
7978 void test_invalidInterpolationIdentifier_startWithDigit() {
7979 ParserTestCase.parse5("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSIN G_IDENTIFIER]);
7980 }
7981 void test_invalidOperator() {
7982 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void operator === (x) {}", [ParserErrorCode.INVALID_OPERATOR]);
7983 }
7984 void test_invalidOperatorForSuper() {
7985 ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.IN VALID_OPERATOR_FOR_SUPER]);
7986 }
7987 void test_invalidUnicodeEscape_incomplete_noDigits() {
7988 ParserTestCase.parse5("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL ID_UNICODE_ESCAPE]);
7989 }
7990 void test_invalidUnicodeEscape_incomplete_someDigits() {
7991 ParserTestCase.parse5("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
7992 }
7993 void test_invalidUnicodeEscape_invalidDigit() {
7994 ParserTestCase.parse5("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
7995 }
7996 void test_invalidUnicodeEscape_tooFewDigits_fixed() {
7997 ParserTestCase.parse5("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
7998 }
7999 void test_invalidUnicodeEscape_tooFewDigits_variable() {
8000 ParserTestCase.parse5("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
8001 }
8002 void test_invalidUnicodeEscape_tooManyDigits_variable() {
8003 ParserTestCase.parse5("parseStringLiteral", "'\\u{12345678}'", [
8004 ParserErrorCode.INVALID_UNICODE_ESCAPE,
8005 ParserErrorCode.INVALID_CODE_POINT]);
8006 }
8007 void test_libraryDirectiveNotFirst() {
8008 ParserTestCase.parseCompilationUnit("import 'x.dart'; library l;", [ParserEr rorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
8009 }
8010 void test_libraryDirectiveNotFirst_afterPart() {
8011 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part 'a.dart';\n library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
8012 JUnitTestCase.assertNotNull(unit);
8013 }
8014 void test_localFunctionDeclarationModifier_abstract() {
8015 ParserTestCase.parseStatement("abstract f() {}", [ParserErrorCode.LOCAL_FUNC TION_DECLARATION_MODIFIER]);
8016 }
8017 void test_localFunctionDeclarationModifier_external() {
8018 ParserTestCase.parseStatement("external f() {}", [ParserErrorCode.LOCAL_FUNC TION_DECLARATION_MODIFIER]);
8019 }
8020 void test_localFunctionDeclarationModifier_factory() {
8021 ParserTestCase.parseStatement("factory f() {}", [ParserErrorCode.LOCAL_FUNCT ION_DECLARATION_MODIFIER]);
8022 }
8023 void test_localFunctionDeclarationModifier_static() {
8024 ParserTestCase.parseStatement("static f() {}", [ParserErrorCode.LOCAL_FUNCTI ON_DECLARATION_MODIFIER]);
8025 }
8026 void test_missingAssignableSelector_identifiersAssigned() {
8027 ParserTestCase.parseExpression("x.y = y;", []);
8028 }
8029 void test_missingAssignableSelector_postfix_minusMinus_literal() {
8030 ParserTestCase.parseExpression("0--", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
8031 }
8032 void test_missingAssignableSelector_postfix_plusPlus_literal() {
8033 ParserTestCase.parseExpression("0++", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
8034 }
8035 void test_missingAssignableSelector_prefix_minusMinus_literal() {
8036 ParserTestCase.parseExpression("--0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
8037 }
8038 void test_missingAssignableSelector_prefix_plusPlus_literal() {
8039 ParserTestCase.parseExpression("++0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
8040 }
8041 void test_missingAssignableSelector_primarySelectorPostfix() {
8042 ParserTestCase.parseExpression("x(y)(z)++", [ParserErrorCode.MISSING_ASSIGNA BLE_SELECTOR]);
8043 }
8044 void test_missingAssignableSelector_selector() {
8045 ParserTestCase.parseExpression("x(y)(z).a++", []);
8046 }
8047 void test_missingAssignableSelector_superPrimaryExpression() {
8048 SuperExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
8049 JUnitTestCase.assertNotNull(expression.keyword);
8050 }
8051 void test_missingAssignableSelector_superPropertyAccessAssigned() {
8052 ParserTestCase.parseExpression("super.x = x;", []);
8053 }
8054 void test_missingCatchOrFinally() {
8055 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}" , [ParserErrorCode.MISSING_CATCH_OR_FINALLY]);
8056 JUnitTestCase.assertNotNull(statement);
8057 }
8058 void test_missingClassBody() {
8059 ParserTestCase.parseCompilationUnit("class A class B {}", [ParserErrorCode.M ISSING_CLASS_BODY]);
8060 }
8061 void test_missingConstFinalVarOrType_static() {
8062 ParserTestCase.parseCompilationUnit("class A { static f; }", [ParserErrorCod e.MISSING_CONST_FINAL_VAR_OR_TYPE]);
8063 }
8064 void test_missingConstFinalVarOrType_topLevel() {
8065 ParserTestCase.parse4("parseFinalConstVarOrType", <Object> [false], "a;", [P arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
8066 }
8067 void test_missingExpressionInThrow_withCascade() {
8068 ParserTestCase.parse5("parseThrowExpression", "throw;", [ParserErrorCode.MIS SING_EXPRESSION_IN_THROW]);
8069 }
8070 void test_missingExpressionInThrow_withoutCascade() {
8071 ParserTestCase.parse5("parseThrowExpressionWithoutCascade", "throw;", [Parse rErrorCode.MISSING_EXPRESSION_IN_THROW]);
8072 }
8073 void test_missingFunctionBody_emptyNotAllowed() {
8074 ParserTestCase.parse4("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], ";", [ParserErrorCode.MISSING_FUNCTION_BODY]);
8075 }
8076 void test_missingFunctionBody_invalid() {
8077 ParserTestCase.parse4("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BO DY]);
8078 }
8079 void test_missingFunctionParameters_local_void_block() {
8080 ParserTestCase.parseStatement("void f { return x;}", [ParserErrorCode.MISSIN G_FUNCTION_PARAMETERS]);
8081 }
8082 void test_missingFunctionParameters_local_void_expression() {
8083 ParserTestCase.parseStatement("void f => x;", [ParserErrorCode.MISSING_FUNCT ION_PARAMETERS]);
8084 }
8085 void test_missingFunctionParameters_topLevel_nonVoid_block() {
8086 ParserTestCase.parseCompilationUnit("int f { return x;}", [ParserErrorCode.M ISSING_FUNCTION_PARAMETERS]);
8087 }
8088 void test_missingFunctionParameters_topLevel_nonVoid_expression() {
8089 ParserTestCase.parseCompilationUnit("int f => x;", [ParserErrorCode.MISSING_ FUNCTION_PARAMETERS]);
8090 }
8091 void test_missingFunctionParameters_topLevel_void_block() {
8092 ParserTestCase.parseCompilationUnit("void f { return x;}", [ParserErrorCode. MISSING_FUNCTION_PARAMETERS]);
8093 }
8094 void test_missingFunctionParameters_topLevel_void_expression() {
8095 ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]);
8096 }
8097 void test_missingIdentifier_afterOperator() {
8098 ParserTestCase.parse5("parseMultiplicativeExpression", "1 *", [ParserErrorCo de.MISSING_IDENTIFIER]);
8099 }
8100 void test_missingIdentifier_beforeClosingCurly() {
8101 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int}", [
8102 ParserErrorCode.MISSING_IDENTIFIER,
8103 ParserErrorCode.EXPECTED_TOKEN]);
8104 }
8105 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
8106 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa rserErrorCode.MISSING_IDENTIFIER]);
8107 }
8108 void test_missingIdentifier_inSymbol_afterPeriod() {
8109 ParserTestCase.parse5("parseSymbolLiteral", "#a.", [ParserErrorCode.MISSING_ IDENTIFIER]);
8110 }
8111 void test_missingIdentifier_inSymbol_first() {
8112 ParserTestCase.parse5("parseSymbolLiteral", "#", [ParserErrorCode.MISSING_ID ENTIFIER]);
8113 }
8114 void test_missingIdentifier_number() {
8115 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
8116 JUnitTestCase.assertTrue(expression.isSynthetic);
8117 }
8118 void test_missingKeywordOperator() {
8119 ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
8120 }
8121 void test_missingKeywordOperator_parseClassMember() {
8122 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "+() {}", [ParserE rrorCode.MISSING_KEYWORD_OPERATOR]);
8123 }
8124 void test_missingKeywordOperator_parseClassMember_afterTypeName() {
8125 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int +() {}", [Par serErrorCode.MISSING_KEYWORD_OPERATOR]);
8126 }
8127 void test_missingKeywordOperator_parseClassMember_afterVoid() {
8128 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void +() {}", [Pa rserErrorCode.MISSING_KEYWORD_OPERATOR]);
8129 }
8130 void test_missingNameInLibraryDirective() {
8131 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [Pars erErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
8132 JUnitTestCase.assertNotNull(unit);
8133 }
8134 void test_missingNameInPartOfDirective() {
8135 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [Pars erErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]);
8136 JUnitTestCase.assertNotNull(unit);
8137 }
8138 void test_missingStatement() {
8139 ParserTestCase.parseStatement("is", [ParserErrorCode.MISSING_STATEMENT]);
8140 }
8141 void test_missingStatement_afterVoid() {
8142 ParserTestCase.parseStatement("void;", [ParserErrorCode.MISSING_STATEMENT]);
8143 }
8144 void test_missingTerminatorForParameterGroup_named() {
8145 ParserTestCase.parse5("parseFormalParameterList", "(a, {b: 0)", [ParserError Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
8146 }
8147 void test_missingTerminatorForParameterGroup_optional() {
8148 ParserTestCase.parse5("parseFormalParameterList", "(a, [b = 0)", [ParserErro rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
8149 }
8150 void test_missingTypedefParameters_nonVoid() {
8151 ParserTestCase.parseCompilationUnit("typedef int F;", [ParserErrorCode.MISSI NG_TYPEDEF_PARAMETERS]);
8152 }
8153 void test_missingTypedefParameters_typeParameters() {
8154 ParserTestCase.parseCompilationUnit("typedef F<E>;", [ParserErrorCode.MISSIN G_TYPEDEF_PARAMETERS]);
8155 }
8156 void test_missingTypedefParameters_void() {
8157 ParserTestCase.parseCompilationUnit("typedef void F;", [ParserErrorCode.MISS ING_TYPEDEF_PARAMETERS]);
8158 }
8159 void test_missingVariableInForEach() {
8160 ParserTestCase.parse5("parseForStatement", "for (a < b in foo) {}", [ParserE rrorCode.MISSING_VARIABLE_IN_FOR_EACH]);
8161 }
8162 void test_mixedParameterGroups_namedPositional() {
8163 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, [c])", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
8164 }
8165 void test_mixedParameterGroups_positionalNamed() {
8166 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], {c})", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
8167 }
8168 void test_multipleExtendsClauses() {
8169 ParserTestCase.parseCompilationUnit("class A extends B extends C {}", [Parse rErrorCode.MULTIPLE_EXTENDS_CLAUSES]);
8170 }
8171 void test_multipleImplementsClauses() {
8172 ParserTestCase.parseCompilationUnit("class A implements B implements C {}", [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES]);
8173 }
8174 void test_multipleLibraryDirectives() {
8175 ParserTestCase.parseCompilationUnit("library l; library m;", [ParserErrorCod e.MULTIPLE_LIBRARY_DIRECTIVES]);
8176 }
8177 void test_multipleNamedParameterGroups() {
8178 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, {c})", [ParserEr rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]);
8179 }
8180 void test_multiplePartOfDirectives() {
8181 ParserTestCase.parseCompilationUnit("part of l; part of m;", [ParserErrorCod e.MULTIPLE_PART_OF_DIRECTIVES]);
8182 }
8183 void test_multiplePositionalParameterGroups() {
8184 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], [c])", [ParserEr rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]);
8185 }
8186 void test_multipleVariablesInForEach() {
8187 ParserTestCase.parse5("parseForStatement", "for (int a, b in foo) {}", [Pars erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]);
8188 }
8189 void test_multipleWithClauses() {
8190 ParserTestCase.parseCompilationUnit("class A extends B with C with D {}", [P arserErrorCode.MULTIPLE_WITH_CLAUSES]);
8191 }
8192 void test_namedParameterOutsideGroup() {
8193 ParserTestCase.parse5("parseFormalParameterList", "(a, b : 0)", [ParserError Code.NAMED_PARAMETER_OUTSIDE_GROUP]);
8194 }
8195 void test_nonConstructorFactory_field() {
8196 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
8197 }
8198 void test_nonConstructorFactory_method() {
8199 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int m() { }", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
8200 }
8201 void test_nonIdentifierLibraryName_library() {
8202 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
8203 JUnitTestCase.assertNotNull(unit);
8204 }
8205 void test_nonIdentifierLibraryName_partOf() {
8206 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
8207 JUnitTestCase.assertNotNull(unit);
8208 }
8209 void test_nonPartOfDirectiveInPart_after() {
8210 ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]);
8211 }
8212 void test_nonPartOfDirectiveInPart_before() {
8213 ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]);
8214 }
8215 void test_nonUserDefinableOperator() {
8216 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "operator +=(int x ) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]);
8217 }
8218 void test_optionalAfterNormalParameters_named() {
8219 ParserTestCase.parseCompilationUnit("f({a}, b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]);
8220 }
8221 void test_optionalAfterNormalParameters_positional() {
8222 ParserTestCase.parseCompilationUnit("f([a], b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]);
8223 }
8224 void test_parseCascadeSection_missingIdentifier() {
8225 MethodInvocation methodInvocation = ParserTestCase.parse5("parseCascadeSecti on", "..()", [ParserErrorCode.MISSING_IDENTIFIER]);
8226 JUnitTestCase.assertNull(methodInvocation.target);
8227 JUnitTestCase.assertEquals("", methodInvocation.methodName.name);
8228 EngineTestCase.assertSize(0, methodInvocation.argumentList.arguments);
8229 }
8230 void test_positionalAfterNamedArgument() {
8231 ParserTestCase.parse5("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS ITIONAL_AFTER_NAMED_ARGUMENT]);
8232 }
8233 void test_positionalParameterOutsideGroup() {
8234 ParserTestCase.parse5("parseFormalParameterList", "(a, b = 0)", [ParserError Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
8235 }
8236 void test_redirectionInNonFactoryConstructor() {
8237 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "C() = D;", [Parse rErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR]);
8238 }
8239 void test_setterInFunction_block() {
8240 ParserTestCase.parseStatement("set x(v) {_x = v;}", [ParserErrorCode.SETTER_ IN_FUNCTION]);
8241 }
8242 void test_setterInFunction_expression() {
8243 ParserTestCase.parseStatement("set x(v) => _x = v;", [ParserErrorCode.SETTER _IN_FUNCTION]);
8244 }
8245 void test_staticAfterConst() {
8246 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]);
8247 }
8248 void test_staticAfterFinal() {
8249 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]);
8250 }
8251 void test_staticAfterVar() {
8252 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var static f;", [ ParserErrorCode.STATIC_AFTER_VAR]);
8253 }
8254 void test_staticConstructor() {
8255 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]);
8256 }
8257 void test_staticGetterWithoutBody() {
8258 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static get m;", [ ParserErrorCode.STATIC_GETTER_WITHOUT_BODY]);
8259 }
8260 void test_staticOperator_noReturnType() {
8261 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static operator + (int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
8262 }
8263 void test_staticOperator_returnType() {
8264 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static int operat or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
8265 }
8266 void test_staticSetterWithoutBody() {
8267 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static set m(x);" , [ParserErrorCode.STATIC_SETTER_WITHOUT_BODY]);
8268 }
8269 void test_staticTopLevelDeclaration_class() {
8270 ParserTestCase.parseCompilationUnit("static class C {}", [ParserErrorCode.ST ATIC_TOP_LEVEL_DECLARATION]);
8271 }
8272 void test_staticTopLevelDeclaration_function() {
8273 ParserTestCase.parseCompilationUnit("static f() {}", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]);
8274 }
8275 void test_staticTopLevelDeclaration_typedef() {
8276 ParserTestCase.parseCompilationUnit("static typedef F();", [ParserErrorCode. STATIC_TOP_LEVEL_DECLARATION]);
8277 }
8278 void test_staticTopLevelDeclaration_variable() {
8279 ParserTestCase.parseCompilationUnit("static var x;", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]);
8280 }
8281 void test_switchHasCaseAfterDefaultCase() {
8282 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
8283 }
8284 void test_switchHasCaseAfterDefaultCase_repeated() {
8285 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1; case 2: return 2;}", [
8286 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
8287 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
8288 }
8289 void test_switchHasMultipleDefaultCases() {
8290 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
8291 }
8292 void test_switchHasMultipleDefaultCases_repeated() {
8293 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1; default: return 2;}", [
8294 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
8295 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
8296 }
8297 void test_topLevelOperator_withoutType() {
8298 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL _OPERATOR]);
8299 }
8300 void test_topLevelOperator_withType() {
8301 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "bool operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]);
8302 }
8303 void test_topLevelOperator_withVoid() {
8304 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]);
8305 }
8306 void test_unexpectedTerminatorForParameterGroup_named() {
8307 ParserTestCase.parse5("parseFormalParameterList", "(a, b})", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
8308 }
8309 void test_unexpectedTerminatorForParameterGroup_optional() {
8310 ParserTestCase.parse5("parseFormalParameterList", "(a, b])", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
8311 }
8312 void test_unexpectedToken_semicolonBetweenClassMembers() {
8313 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]) ;
8314 }
8315 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() {
8316 ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEX PECTED_TOKEN]);
8317 }
8318 void test_useOfUnaryPlusOperator() {
8319 SimpleIdentifier expression = ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
8320 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression);
8321 JUnitTestCase.assertTrue(expression.isSynthetic);
8322 }
8323 void test_varAndType_field() {
8324 ParserTestCase.parseCompilationUnit("class C { var int x; }", [ParserErrorCo de.VAR_AND_TYPE]);
8325 }
8326 void test_varAndType_topLevelVariable() {
8327 ParserTestCase.parseCompilationUnit("var int x;", [ParserErrorCode.VAR_AND_T YPE]);
8328 }
8329 void test_varAsTypeName_as() {
8330 ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME ]);
8331 }
8332 void test_varClass() {
8333 ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_C LASS]);
8334 }
8335 void test_varReturnType() {
8336 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par serErrorCode.VAR_RETURN_TYPE]);
8337 }
8338 void test_varTypedef() {
8339 ParserTestCase.parseCompilationUnit("var typedef F();", [ParserErrorCode.VAR _TYPEDEF]);
8340 }
8341 void test_voidParameter() {
8342 ParserTestCase.parse5("parseNormalFormalParameter", "void a)", [ParserErrorC ode.VOID_PARAMETER]);
8343 }
8344 void test_voidVariable_parseClassMember_initializer() {
8345 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x = 0;", [Pa rserErrorCode.VOID_VARIABLE]);
8346 }
8347 void test_voidVariable_parseClassMember_noInitializer() {
8348 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x;", [Parser ErrorCode.VOID_VARIABLE]);
8349 }
8350 void test_voidVariable_parseCompilationUnit_initializer() {
8351 ParserTestCase.parseCompilationUnit("void x = 0;", [ParserErrorCode.VOID_VAR IABLE]);
8352 }
8353 void test_voidVariable_parseCompilationUnit_noInitializer() {
8354 ParserTestCase.parseCompilationUnit("void x;", [ParserErrorCode.VOID_VARIABL E]);
8355 }
8356 void test_voidVariable_parseCompilationUnitMember_initializer() {
8357 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a = 0;", [ParserErrorCode.VOID_VARIABLE]);
8358 }
8359 void test_voidVariable_parseCompilationUnitMember_noInitializer() {
8360 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a;", [ParserErrorCode.VOID_VARIABLE]);
8361 }
8362 void test_voidVariable_statement_initializer() {
8363 ParserTestCase.parseStatement("void x = 0;", [
8364 ParserErrorCode.VOID_VARIABLE,
8365 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
8366 }
8367 void test_voidVariable_statement_noInitializer() {
8368 ParserTestCase.parseStatement("void x;", [
8369 ParserErrorCode.VOID_VARIABLE,
8370 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
8371 }
8372 void test_withBeforeExtends() {
8373 ParserTestCase.parseCompilationUnit("class A with B extends C {}", [ParserEr rorCode.WITH_BEFORE_EXTENDS]);
8374 }
8375 void test_withWithoutExtends() {
8376 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
8377 }
8378 void test_wrongSeparatorForNamedParameter() {
8379 ParserTestCase.parse5("parseFormalParameterList", "(a, {b = 0})", [ParserErr orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
8380 }
8381 void test_wrongSeparatorForPositionalParameter() {
8382 ParserTestCase.parse5("parseFormalParameterList", "(a, [b : 0])", [ParserErr orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]);
8383 }
8384 void test_wrongTerminatorForParameterGroup_named() {
8385 ParserTestCase.parse5("parseFormalParameterList", "(a, {b, c])", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
8386 }
8387 void test_wrongTerminatorForParameterGroup_optional() {
8388 ParserTestCase.parse5("parseFormalParameterList", "(a, [b, c})", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
8389 }
8390 static dartSuite() {
8391 _ut.group('ErrorParserTest', () {
8392 _ut.test('test_abstractClassMember_constructor', () {
8393 final __test = new ErrorParserTest();
8394 runJUnitTest(__test, __test.test_abstractClassMember_constructor);
8395 });
8396 _ut.test('test_abstractClassMember_field', () {
8397 final __test = new ErrorParserTest();
8398 runJUnitTest(__test, __test.test_abstractClassMember_field);
8399 });
8400 _ut.test('test_abstractClassMember_getter', () {
8401 final __test = new ErrorParserTest();
8402 runJUnitTest(__test, __test.test_abstractClassMember_getter);
8403 });
8404 _ut.test('test_abstractClassMember_method', () {
8405 final __test = new ErrorParserTest();
8406 runJUnitTest(__test, __test.test_abstractClassMember_method);
8407 });
8408 _ut.test('test_abstractClassMember_setter', () {
8409 final __test = new ErrorParserTest();
8410 runJUnitTest(__test, __test.test_abstractClassMember_setter);
8411 });
8412 _ut.test('test_abstractTopLevelFunction_function', () {
8413 final __test = new ErrorParserTest();
8414 runJUnitTest(__test, __test.test_abstractTopLevelFunction_function);
8415 });
8416 _ut.test('test_abstractTopLevelFunction_getter', () {
8417 final __test = new ErrorParserTest();
8418 runJUnitTest(__test, __test.test_abstractTopLevelFunction_getter);
8419 });
8420 _ut.test('test_abstractTopLevelFunction_setter', () {
8421 final __test = new ErrorParserTest();
8422 runJUnitTest(__test, __test.test_abstractTopLevelFunction_setter);
8423 });
8424 _ut.test('test_abstractTopLevelVariable', () {
8425 final __test = new ErrorParserTest();
8426 runJUnitTest(__test, __test.test_abstractTopLevelVariable);
8427 });
8428 _ut.test('test_abstractTypeDef', () {
8429 final __test = new ErrorParserTest();
8430 runJUnitTest(__test, __test.test_abstractTypeDef);
8431 });
8432 _ut.test('test_assertDoesNotTakeAssignment', () {
8433 final __test = new ErrorParserTest();
8434 runJUnitTest(__test, __test.test_assertDoesNotTakeAssignment);
8435 });
8436 _ut.test('test_assertDoesNotTakeCascades', () {
8437 final __test = new ErrorParserTest();
8438 runJUnitTest(__test, __test.test_assertDoesNotTakeCascades);
8439 });
8440 _ut.test('test_assertDoesNotTakeRethrow', () {
8441 final __test = new ErrorParserTest();
8442 runJUnitTest(__test, __test.test_assertDoesNotTakeRethrow);
8443 });
8444 _ut.test('test_assertDoesNotTakeThrow', () {
8445 final __test = new ErrorParserTest();
8446 runJUnitTest(__test, __test.test_assertDoesNotTakeThrow);
8447 });
8448 _ut.test('test_breakOutsideOfLoop_breakInDoStatement', () {
8449 final __test = new ErrorParserTest();
8450 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInDoStatement);
8451 });
8452 _ut.test('test_breakOutsideOfLoop_breakInForStatement', () {
8453 final __test = new ErrorParserTest();
8454 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInForStatement) ;
8455 });
8456 _ut.test('test_breakOutsideOfLoop_breakInIfStatement', () {
8457 final __test = new ErrorParserTest();
8458 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInIfStatement);
8459 });
8460 _ut.test('test_breakOutsideOfLoop_breakInSwitchStatement', () {
8461 final __test = new ErrorParserTest();
8462 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInSwitchStateme nt);
8463 });
8464 _ut.test('test_breakOutsideOfLoop_breakInWhileStatement', () {
8465 final __test = new ErrorParserTest();
8466 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInWhileStatemen t);
8467 });
8468 _ut.test('test_breakOutsideOfLoop_functionExpression_inALoop', () {
8469 final __test = new ErrorParserTest();
8470 runJUnitTest(__test, __test.test_breakOutsideOfLoop_functionExpression_i nALoop);
8471 });
8472 _ut.test('test_breakOutsideOfLoop_functionExpression_withALoop', () {
8473 final __test = new ErrorParserTest();
8474 runJUnitTest(__test, __test.test_breakOutsideOfLoop_functionExpression_w ithALoop);
8475 });
8476 _ut.test('test_constAndFinal', () {
8477 final __test = new ErrorParserTest();
8478 runJUnitTest(__test, __test.test_constAndFinal);
8479 });
8480 _ut.test('test_constAndVar', () {
8481 final __test = new ErrorParserTest();
8482 runJUnitTest(__test, __test.test_constAndVar);
8483 });
8484 _ut.test('test_constClass', () {
8485 final __test = new ErrorParserTest();
8486 runJUnitTest(__test, __test.test_constClass);
8487 });
8488 _ut.test('test_constConstructorWithBody', () {
8489 final __test = new ErrorParserTest();
8490 runJUnitTest(__test, __test.test_constConstructorWithBody);
8491 });
8492 _ut.test('test_constFactory', () {
8493 final __test = new ErrorParserTest();
8494 runJUnitTest(__test, __test.test_constFactory);
8495 });
8496 _ut.test('test_constMethod', () {
8497 final __test = new ErrorParserTest();
8498 runJUnitTest(__test, __test.test_constMethod);
8499 });
8500 _ut.test('test_constTypedef', () {
8501 final __test = new ErrorParserTest();
8502 runJUnitTest(__test, __test.test_constTypedef);
8503 });
8504 _ut.test('test_constructorWithReturnType', () {
8505 final __test = new ErrorParserTest();
8506 runJUnitTest(__test, __test.test_constructorWithReturnType);
8507 });
8508 _ut.test('test_constructorWithReturnType_var', () {
8509 final __test = new ErrorParserTest();
8510 runJUnitTest(__test, __test.test_constructorWithReturnType_var);
8511 });
8512 _ut.test('test_continueOutsideOfLoop_continueInDoStatement', () {
8513 final __test = new ErrorParserTest();
8514 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInDoState ment);
8515 });
8516 _ut.test('test_continueOutsideOfLoop_continueInForStatement', () {
8517 final __test = new ErrorParserTest();
8518 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInForStat ement);
8519 });
8520 _ut.test('test_continueOutsideOfLoop_continueInIfStatement', () {
8521 final __test = new ErrorParserTest();
8522 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInIfState ment);
8523 });
8524 _ut.test('test_continueOutsideOfLoop_continueInSwitchStatement', () {
8525 final __test = new ErrorParserTest();
8526 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInSwitchS tatement);
8527 });
8528 _ut.test('test_continueOutsideOfLoop_continueInWhileStatement', () {
8529 final __test = new ErrorParserTest();
8530 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInWhileSt atement);
8531 });
8532 _ut.test('test_continueOutsideOfLoop_functionExpression_inALoop', () {
8533 final __test = new ErrorParserTest();
8534 runJUnitTest(__test, __test.test_continueOutsideOfLoop_functionExpressio n_inALoop);
8535 });
8536 _ut.test('test_continueOutsideOfLoop_functionExpression_withALoop', () {
8537 final __test = new ErrorParserTest();
8538 runJUnitTest(__test, __test.test_continueOutsideOfLoop_functionExpressio n_withALoop);
8539 });
8540 _ut.test('test_continueWithoutLabelInCase_error', () {
8541 final __test = new ErrorParserTest();
8542 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_error);
8543 });
8544 _ut.test('test_continueWithoutLabelInCase_noError', () {
8545 final __test = new ErrorParserTest();
8546 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_noError);
8547 });
8548 _ut.test('test_continueWithoutLabelInCase_noError_switchInLoop', () {
8549 final __test = new ErrorParserTest();
8550 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_noError_swit chInLoop);
8551 });
8552 _ut.test('test_deprecatedClassTypeAlias', () {
8553 final __test = new ErrorParserTest();
8554 runJUnitTest(__test, __test.test_deprecatedClassTypeAlias);
8555 });
8556 _ut.test('test_deprecatedClassTypeAlias_withGeneric', () {
8557 final __test = new ErrorParserTest();
8558 runJUnitTest(__test, __test.test_deprecatedClassTypeAlias_withGeneric);
8559 });
8560 _ut.test('test_directiveAfterDeclaration_classBeforeDirective', () {
8561 final __test = new ErrorParserTest();
8562 runJUnitTest(__test, __test.test_directiveAfterDeclaration_classBeforeDi rective);
8563 });
8564 _ut.test('test_directiveAfterDeclaration_classBetweenDirectives', () {
8565 final __test = new ErrorParserTest();
8566 runJUnitTest(__test, __test.test_directiveAfterDeclaration_classBetweenD irectives);
8567 });
8568 _ut.test('test_duplicateLabelInSwitchStatement', () {
8569 final __test = new ErrorParserTest();
8570 runJUnitTest(__test, __test.test_duplicateLabelInSwitchStatement);
8571 });
8572 _ut.test('test_duplicatedModifier_const', () {
8573 final __test = new ErrorParserTest();
8574 runJUnitTest(__test, __test.test_duplicatedModifier_const);
8575 });
8576 _ut.test('test_duplicatedModifier_external', () {
8577 final __test = new ErrorParserTest();
8578 runJUnitTest(__test, __test.test_duplicatedModifier_external);
8579 });
8580 _ut.test('test_duplicatedModifier_factory', () {
8581 final __test = new ErrorParserTest();
8582 runJUnitTest(__test, __test.test_duplicatedModifier_factory);
8583 });
8584 _ut.test('test_duplicatedModifier_final', () {
8585 final __test = new ErrorParserTest();
8586 runJUnitTest(__test, __test.test_duplicatedModifier_final);
8587 });
8588 _ut.test('test_duplicatedModifier_static', () {
8589 final __test = new ErrorParserTest();
8590 runJUnitTest(__test, __test.test_duplicatedModifier_static);
8591 });
8592 _ut.test('test_duplicatedModifier_var', () {
8593 final __test = new ErrorParserTest();
8594 runJUnitTest(__test, __test.test_duplicatedModifier_var);
8595 });
8596 _ut.test('test_equalityCannotBeEqualityOperand_eq_eq', () {
8597 final __test = new ErrorParserTest();
8598 runJUnitTest(__test, __test.test_equalityCannotBeEqualityOperand_eq_eq);
8599 });
8600 _ut.test('test_equalityCannotBeEqualityOperand_eq_neq', () {
8601 final __test = new ErrorParserTest();
8602 runJUnitTest(__test, __test.test_equalityCannotBeEqualityOperand_eq_neq) ;
8603 });
8604 _ut.test('test_equalityCannotBeEqualityOperand_neq_eq', () {
8605 final __test = new ErrorParserTest();
8606 runJUnitTest(__test, __test.test_equalityCannotBeEqualityOperand_neq_eq) ;
8607 });
8608 _ut.test('test_expectedCaseOrDefault', () {
8609 final __test = new ErrorParserTest();
8610 runJUnitTest(__test, __test.test_expectedCaseOrDefault);
8611 });
8612 _ut.test('test_expectedClassMember_inClass_afterType', () {
8613 final __test = new ErrorParserTest();
8614 runJUnitTest(__test, __test.test_expectedClassMember_inClass_afterType);
8615 });
8616 _ut.test('test_expectedClassMember_inClass_beforeType', () {
8617 final __test = new ErrorParserTest();
8618 runJUnitTest(__test, __test.test_expectedClassMember_inClass_beforeType) ;
8619 });
8620 _ut.test('test_expectedExecutable_inClass_afterVoid', () {
8621 final __test = new ErrorParserTest();
8622 runJUnitTest(__test, __test.test_expectedExecutable_inClass_afterVoid);
8623 });
8624 _ut.test('test_expectedExecutable_topLevel_afterType', () {
8625 final __test = new ErrorParserTest();
8626 runJUnitTest(__test, __test.test_expectedExecutable_topLevel_afterType);
8627 });
8628 _ut.test('test_expectedExecutable_topLevel_afterVoid', () {
8629 final __test = new ErrorParserTest();
8630 runJUnitTest(__test, __test.test_expectedExecutable_topLevel_afterVoid);
8631 });
8632 _ut.test('test_expectedExecutable_topLevel_beforeType', () {
8633 final __test = new ErrorParserTest();
8634 runJUnitTest(__test, __test.test_expectedExecutable_topLevel_beforeType) ;
8635 });
8636 _ut.test('test_expectedInterpolationIdentifier', () {
8637 final __test = new ErrorParserTest();
8638 runJUnitTest(__test, __test.test_expectedInterpolationIdentifier);
8639 });
8640 _ut.test('test_expectedStringLiteral', () {
8641 final __test = new ErrorParserTest();
8642 runJUnitTest(__test, __test.test_expectedStringLiteral);
8643 });
8644 _ut.test('test_expectedToken_commaMissingInArgumentList', () {
8645 final __test = new ErrorParserTest();
8646 runJUnitTest(__test, __test.test_expectedToken_commaMissingInArgumentLis t);
8647 });
8648 _ut.test('test_expectedToken_parseStatement_afterVoid', () {
8649 final __test = new ErrorParserTest();
8650 runJUnitTest(__test, __test.test_expectedToken_parseStatement_afterVoid) ;
8651 });
8652 _ut.test('test_expectedToken_semicolonAfterClass', () {
8653 final __test = new ErrorParserTest();
8654 runJUnitTest(__test, __test.test_expectedToken_semicolonAfterClass);
8655 });
8656 _ut.test('test_expectedToken_semicolonMissingAfterExpression', () {
8657 final __test = new ErrorParserTest();
8658 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterExpr ession);
8659 });
8660 _ut.test('test_expectedToken_whileMissingInDoStatement', () {
8661 final __test = new ErrorParserTest();
8662 runJUnitTest(__test, __test.test_expectedToken_whileMissingInDoStatement );
8663 });
8664 _ut.test('test_expectedTypeName_is', () {
8665 final __test = new ErrorParserTest();
8666 runJUnitTest(__test, __test.test_expectedTypeName_is);
8667 });
8668 _ut.test('test_exportDirectiveAfterPartDirective', () {
8669 final __test = new ErrorParserTest();
8670 runJUnitTest(__test, __test.test_exportDirectiveAfterPartDirective);
8671 });
8672 _ut.test('test_externalAfterConst', () {
8673 final __test = new ErrorParserTest();
8674 runJUnitTest(__test, __test.test_externalAfterConst);
8675 });
8676 _ut.test('test_externalAfterFactory', () {
8677 final __test = new ErrorParserTest();
8678 runJUnitTest(__test, __test.test_externalAfterFactory);
8679 });
8680 _ut.test('test_externalAfterStatic', () {
8681 final __test = new ErrorParserTest();
8682 runJUnitTest(__test, __test.test_externalAfterStatic);
8683 });
8684 _ut.test('test_externalClass', () {
8685 final __test = new ErrorParserTest();
8686 runJUnitTest(__test, __test.test_externalClass);
8687 });
8688 _ut.test('test_externalConstructorWithBody_factory', () {
8689 final __test = new ErrorParserTest();
8690 runJUnitTest(__test, __test.test_externalConstructorWithBody_factory);
8691 });
8692 _ut.test('test_externalConstructorWithBody_named', () {
8693 final __test = new ErrorParserTest();
8694 runJUnitTest(__test, __test.test_externalConstructorWithBody_named);
8695 });
8696 _ut.test('test_externalField_const', () {
8697 final __test = new ErrorParserTest();
8698 runJUnitTest(__test, __test.test_externalField_const);
8699 });
8700 _ut.test('test_externalField_final', () {
8701 final __test = new ErrorParserTest();
8702 runJUnitTest(__test, __test.test_externalField_final);
8703 });
8704 _ut.test('test_externalField_static', () {
8705 final __test = new ErrorParserTest();
8706 runJUnitTest(__test, __test.test_externalField_static);
8707 });
8708 _ut.test('test_externalField_typed', () {
8709 final __test = new ErrorParserTest();
8710 runJUnitTest(__test, __test.test_externalField_typed);
8711 });
8712 _ut.test('test_externalField_untyped', () {
8713 final __test = new ErrorParserTest();
8714 runJUnitTest(__test, __test.test_externalField_untyped);
8715 });
8716 _ut.test('test_externalGetterWithBody', () {
8717 final __test = new ErrorParserTest();
8718 runJUnitTest(__test, __test.test_externalGetterWithBody);
8719 });
8720 _ut.test('test_externalMethodWithBody', () {
8721 final __test = new ErrorParserTest();
8722 runJUnitTest(__test, __test.test_externalMethodWithBody);
8723 });
8724 _ut.test('test_externalOperatorWithBody', () {
8725 final __test = new ErrorParserTest();
8726 runJUnitTest(__test, __test.test_externalOperatorWithBody);
8727 });
8728 _ut.test('test_externalSetterWithBody', () {
8729 final __test = new ErrorParserTest();
8730 runJUnitTest(__test, __test.test_externalSetterWithBody);
8731 });
8732 _ut.test('test_externalTypedef', () {
8733 final __test = new ErrorParserTest();
8734 runJUnitTest(__test, __test.test_externalTypedef);
8735 });
8736 _ut.test('test_factoryTopLevelDeclaration_class', () {
8737 final __test = new ErrorParserTest();
8738 runJUnitTest(__test, __test.test_factoryTopLevelDeclaration_class);
8739 });
8740 _ut.test('test_factoryTopLevelDeclaration_typedef', () {
8741 final __test = new ErrorParserTest();
8742 runJUnitTest(__test, __test.test_factoryTopLevelDeclaration_typedef);
8743 });
8744 _ut.test('test_factoryWithoutBody', () {
8745 final __test = new ErrorParserTest();
8746 runJUnitTest(__test, __test.test_factoryWithoutBody);
8747 });
8748 _ut.test('test_fieldInitializerOutsideConstructor', () {
8749 final __test = new ErrorParserTest();
8750 runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor);
8751 });
8752 _ut.test('test_finalAndVar', () {
8753 final __test = new ErrorParserTest();
8754 runJUnitTest(__test, __test.test_finalAndVar);
8755 });
8756 _ut.test('test_finalClass', () {
8757 final __test = new ErrorParserTest();
8758 runJUnitTest(__test, __test.test_finalClass);
8759 });
8760 _ut.test('test_finalConstructor', () {
8761 final __test = new ErrorParserTest();
8762 runJUnitTest(__test, __test.test_finalConstructor);
8763 });
8764 _ut.test('test_finalMethod', () {
8765 final __test = new ErrorParserTest();
8766 runJUnitTest(__test, __test.test_finalMethod);
8767 });
8768 _ut.test('test_finalTypedef', () {
8769 final __test = new ErrorParserTest();
8770 runJUnitTest(__test, __test.test_finalTypedef);
8771 });
8772 _ut.test('test_functionTypedParameter_const', () {
8773 final __test = new ErrorParserTest();
8774 runJUnitTest(__test, __test.test_functionTypedParameter_const);
8775 });
8776 _ut.test('test_functionTypedParameter_final', () {
8777 final __test = new ErrorParserTest();
8778 runJUnitTest(__test, __test.test_functionTypedParameter_final);
8779 });
8780 _ut.test('test_functionTypedParameter_var', () {
8781 final __test = new ErrorParserTest();
8782 runJUnitTest(__test, __test.test_functionTypedParameter_var);
8783 });
8784 _ut.test('test_getterInFunction_block', () {
8785 final __test = new ErrorParserTest();
8786 runJUnitTest(__test, __test.test_getterInFunction_block);
8787 });
8788 _ut.test('test_getterInFunction_expression', () {
8789 final __test = new ErrorParserTest();
8790 runJUnitTest(__test, __test.test_getterInFunction_expression);
8791 });
8792 _ut.test('test_getterWithParameters', () {
8793 final __test = new ErrorParserTest();
8794 runJUnitTest(__test, __test.test_getterWithParameters);
8795 });
8796 _ut.test('test_illegalAssignmentToNonAssignable_superAssigned', () {
8797 final __test = new ErrorParserTest();
8798 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_superA ssigned);
8799 });
8800 _ut.test('test_implementsBeforeExtends', () {
8801 final __test = new ErrorParserTest();
8802 runJUnitTest(__test, __test.test_implementsBeforeExtends);
8803 });
8804 _ut.test('test_implementsBeforeWith', () {
8805 final __test = new ErrorParserTest();
8806 runJUnitTest(__test, __test.test_implementsBeforeWith);
8807 });
8808 _ut.test('test_importDirectiveAfterPartDirective', () {
8809 final __test = new ErrorParserTest();
8810 runJUnitTest(__test, __test.test_importDirectiveAfterPartDirective);
8811 });
8812 _ut.test('test_initializedVariableInForEach', () {
8813 final __test = new ErrorParserTest();
8814 runJUnitTest(__test, __test.test_initializedVariableInForEach);
8815 });
8816 _ut.test('test_invalidCodePoint', () {
8817 final __test = new ErrorParserTest();
8818 runJUnitTest(__test, __test.test_invalidCodePoint);
8819 });
8820 _ut.test('test_invalidHexEscape_invalidDigit', () {
8821 final __test = new ErrorParserTest();
8822 runJUnitTest(__test, __test.test_invalidHexEscape_invalidDigit);
8823 });
8824 _ut.test('test_invalidHexEscape_tooFewDigits', () {
8825 final __test = new ErrorParserTest();
8826 runJUnitTest(__test, __test.test_invalidHexEscape_tooFewDigits);
8827 });
8828 _ut.test('test_invalidInterpolationIdentifier_startWithDigit', () {
8829 final __test = new ErrorParserTest();
8830 runJUnitTest(__test, __test.test_invalidInterpolationIdentifier_startWit hDigit);
8831 });
8832 _ut.test('test_invalidOperator', () {
8833 final __test = new ErrorParserTest();
8834 runJUnitTest(__test, __test.test_invalidOperator);
8835 });
8836 _ut.test('test_invalidOperatorForSuper', () {
8837 final __test = new ErrorParserTest();
8838 runJUnitTest(__test, __test.test_invalidOperatorForSuper);
8839 });
8840 _ut.test('test_invalidUnicodeEscape_incomplete_noDigits', () {
8841 final __test = new ErrorParserTest();
8842 runJUnitTest(__test, __test.test_invalidUnicodeEscape_incomplete_noDigit s);
8843 });
8844 _ut.test('test_invalidUnicodeEscape_incomplete_someDigits', () {
8845 final __test = new ErrorParserTest();
8846 runJUnitTest(__test, __test.test_invalidUnicodeEscape_incomplete_someDig its);
8847 });
8848 _ut.test('test_invalidUnicodeEscape_invalidDigit', () {
8849 final __test = new ErrorParserTest();
8850 runJUnitTest(__test, __test.test_invalidUnicodeEscape_invalidDigit);
8851 });
8852 _ut.test('test_invalidUnicodeEscape_tooFewDigits_fixed', () {
8853 final __test = new ErrorParserTest();
8854 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooFewDigits_fixed );
8855 });
8856 _ut.test('test_invalidUnicodeEscape_tooFewDigits_variable', () {
8857 final __test = new ErrorParserTest();
8858 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooFewDigits_varia ble);
8859 });
8860 _ut.test('test_invalidUnicodeEscape_tooManyDigits_variable', () {
8861 final __test = new ErrorParserTest();
8862 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooManyDigits_vari able);
8863 });
8864 _ut.test('test_libraryDirectiveNotFirst', () {
8865 final __test = new ErrorParserTest();
8866 runJUnitTest(__test, __test.test_libraryDirectiveNotFirst);
8867 });
8868 _ut.test('test_libraryDirectiveNotFirst_afterPart', () {
8869 final __test = new ErrorParserTest();
8870 runJUnitTest(__test, __test.test_libraryDirectiveNotFirst_afterPart);
8871 });
8872 _ut.test('test_localFunctionDeclarationModifier_abstract', () {
8873 final __test = new ErrorParserTest();
8874 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_abstra ct);
8875 });
8876 _ut.test('test_localFunctionDeclarationModifier_external', () {
8877 final __test = new ErrorParserTest();
8878 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_extern al);
8879 });
8880 _ut.test('test_localFunctionDeclarationModifier_factory', () {
8881 final __test = new ErrorParserTest();
8882 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_factor y);
8883 });
8884 _ut.test('test_localFunctionDeclarationModifier_static', () {
8885 final __test = new ErrorParserTest();
8886 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_static );
8887 });
8888 _ut.test('test_missingAssignableSelector_identifiersAssigned', () {
8889 final __test = new ErrorParserTest();
8890 runJUnitTest(__test, __test.test_missingAssignableSelector_identifiersAs signed);
8891 });
8892 _ut.test('test_missingAssignableSelector_postfix_minusMinus_literal', () {
8893 final __test = new ErrorParserTest();
8894 runJUnitTest(__test, __test.test_missingAssignableSelector_postfix_minus Minus_literal);
8895 });
8896 _ut.test('test_missingAssignableSelector_postfix_plusPlus_literal', () {
8897 final __test = new ErrorParserTest();
8898 runJUnitTest(__test, __test.test_missingAssignableSelector_postfix_plusP lus_literal);
8899 });
8900 _ut.test('test_missingAssignableSelector_prefix_minusMinus_literal', () {
8901 final __test = new ErrorParserTest();
8902 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_minusM inus_literal);
8903 });
8904 _ut.test('test_missingAssignableSelector_prefix_plusPlus_literal', () {
8905 final __test = new ErrorParserTest();
8906 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_plusPl us_literal);
8907 });
8908 _ut.test('test_missingAssignableSelector_primarySelectorPostfix', () {
8909 final __test = new ErrorParserTest();
8910 runJUnitTest(__test, __test.test_missingAssignableSelector_primarySelect orPostfix);
8911 });
8912 _ut.test('test_missingAssignableSelector_selector', () {
8913 final __test = new ErrorParserTest();
8914 runJUnitTest(__test, __test.test_missingAssignableSelector_selector);
8915 });
8916 _ut.test('test_missingAssignableSelector_superPrimaryExpression', () {
8917 final __test = new ErrorParserTest();
8918 runJUnitTest(__test, __test.test_missingAssignableSelector_superPrimaryE xpression);
8919 });
8920 _ut.test('test_missingAssignableSelector_superPropertyAccessAssigned', () {
8921 final __test = new ErrorParserTest();
8922 runJUnitTest(__test, __test.test_missingAssignableSelector_superProperty AccessAssigned);
8923 });
8924 _ut.test('test_missingCatchOrFinally', () {
8925 final __test = new ErrorParserTest();
8926 runJUnitTest(__test, __test.test_missingCatchOrFinally);
8927 });
8928 _ut.test('test_missingClassBody', () {
8929 final __test = new ErrorParserTest();
8930 runJUnitTest(__test, __test.test_missingClassBody);
8931 });
8932 _ut.test('test_missingConstFinalVarOrType_static', () {
8933 final __test = new ErrorParserTest();
8934 runJUnitTest(__test, __test.test_missingConstFinalVarOrType_static);
8935 });
8936 _ut.test('test_missingConstFinalVarOrType_topLevel', () {
8937 final __test = new ErrorParserTest();
8938 runJUnitTest(__test, __test.test_missingConstFinalVarOrType_topLevel);
8939 });
8940 _ut.test('test_missingExpressionInThrow_withCascade', () {
8941 final __test = new ErrorParserTest();
8942 runJUnitTest(__test, __test.test_missingExpressionInThrow_withCascade);
8943 });
8944 _ut.test('test_missingExpressionInThrow_withoutCascade', () {
8945 final __test = new ErrorParserTest();
8946 runJUnitTest(__test, __test.test_missingExpressionInThrow_withoutCascade );
8947 });
8948 _ut.test('test_missingFunctionBody_emptyNotAllowed', () {
8949 final __test = new ErrorParserTest();
8950 runJUnitTest(__test, __test.test_missingFunctionBody_emptyNotAllowed);
8951 });
8952 _ut.test('test_missingFunctionBody_invalid', () {
8953 final __test = new ErrorParserTest();
8954 runJUnitTest(__test, __test.test_missingFunctionBody_invalid);
8955 });
8956 _ut.test('test_missingFunctionParameters_local_void_block', () {
8957 final __test = new ErrorParserTest();
8958 runJUnitTest(__test, __test.test_missingFunctionParameters_local_void_bl ock);
8959 });
8960 _ut.test('test_missingFunctionParameters_local_void_expression', () {
8961 final __test = new ErrorParserTest();
8962 runJUnitTest(__test, __test.test_missingFunctionParameters_local_void_ex pression);
8963 });
8964 _ut.test('test_missingFunctionParameters_topLevel_nonVoid_block', () {
8965 final __test = new ErrorParserTest();
8966 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_nonV oid_block);
8967 });
8968 _ut.test('test_missingFunctionParameters_topLevel_nonVoid_expression', () {
8969 final __test = new ErrorParserTest();
8970 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_nonV oid_expression);
8971 });
8972 _ut.test('test_missingFunctionParameters_topLevel_void_block', () {
8973 final __test = new ErrorParserTest();
8974 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_void _block);
8975 });
8976 _ut.test('test_missingFunctionParameters_topLevel_void_expression', () {
8977 final __test = new ErrorParserTest();
8978 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_void _expression);
8979 });
8980 _ut.test('test_missingIdentifier_afterOperator', () {
8981 final __test = new ErrorParserTest();
8982 runJUnitTest(__test, __test.test_missingIdentifier_afterOperator);
8983 });
8984 _ut.test('test_missingIdentifier_beforeClosingCurly', () {
8985 final __test = new ErrorParserTest();
8986 runJUnitTest(__test, __test.test_missingIdentifier_beforeClosingCurly);
8987 });
8988 _ut.test('test_missingIdentifier_functionDeclaration_returnTypeWithoutName ', () {
8989 final __test = new ErrorParserTest();
8990 runJUnitTest(__test, __test.test_missingIdentifier_functionDeclaration_r eturnTypeWithoutName);
8991 });
8992 _ut.test('test_missingIdentifier_inSymbol_afterPeriod', () {
8993 final __test = new ErrorParserTest();
8994 runJUnitTest(__test, __test.test_missingIdentifier_inSymbol_afterPeriod) ;
8995 });
8996 _ut.test('test_missingIdentifier_inSymbol_first', () {
8997 final __test = new ErrorParserTest();
8998 runJUnitTest(__test, __test.test_missingIdentifier_inSymbol_first);
8999 });
9000 _ut.test('test_missingIdentifier_number', () {
9001 final __test = new ErrorParserTest();
9002 runJUnitTest(__test, __test.test_missingIdentifier_number);
9003 });
9004 _ut.test('test_missingKeywordOperator', () {
9005 final __test = new ErrorParserTest();
9006 runJUnitTest(__test, __test.test_missingKeywordOperator);
9007 });
9008 _ut.test('test_missingKeywordOperator_parseClassMember', () {
9009 final __test = new ErrorParserTest();
9010 runJUnitTest(__test, __test.test_missingKeywordOperator_parseClassMember );
9011 });
9012 _ut.test('test_missingKeywordOperator_parseClassMember_afterTypeName', () {
9013 final __test = new ErrorParserTest();
9014 runJUnitTest(__test, __test.test_missingKeywordOperator_parseClassMember _afterTypeName);
9015 });
9016 _ut.test('test_missingKeywordOperator_parseClassMember_afterVoid', () {
9017 final __test = new ErrorParserTest();
9018 runJUnitTest(__test, __test.test_missingKeywordOperator_parseClassMember _afterVoid);
9019 });
9020 _ut.test('test_missingNameInLibraryDirective', () {
9021 final __test = new ErrorParserTest();
9022 runJUnitTest(__test, __test.test_missingNameInLibraryDirective);
9023 });
9024 _ut.test('test_missingNameInPartOfDirective', () {
9025 final __test = new ErrorParserTest();
9026 runJUnitTest(__test, __test.test_missingNameInPartOfDirective);
9027 });
9028 _ut.test('test_missingStatement', () {
9029 final __test = new ErrorParserTest();
9030 runJUnitTest(__test, __test.test_missingStatement);
9031 });
9032 _ut.test('test_missingStatement_afterVoid', () {
9033 final __test = new ErrorParserTest();
9034 runJUnitTest(__test, __test.test_missingStatement_afterVoid);
9035 });
9036 _ut.test('test_missingTerminatorForParameterGroup_named', () {
9037 final __test = new ErrorParserTest();
9038 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_name d);
9039 });
9040 _ut.test('test_missingTerminatorForParameterGroup_optional', () {
9041 final __test = new ErrorParserTest();
9042 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_opti onal);
9043 });
9044 _ut.test('test_missingTypedefParameters_nonVoid', () {
9045 final __test = new ErrorParserTest();
9046 runJUnitTest(__test, __test.test_missingTypedefParameters_nonVoid);
9047 });
9048 _ut.test('test_missingTypedefParameters_typeParameters', () {
9049 final __test = new ErrorParserTest();
9050 runJUnitTest(__test, __test.test_missingTypedefParameters_typeParameters );
9051 });
9052 _ut.test('test_missingTypedefParameters_void', () {
9053 final __test = new ErrorParserTest();
9054 runJUnitTest(__test, __test.test_missingTypedefParameters_void);
9055 });
9056 _ut.test('test_missingVariableInForEach', () {
9057 final __test = new ErrorParserTest();
9058 runJUnitTest(__test, __test.test_missingVariableInForEach);
9059 });
9060 _ut.test('test_mixedParameterGroups_namedPositional', () {
9061 final __test = new ErrorParserTest();
9062 runJUnitTest(__test, __test.test_mixedParameterGroups_namedPositional);
9063 });
9064 _ut.test('test_mixedParameterGroups_positionalNamed', () {
9065 final __test = new ErrorParserTest();
9066 runJUnitTest(__test, __test.test_mixedParameterGroups_positionalNamed);
9067 });
9068 _ut.test('test_multipleExtendsClauses', () {
9069 final __test = new ErrorParserTest();
9070 runJUnitTest(__test, __test.test_multipleExtendsClauses);
9071 });
9072 _ut.test('test_multipleImplementsClauses', () {
9073 final __test = new ErrorParserTest();
9074 runJUnitTest(__test, __test.test_multipleImplementsClauses);
9075 });
9076 _ut.test('test_multipleLibraryDirectives', () {
9077 final __test = new ErrorParserTest();
9078 runJUnitTest(__test, __test.test_multipleLibraryDirectives);
9079 });
9080 _ut.test('test_multipleNamedParameterGroups', () {
9081 final __test = new ErrorParserTest();
9082 runJUnitTest(__test, __test.test_multipleNamedParameterGroups);
9083 });
9084 _ut.test('test_multiplePartOfDirectives', () {
9085 final __test = new ErrorParserTest();
9086 runJUnitTest(__test, __test.test_multiplePartOfDirectives);
9087 });
9088 _ut.test('test_multiplePositionalParameterGroups', () {
9089 final __test = new ErrorParserTest();
9090 runJUnitTest(__test, __test.test_multiplePositionalParameterGroups);
9091 });
9092 _ut.test('test_multipleVariablesInForEach', () {
9093 final __test = new ErrorParserTest();
9094 runJUnitTest(__test, __test.test_multipleVariablesInForEach);
9095 });
9096 _ut.test('test_multipleWithClauses', () {
9097 final __test = new ErrorParserTest();
9098 runJUnitTest(__test, __test.test_multipleWithClauses);
9099 });
9100 _ut.test('test_namedParameterOutsideGroup', () {
9101 final __test = new ErrorParserTest();
9102 runJUnitTest(__test, __test.test_namedParameterOutsideGroup);
9103 });
9104 _ut.test('test_nonConstructorFactory_field', () {
9105 final __test = new ErrorParserTest();
9106 runJUnitTest(__test, __test.test_nonConstructorFactory_field);
9107 });
9108 _ut.test('test_nonConstructorFactory_method', () {
9109 final __test = new ErrorParserTest();
9110 runJUnitTest(__test, __test.test_nonConstructorFactory_method);
9111 });
9112 _ut.test('test_nonIdentifierLibraryName_library', () {
9113 final __test = new ErrorParserTest();
9114 runJUnitTest(__test, __test.test_nonIdentifierLibraryName_library);
9115 });
9116 _ut.test('test_nonIdentifierLibraryName_partOf', () {
9117 final __test = new ErrorParserTest();
9118 runJUnitTest(__test, __test.test_nonIdentifierLibraryName_partOf);
9119 });
9120 _ut.test('test_nonPartOfDirectiveInPart_after', () {
9121 final __test = new ErrorParserTest();
9122 runJUnitTest(__test, __test.test_nonPartOfDirectiveInPart_after);
9123 });
9124 _ut.test('test_nonPartOfDirectiveInPart_before', () {
9125 final __test = new ErrorParserTest();
9126 runJUnitTest(__test, __test.test_nonPartOfDirectiveInPart_before);
9127 });
9128 _ut.test('test_nonUserDefinableOperator', () {
9129 final __test = new ErrorParserTest();
9130 runJUnitTest(__test, __test.test_nonUserDefinableOperator);
9131 });
9132 _ut.test('test_optionalAfterNormalParameters_named', () {
9133 final __test = new ErrorParserTest();
9134 runJUnitTest(__test, __test.test_optionalAfterNormalParameters_named);
9135 });
9136 _ut.test('test_optionalAfterNormalParameters_positional', () {
9137 final __test = new ErrorParserTest();
9138 runJUnitTest(__test, __test.test_optionalAfterNormalParameters_positiona l);
9139 });
9140 _ut.test('test_parseCascadeSection_missingIdentifier', () {
9141 final __test = new ErrorParserTest();
9142 runJUnitTest(__test, __test.test_parseCascadeSection_missingIdentifier);
9143 });
9144 _ut.test('test_positionalAfterNamedArgument', () {
9145 final __test = new ErrorParserTest();
9146 runJUnitTest(__test, __test.test_positionalAfterNamedArgument);
9147 });
9148 _ut.test('test_positionalParameterOutsideGroup', () {
9149 final __test = new ErrorParserTest();
9150 runJUnitTest(__test, __test.test_positionalParameterOutsideGroup);
9151 });
9152 _ut.test('test_redirectionInNonFactoryConstructor', () {
9153 final __test = new ErrorParserTest();
9154 runJUnitTest(__test, __test.test_redirectionInNonFactoryConstructor);
9155 });
9156 _ut.test('test_setterInFunction_block', () {
9157 final __test = new ErrorParserTest();
9158 runJUnitTest(__test, __test.test_setterInFunction_block);
9159 });
9160 _ut.test('test_setterInFunction_expression', () {
9161 final __test = new ErrorParserTest();
9162 runJUnitTest(__test, __test.test_setterInFunction_expression);
9163 });
9164 _ut.test('test_staticAfterConst', () {
9165 final __test = new ErrorParserTest();
9166 runJUnitTest(__test, __test.test_staticAfterConst);
9167 });
9168 _ut.test('test_staticAfterFinal', () {
9169 final __test = new ErrorParserTest();
9170 runJUnitTest(__test, __test.test_staticAfterFinal);
9171 });
9172 _ut.test('test_staticAfterVar', () {
9173 final __test = new ErrorParserTest();
9174 runJUnitTest(__test, __test.test_staticAfterVar);
9175 });
9176 _ut.test('test_staticConstructor', () {
9177 final __test = new ErrorParserTest();
9178 runJUnitTest(__test, __test.test_staticConstructor);
9179 });
9180 _ut.test('test_staticGetterWithoutBody', () {
9181 final __test = new ErrorParserTest();
9182 runJUnitTest(__test, __test.test_staticGetterWithoutBody);
9183 });
9184 _ut.test('test_staticOperator_noReturnType', () {
9185 final __test = new ErrorParserTest();
9186 runJUnitTest(__test, __test.test_staticOperator_noReturnType);
9187 });
9188 _ut.test('test_staticOperator_returnType', () {
9189 final __test = new ErrorParserTest();
9190 runJUnitTest(__test, __test.test_staticOperator_returnType);
9191 });
9192 _ut.test('test_staticSetterWithoutBody', () {
9193 final __test = new ErrorParserTest();
9194 runJUnitTest(__test, __test.test_staticSetterWithoutBody);
9195 });
9196 _ut.test('test_staticTopLevelDeclaration_class', () {
9197 final __test = new ErrorParserTest();
9198 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_class);
9199 });
9200 _ut.test('test_staticTopLevelDeclaration_function', () {
9201 final __test = new ErrorParserTest();
9202 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_function);
9203 });
9204 _ut.test('test_staticTopLevelDeclaration_typedef', () {
9205 final __test = new ErrorParserTest();
9206 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_typedef);
9207 });
9208 _ut.test('test_staticTopLevelDeclaration_variable', () {
9209 final __test = new ErrorParserTest();
9210 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_variable);
9211 });
9212 _ut.test('test_switchHasCaseAfterDefaultCase', () {
9213 final __test = new ErrorParserTest();
9214 runJUnitTest(__test, __test.test_switchHasCaseAfterDefaultCase);
9215 });
9216 _ut.test('test_switchHasCaseAfterDefaultCase_repeated', () {
9217 final __test = new ErrorParserTest();
9218 runJUnitTest(__test, __test.test_switchHasCaseAfterDefaultCase_repeated) ;
9219 });
9220 _ut.test('test_switchHasMultipleDefaultCases', () {
9221 final __test = new ErrorParserTest();
9222 runJUnitTest(__test, __test.test_switchHasMultipleDefaultCases);
9223 });
9224 _ut.test('test_switchHasMultipleDefaultCases_repeated', () {
9225 final __test = new ErrorParserTest();
9226 runJUnitTest(__test, __test.test_switchHasMultipleDefaultCases_repeated) ;
9227 });
9228 _ut.test('test_topLevelOperator_withType', () {
9229 final __test = new ErrorParserTest();
9230 runJUnitTest(__test, __test.test_topLevelOperator_withType);
9231 });
9232 _ut.test('test_topLevelOperator_withVoid', () {
9233 final __test = new ErrorParserTest();
9234 runJUnitTest(__test, __test.test_topLevelOperator_withVoid);
9235 });
9236 _ut.test('test_topLevelOperator_withoutType', () {
9237 final __test = new ErrorParserTest();
9238 runJUnitTest(__test, __test.test_topLevelOperator_withoutType);
9239 });
9240 _ut.test('test_unexpectedTerminatorForParameterGroup_named', () {
9241 final __test = new ErrorParserTest();
9242 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_n amed);
9243 });
9244 _ut.test('test_unexpectedTerminatorForParameterGroup_optional', () {
9245 final __test = new ErrorParserTest();
9246 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_o ptional);
9247 });
9248 _ut.test('test_unexpectedToken_semicolonBetweenClassMembers', () {
9249 final __test = new ErrorParserTest();
9250 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenClassMe mbers);
9251 });
9252 _ut.test('test_unexpectedToken_semicolonBetweenCompilationUnitMembers', () {
9253 final __test = new ErrorParserTest();
9254 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenCompila tionUnitMembers);
9255 });
9256 _ut.test('test_useOfUnaryPlusOperator', () {
9257 final __test = new ErrorParserTest();
9258 runJUnitTest(__test, __test.test_useOfUnaryPlusOperator);
9259 });
9260 _ut.test('test_varAndType_field', () {
9261 final __test = new ErrorParserTest();
9262 runJUnitTest(__test, __test.test_varAndType_field);
9263 });
9264 _ut.test('test_varAndType_topLevelVariable', () {
9265 final __test = new ErrorParserTest();
9266 runJUnitTest(__test, __test.test_varAndType_topLevelVariable);
9267 });
9268 _ut.test('test_varAsTypeName_as', () {
9269 final __test = new ErrorParserTest();
9270 runJUnitTest(__test, __test.test_varAsTypeName_as);
9271 });
9272 _ut.test('test_varClass', () {
9273 final __test = new ErrorParserTest();
9274 runJUnitTest(__test, __test.test_varClass);
9275 });
9276 _ut.test('test_varReturnType', () {
9277 final __test = new ErrorParserTest();
9278 runJUnitTest(__test, __test.test_varReturnType);
9279 });
9280 _ut.test('test_varTypedef', () {
9281 final __test = new ErrorParserTest();
9282 runJUnitTest(__test, __test.test_varTypedef);
9283 });
9284 _ut.test('test_voidParameter', () {
9285 final __test = new ErrorParserTest();
9286 runJUnitTest(__test, __test.test_voidParameter);
9287 });
9288 _ut.test('test_voidVariable_parseClassMember_initializer', () {
9289 final __test = new ErrorParserTest();
9290 runJUnitTest(__test, __test.test_voidVariable_parseClassMember_initializ er);
9291 });
9292 _ut.test('test_voidVariable_parseClassMember_noInitializer', () {
9293 final __test = new ErrorParserTest();
9294 runJUnitTest(__test, __test.test_voidVariable_parseClassMember_noInitial izer);
9295 });
9296 _ut.test('test_voidVariable_parseCompilationUnitMember_initializer', () {
9297 final __test = new ErrorParserTest();
9298 runJUnitTest(__test, __test.test_voidVariable_parseCompilationUnitMember _initializer);
9299 });
9300 _ut.test('test_voidVariable_parseCompilationUnitMember_noInitializer', () {
9301 final __test = new ErrorParserTest();
9302 runJUnitTest(__test, __test.test_voidVariable_parseCompilationUnitMember _noInitializer);
9303 });
9304 _ut.test('test_voidVariable_parseCompilationUnit_initializer', () {
9305 final __test = new ErrorParserTest();
9306 runJUnitTest(__test, __test.test_voidVariable_parseCompilationUnit_initi alizer);
9307 });
9308 _ut.test('test_voidVariable_parseCompilationUnit_noInitializer', () {
9309 final __test = new ErrorParserTest();
9310 runJUnitTest(__test, __test.test_voidVariable_parseCompilationUnit_noIni tializer);
9311 });
9312 _ut.test('test_voidVariable_statement_initializer', () {
9313 final __test = new ErrorParserTest();
9314 runJUnitTest(__test, __test.test_voidVariable_statement_initializer);
9315 });
9316 _ut.test('test_voidVariable_statement_noInitializer', () {
9317 final __test = new ErrorParserTest();
9318 runJUnitTest(__test, __test.test_voidVariable_statement_noInitializer);
9319 });
9320 _ut.test('test_withBeforeExtends', () {
9321 final __test = new ErrorParserTest();
9322 runJUnitTest(__test, __test.test_withBeforeExtends);
9323 });
9324 _ut.test('test_withWithoutExtends', () {
9325 final __test = new ErrorParserTest();
9326 runJUnitTest(__test, __test.test_withWithoutExtends);
9327 });
9328 _ut.test('test_wrongSeparatorForNamedParameter', () {
9329 final __test = new ErrorParserTest();
9330 runJUnitTest(__test, __test.test_wrongSeparatorForNamedParameter);
9331 });
9332 _ut.test('test_wrongSeparatorForPositionalParameter', () {
9333 final __test = new ErrorParserTest();
9334 runJUnitTest(__test, __test.test_wrongSeparatorForPositionalParameter);
9335 });
9336 _ut.test('test_wrongTerminatorForParameterGroup_named', () {
9337 final __test = new ErrorParserTest();
9338 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_named) ;
9339 });
9340 _ut.test('test_wrongTerminatorForParameterGroup_optional', () {
9341 final __test = new ErrorParserTest();
9342 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_option al);
9343 });
9344 });
9345 }
9346 }
9347 main() {
9348 ComplexParserTest.dartSuite();
9349 ErrorParserTest.dartSuite();
9350 RecoveryParserTest.dartSuite();
9351 SimpleParserTest.dartSuite();
9352 }
9353 Map<String, MethodTrampoline> _methodTable_Parser = <String, MethodTrampoline> {
9354 'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseCompilationUnit(arg0)),
9355 'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseExpression(arg0)),
9356 'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseStatement(arg0)),
9357 'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.p arseStatements(arg0)),
9358 'advance_0': new MethodTrampoline(0, (Parser target) => target.advance()),
9359 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg 2, arg3, arg4) => target.appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
9360 'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.computeStringValue(arg0, arg1, arg2)),
9361 'convertToFunctionDeclaration_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.convertToFunctionDeclaration(arg0)),
9362 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe t) => target.couldBeStartOfCompilationUnitMember()),
9363 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ et.createSyntheticIdentifier()),
9364 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t arget.createSyntheticStringLiteral()),
9365 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.createSyntheticToken(arg0)),
9366 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target. ensureAssignable(arg0)),
9367 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg 0)),
9368 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f indRange(arg0, arg1)),
9369 'gatherTodoComments_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.gatherTodoComments(arg0)),
9370 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.getCodeBlockRanges(arg0)),
9371 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn dToken(arg0)),
9372 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe t.hasReturnTypeInTypeAlias()),
9373 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i sFunctionDeclaration()),
9374 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.isFunctionExpression(arg0)),
9375 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD igit(arg0)),
9376 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isInitializedVariableDeclaration()),
9377 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. isLinkText(arg0, arg1)),
9378 'isOperator_1': new MethodTrampoline(1, (Parser target, arg0) => target.isOper ator(arg0)),
9379 'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target.isSwitch Member()),
9380 'isTypedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target .isTypedIdentifier(arg0)),
9381 'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.le xicallyFirst(arg0)),
9382 'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(a rg0)),
9383 'matches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.mat ches3(arg0, arg1)),
9384 'matchesAny_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. matchesAny(arg0, arg1)),
9385 'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target.match esIdentifier()),
9386 'matchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target .matchesIdentifier2(arg0)),
9387 'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target.optional (arg0)),
9388 'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target .parseAdditiveExpression()),
9389 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn notation()),
9390 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu ment()),
9391 'parseArgumentDefinitionTest_0': new MethodTrampoline(0, (Parser target) => ta rget.parseArgumentDefinitionTest()),
9392 'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parse ArgumentList()),
9393 'parseAssertStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseAssertStatement()),
9394 'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) = > target.parseAssignableExpression(arg0)),
9395 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg 1) => target.parseAssignableSelector(arg0, arg1)),
9396 'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseBitwiseAndExpression()),
9397 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseBitwiseOrExpression()),
9398 'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseBitwiseXorExpression()),
9399 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock() ),
9400 'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target.par seBreakStatement()),
9401 'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target.par seCascadeSection()),
9402 'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseClassDeclaration(arg0, arg1)),
9403 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target. parseClassMember(arg0)),
9404 'parseClassMembers_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseClassMembers(arg0, arg1)),
9405 'parseClassTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1) = > target.parseClassTypeAlias(arg0, arg1)),
9406 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target.parseC ombinators()),
9407 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target .parseCommentAndMetadata()),
9408 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseCommentReference(arg0, arg1)),
9409 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.parseCommentReferences(arg0)),
9410 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()),
9411 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseCompilationUnitMember(arg0)),
9412 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar get.parseConditionalExpression()),
9413 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstExpression()),
9414 '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)),
9415 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target.parseConstructorFieldInitializer()),
9416 'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstructorName()),
9417 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. parseContinueStatement()),
9418 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseDirective(arg0)),
9419 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et.parseDocumentationComment()),
9420 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target.parseD oStatement()),
9421 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target.par seEmptyStatement()),
9422 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target .parseEqualityExpression()),
9423 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseExportDirective(arg0)),
9424 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx pression2()),
9425 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par seExpressionList()),
9426 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target.parseExpressionWithoutCascade()),
9427 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars eExtendsClause()),
9428 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseFinalConstVarOrType(arg0)),
9429 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseFormalParameter(arg0)),
9430 'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => targe t.parseFormalParameterList()),
9431 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target.parse ForStatement()),
9432 'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg 2) => target.parseFunctionBody(arg0, arg1, arg2)),
9433 'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0, ar g1, arg2) => target.parseFunctionDeclaration(arg0, arg1, arg2)),
9434 'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target) => target.parseFunctionDeclarationStatement()),
9435 'parseFunctionDeclarationStatement_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseFunctionDeclarationStatement2(arg0, arg1)),
9436 'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target .parseFunctionExpression()),
9437 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1 ) => target.parseFunctionTypeAlias(arg0, arg1)),
9438 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseGetter(arg0, arg1, arg2, arg3)),
9439 'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target.par seIdentifierList()),
9440 'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target.parseI fStatement()),
9441 'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.p arseImplementsClause()),
9442 'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseImportDirective(arg0)),
9443 'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, ar g0, arg1, arg2, arg3) => target.parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
9444 'parseInstanceCreationExpression_1': new MethodTrampoline(1, (Parser target, a rg0) => target.parseInstanceCreationExpression(arg0)),
9445 'parseLibraryDirective_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.parseLibraryDirective(arg0)),
9446 'parseLibraryIdentifier_0': new MethodTrampoline(0, (Parser target) => target. parseLibraryIdentifier()),
9447 'parseLibraryName_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t arget.parseLibraryName(arg0, arg1)),
9448 'parseListLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t arget.parseListLiteral(arg0, arg1)),
9449 'parseListOrMapLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.parseListOrMapLiteral(arg0)),
9450 'parseLogicalAndExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseLogicalAndExpression()),
9451 'parseLogicalOrExpression_0': new MethodTrampoline(0, (Parser target) => targe t.parseLogicalOrExpression()),
9452 'parseMapLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => ta rget.parseMapLiteral(arg0, arg1)),
9453 'parseMapLiteralEntry_0': new MethodTrampoline(0, (Parser target) => target.pa rseMapLiteralEntry()),
9454 'parseMethodDeclaration_4': new MethodTrampoline(4, (Parser target, arg0, arg1 , arg2, arg3) => target.parseMethodDeclaration(arg0, arg1, arg2, arg3)),
9455 'parseMethodDeclaration_6': new MethodTrampoline(6, (Parser target, arg0, arg1 , arg2, arg3, arg4, arg5) => target.parseMethodDeclaration2(arg0, arg1, arg2, ar g3, arg4, arg5)),
9456 'parseModifiers_0': new MethodTrampoline(0, (Parser target) => target.parseMod ifiers()),
9457 'parseMultiplicativeExpression_0': new MethodTrampoline(0, (Parser target) => target.parseMultiplicativeExpression()),
9458 'parseNativeClause_0': new MethodTrampoline(0, (Parser target) => target.parse NativeClause()),
9459 'parseNewExpression_0': new MethodTrampoline(0, (Parser target) => target.pars eNewExpression()),
9460 'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => targe t.parseNonLabeledStatement()),
9461 'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => tar get.parseNormalFormalParameter()),
9462 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) = > target.parseOperator(arg0, arg1, arg2)),
9463 'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target .parseOptionalReturnType()),
9464 'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.parsePartDirective(arg0)),
9465 'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePostfixExpression()),
9466 'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target .parsePrefixedIdentifier()),
9467 'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePrimaryExpression()),
9468 'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser tar get) => target.parseRedirectingConstructorInvocation()),
9469 'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseRelationalExpression()),
9470 'parseRethrowExpression_0': new MethodTrampoline(0, (Parser target) => target. parseRethrowExpression()),
9471 'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseReturnStatement()),
9472 'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseRe turnType()),
9473 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseSetter(arg0, arg1, arg2, arg3)),
9474 'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseShiftExpression()),
9475 'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.p arseSimpleIdentifier()),
9476 'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseSta tement2()),
9477 'parseStatements_0': new MethodTrampoline(0, (Parser target) => target.parseSt atements2()),
9478 'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStringInterpolation(arg0)),
9479 'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eStringLiteral()),
9480 'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) = > target.parseSuperConstructorInvocation()),
9481 'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseSwitchStatement()),
9482 'parseSymbolLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eSymbolLiteral()),
9483 'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseThrowExpression()),
9484 'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target ) => target.parseThrowExpressionWithoutCascade()),
9485 'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target.parse TryStatement()),
9486 'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseTypeAlias(arg0)),
9487 'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.p arseTypeArgumentList()),
9488 'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseType Name()),
9489 'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.pars eTypeParameter()),
9490 'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target. parseTypeParameterList()),
9491 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseUnaryExpression()),
9492 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe t.parseVariableDeclaration()),
9493 'parseVariableDeclarationList_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.parseVariableDeclarationList(arg0)),
9494 'parseVariableDeclarationList_3': new MethodTrampoline(3, (Parser target, arg0 , arg1, arg2) => target.parseVariableDeclarationList2(arg0, arg1, arg2)),
9495 'parseVariableDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseVariableDeclarationStatement(arg0)),
9496 'parseVariableDeclarationStatement_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.parseVariableDeclarationStatement2(arg0, arg1, arg2 )),
9497 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par seWhileStatement()),
9498 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi thClause()),
9499 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()),
9500 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0)) ,
9501 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.reportError(arg0, arg1, arg2)),
9502 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target .reportError8(arg0, arg1)),
9503 'scrapeTodoComment_1': new MethodTrampoline(1, (Parser target, arg0) => target .scrapeTodoComment(arg0)),
9504 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFinalConstVarOrType(arg0)),
9505 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFormalParameterList(arg0)),
9506 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipPastMatchingToken(arg0)),
9507 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.skipPrefixedIdentifier(arg0)),
9508 'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target.sk ipReturnType(arg0)),
9509 'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.skipSimpleIdentifier(arg0)),
9510 'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipStringInterpolation(arg0)),
9511 'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target .skipStringLiteral(arg0)),
9512 'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.skipTypeArgumentList(arg0)),
9513 'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target.skip TypeName(arg0)),
9514 'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipTypeParameterList(arg0)),
9515 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.translateCharacter(arg0, arg1, arg2)),
9516 'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateFormalParameterList(arg0)),
9517 'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) = > target.validateModifiersForClass(arg0)),
9518 'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, a rg0) => target.validateModifiersForConstructor(arg0)),
9519 'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) = > target.validateModifiersForField(arg0)),
9520 'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForFunctionDeclarationStatement (arg0)),
9521 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parse r target, arg0) => target.validateModifiersForGetterOrSetterOrMethod(arg0)),
9522 'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.validateModifiersForOperator(arg0)),
9523 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser t arget, arg0) => target.validateModifiersForTopLevelDeclaration(arg0)),
9524 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)),
9525 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)),
9526 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),};
9527
9528
9529 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) {
9530 parser.currentToken = tokenStream;
9531 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} '];
9532 return method.invoke(parser, objects);
9533 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698