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

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

Issue 12803014: New Analysis Engine translation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // This code was auto-generated, is not intended to be edited, and is subject to 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. 2 // significant change. Please see the README file for more information.
3 3
4 library engine.parser_test; 4 library engine.parser_test;
5 5
6 import 'dart:collection'; 6 import 'dart:collection';
7 import 'package:analyzer_experimental/src/generated/java_core.dart'; 7 import 'package:analyzer_experimental/src/generated/java_core.dart';
8 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 8 import 'package:analyzer_experimental/src/generated/java_engine.dart';
9 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 9 import 'package:analyzer_experimental/src/generated/java_junit.dart';
10 import 'package:analyzer_experimental/src/generated/source.dart'; 10 import 'package:analyzer_experimental/src/generated/source.dart';
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 void test_isSwitchMember_default_labeled() { 193 void test_isSwitchMember_default_labeled() {
194 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); 194 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default"));
195 } 195 }
196 void test_isSwitchMember_default_unlabeled() { 196 void test_isSwitchMember_default_unlabeled() {
197 JUnitTestCase.assertTrue(isSwitchMember("default")); 197 JUnitTestCase.assertTrue(isSwitchMember("default"));
198 } 198 }
199 void test_isSwitchMember_false() { 199 void test_isSwitchMember_false() {
200 JUnitTestCase.assertFalse(isSwitchMember("break;")); 200 JUnitTestCase.assertFalse(isSwitchMember("break;"));
201 } 201 }
202 void test_parseAdditiveExpression_normal() { 202 void test_parseAdditiveExpression_normal() {
203 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression ", "x + y", []); 203 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "x + y", []);
204 JUnitTestCase.assertNotNull(expression.leftOperand); 204 JUnitTestCase.assertNotNull(expression.leftOperand);
205 JUnitTestCase.assertNotNull(expression.operator); 205 JUnitTestCase.assertNotNull(expression.operator);
206 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); 206 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
207 JUnitTestCase.assertNotNull(expression.rightOperand); 207 JUnitTestCase.assertNotNull(expression.rightOperand);
208 } 208 }
209 void test_parseAdditiveExpression_super() { 209 void test_parseAdditiveExpression_super() {
210 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression ", "super + y", []); 210 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "super + y", []);
211 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 211 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
212 JUnitTestCase.assertNotNull(expression.operator); 212 JUnitTestCase.assertNotNull(expression.operator);
213 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); 213 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
214 JUnitTestCase.assertNotNull(expression.rightOperand); 214 JUnitTestCase.assertNotNull(expression.rightOperand);
215 } 215 }
216 void test_parseAnnotation_n1() { 216 void test_parseAnnotation_n1() {
217 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A", []); 217 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A", []);
218 JUnitTestCase.assertNotNull(annotation.atSign); 218 JUnitTestCase.assertNotNull(annotation.atSign);
219 JUnitTestCase.assertNotNull(annotation.name); 219 JUnitTestCase.assertNotNull(annotation.name);
220 JUnitTestCase.assertNull(annotation.period); 220 JUnitTestCase.assertNull(annotation.period);
221 JUnitTestCase.assertNull(annotation.constructorName); 221 JUnitTestCase.assertNull(annotation.constructorName);
222 JUnitTestCase.assertNull(annotation.arguments); 222 JUnitTestCase.assertNull(annotation.arguments);
223 } 223 }
224 void test_parseAnnotation_n1_a() { 224 void test_parseAnnotation_n1_a() {
225 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A(x,y)", []); 225 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A(x,y)", []);
226 JUnitTestCase.assertNotNull(annotation.atSign); 226 JUnitTestCase.assertNotNull(annotation.atSign);
227 JUnitTestCase.assertNotNull(annotation.name); 227 JUnitTestCase.assertNotNull(annotation.name);
228 JUnitTestCase.assertNull(annotation.period); 228 JUnitTestCase.assertNull(annotation.period);
229 JUnitTestCase.assertNull(annotation.constructorName); 229 JUnitTestCase.assertNull(annotation.constructorName);
230 JUnitTestCase.assertNotNull(annotation.arguments); 230 JUnitTestCase.assertNotNull(annotation.arguments);
231 } 231 }
232 void test_parseAnnotation_n2() { 232 void test_parseAnnotation_n2() {
233 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B", []) ; 233 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B", []) ;
234 JUnitTestCase.assertNotNull(annotation.atSign); 234 JUnitTestCase.assertNotNull(annotation.atSign);
235 JUnitTestCase.assertNotNull(annotation.name); 235 JUnitTestCase.assertNotNull(annotation.name);
236 JUnitTestCase.assertNull(annotation.period); 236 JUnitTestCase.assertNull(annotation.period);
237 JUnitTestCase.assertNull(annotation.constructorName); 237 JUnitTestCase.assertNull(annotation.constructorName);
238 JUnitTestCase.assertNull(annotation.arguments); 238 JUnitTestCase.assertNull(annotation.arguments);
239 } 239 }
240 void test_parseAnnotation_n2_a() { 240 void test_parseAnnotation_n2_a() {
241 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B(x,y)" , []); 241 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B(x,y)" , []);
242 JUnitTestCase.assertNotNull(annotation.atSign); 242 JUnitTestCase.assertNotNull(annotation.atSign);
243 JUnitTestCase.assertNotNull(annotation.name); 243 JUnitTestCase.assertNotNull(annotation.name);
244 JUnitTestCase.assertNull(annotation.period); 244 JUnitTestCase.assertNull(annotation.period);
245 JUnitTestCase.assertNull(annotation.constructorName); 245 JUnitTestCase.assertNull(annotation.constructorName);
246 JUnitTestCase.assertNotNull(annotation.arguments); 246 JUnitTestCase.assertNotNull(annotation.arguments);
247 } 247 }
248 void test_parseAnnotation_n3() { 248 void test_parseAnnotation_n3() {
249 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C", [ ]); 249 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C", [ ]);
250 JUnitTestCase.assertNotNull(annotation.atSign); 250 JUnitTestCase.assertNotNull(annotation.atSign);
251 JUnitTestCase.assertNotNull(annotation.name); 251 JUnitTestCase.assertNotNull(annotation.name);
252 JUnitTestCase.assertNotNull(annotation.period); 252 JUnitTestCase.assertNotNull(annotation.period);
253 JUnitTestCase.assertNotNull(annotation.constructorName); 253 JUnitTestCase.assertNotNull(annotation.constructorName);
254 JUnitTestCase.assertNull(annotation.arguments); 254 JUnitTestCase.assertNull(annotation.arguments);
255 } 255 }
256 void test_parseAnnotation_n3_a() { 256 void test_parseAnnotation_n3_a() {
257 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C(x,y )", []); 257 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C(x,y )", []);
258 JUnitTestCase.assertNotNull(annotation.atSign); 258 JUnitTestCase.assertNotNull(annotation.atSign);
259 JUnitTestCase.assertNotNull(annotation.name); 259 JUnitTestCase.assertNotNull(annotation.name);
260 JUnitTestCase.assertNotNull(annotation.period); 260 JUnitTestCase.assertNotNull(annotation.period);
261 JUnitTestCase.assertNotNull(annotation.constructorName); 261 JUnitTestCase.assertNotNull(annotation.constructorName);
262 JUnitTestCase.assertNotNull(annotation.arguments); 262 JUnitTestCase.assertNotNull(annotation.arguments);
263 } 263 }
264 void test_parseArgument_named() { 264 void test_parseArgument_named() {
265 NamedExpression expression = ParserTestCase.parse6("parseArgument", "n: x", []); 265 NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x", []);
266 Label name23 = expression.name; 266 Label name23 = expression.name;
267 JUnitTestCase.assertNotNull(name23); 267 JUnitTestCase.assertNotNull(name23);
268 JUnitTestCase.assertNotNull(name23.label); 268 JUnitTestCase.assertNotNull(name23.label);
269 JUnitTestCase.assertNotNull(name23.colon); 269 JUnitTestCase.assertNotNull(name23.colon);
270 JUnitTestCase.assertNotNull(expression.expression); 270 JUnitTestCase.assertNotNull(expression.expression);
271 } 271 }
272 void test_parseArgument_unnamed() { 272 void test_parseArgument_unnamed() {
273 String lexeme = "x"; 273 String lexeme = "x";
274 SimpleIdentifier identifier = ParserTestCase.parse6("parseArgument", lexeme, []); 274 SimpleIdentifier identifier = ParserTestCase.parse5("parseArgument", lexeme, []);
275 JUnitTestCase.assertEquals(lexeme, identifier.name); 275 JUnitTestCase.assertEquals(lexeme, identifier.name);
276 } 276 }
277 void test_parseArgumentDefinitionTest() { 277 void test_parseArgumentDefinitionTest() {
278 ArgumentDefinitionTest test = ParserTestCase.parse6("parseArgumentDefinition Test", "?x", []); 278 ArgumentDefinitionTest test = ParserTestCase.parse5("parseArgumentDefinition Test", "?x", []);
279 JUnitTestCase.assertNotNull(test.question); 279 JUnitTestCase.assertNotNull(test.question);
280 JUnitTestCase.assertNotNull(test.identifier); 280 JUnitTestCase.assertNotNull(test.identifier);
281 } 281 }
282 void test_parseArgumentList_empty() { 282 void test_parseArgumentList_empty() {
283 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "()", []); 283 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()", []);
284 NodeList<Expression> arguments8 = argumentList.arguments; 284 NodeList<Expression> arguments8 = argumentList.arguments;
285 EngineTestCase.assertSize(0, arguments8); 285 EngineTestCase.assertSize(0, arguments8);
286 } 286 }
287 void test_parseArgumentList_mixed() { 287 void test_parseArgumentList_mixed() {
288 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(w, x, y: y, z: z)", []); 288 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w, x, y: y, z: z)", []);
289 NodeList<Expression> arguments9 = argumentList.arguments; 289 NodeList<Expression> arguments9 = argumentList.arguments;
290 EngineTestCase.assertSize(4, arguments9); 290 EngineTestCase.assertSize(4, arguments9);
291 } 291 }
292 void test_parseArgumentList_noNamed() { 292 void test_parseArgumentList_noNamed() {
293 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x, y, z)", []); 293 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x, y, z)", []);
294 NodeList<Expression> arguments10 = argumentList.arguments; 294 NodeList<Expression> arguments10 = argumentList.arguments;
295 EngineTestCase.assertSize(3, arguments10); 295 EngineTestCase.assertSize(3, arguments10);
296 } 296 }
297 void test_parseArgumentList_onlyNamed() { 297 void test_parseArgumentList_onlyNamed() {
298 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x: x, y: y)", []); 298 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x: x, y: y)", []);
299 NodeList<Expression> arguments11 = argumentList.arguments; 299 NodeList<Expression> arguments11 = argumentList.arguments;
300 EngineTestCase.assertSize(2, arguments11); 300 EngineTestCase.assertSize(2, arguments11);
301 } 301 }
302 void test_parseAssertStatement() { 302 void test_parseAssertStatement() {
303 AssertStatement statement = ParserTestCase.parse6("parseAssertStatement", "a ssert (x);", []); 303 AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "a ssert (x);", []);
304 JUnitTestCase.assertNotNull(statement.keyword); 304 JUnitTestCase.assertNotNull(statement.keyword);
305 JUnitTestCase.assertNotNull(statement.leftParenthesis); 305 JUnitTestCase.assertNotNull(statement.leftParenthesis);
306 JUnitTestCase.assertNotNull(statement.condition); 306 JUnitTestCase.assertNotNull(statement.condition);
307 JUnitTestCase.assertNotNull(statement.rightParenthesis); 307 JUnitTestCase.assertNotNull(statement.rightParenthesis);
308 JUnitTestCase.assertNotNull(statement.semicolon); 308 JUnitTestCase.assertNotNull(statement.semicolon);
309 } 309 }
310 void test_parseAssignableExpression_expression_args_dot() { 310 void test_parseAssignableExpression_expression_args_dot() {
311 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x)(y).z"); 311 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x)(y).z");
312 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE xpressionInvocation; 312 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE xpressionInvocation;
313 JUnitTestCase.assertNotNull(invocation.function); 313 JUnitTestCase.assertNotNull(invocation.function);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", < Object> [null, true], "[x]"); 379 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", < Object> [null, true], "[x]");
380 JUnitTestCase.assertNotNull(selector.leftBracket); 380 JUnitTestCase.assertNotNull(selector.leftBracket);
381 JUnitTestCase.assertNotNull(selector.index); 381 JUnitTestCase.assertNotNull(selector.index);
382 JUnitTestCase.assertNotNull(selector.rightBracket); 382 JUnitTestCase.assertNotNull(selector.rightBracket);
383 } 383 }
384 void test_parseAssignableSelector_none() { 384 void test_parseAssignableSelector_none() {
385 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier.full(null), true], ";"); 385 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier.full(null), true], ";");
386 JUnitTestCase.assertNotNull(selector); 386 JUnitTestCase.assertNotNull(selector);
387 } 387 }
388 void test_parseBitwiseAndExpression_normal() { 388 void test_parseBitwiseAndExpression_normal() {
389 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi on", "x & y", []); 389 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "x & y", []);
390 JUnitTestCase.assertNotNull(expression.leftOperand); 390 JUnitTestCase.assertNotNull(expression.leftOperand);
391 JUnitTestCase.assertNotNull(expression.operator); 391 JUnitTestCase.assertNotNull(expression.operator);
392 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); 392 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
393 JUnitTestCase.assertNotNull(expression.rightOperand); 393 JUnitTestCase.assertNotNull(expression.rightOperand);
394 } 394 }
395 void test_parseBitwiseAndExpression_super() { 395 void test_parseBitwiseAndExpression_super() {
396 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi on", "super & y", []); 396 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "super & y", []);
397 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 397 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
398 JUnitTestCase.assertNotNull(expression.operator); 398 JUnitTestCase.assertNotNull(expression.operator);
399 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); 399 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
400 JUnitTestCase.assertNotNull(expression.rightOperand); 400 JUnitTestCase.assertNotNull(expression.rightOperand);
401 } 401 }
402 void test_parseBitwiseOrExpression_normal() { 402 void test_parseBitwiseOrExpression_normal() {
403 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio n", "x | y", []); 403 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "x | y", []);
404 JUnitTestCase.assertNotNull(expression.leftOperand); 404 JUnitTestCase.assertNotNull(expression.leftOperand);
405 JUnitTestCase.assertNotNull(expression.operator); 405 JUnitTestCase.assertNotNull(expression.operator);
406 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); 406 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
407 JUnitTestCase.assertNotNull(expression.rightOperand); 407 JUnitTestCase.assertNotNull(expression.rightOperand);
408 } 408 }
409 void test_parseBitwiseOrExpression_super() { 409 void test_parseBitwiseOrExpression_super() {
410 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio n", "super | y", []); 410 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "super | y", []);
411 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 411 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
412 JUnitTestCase.assertNotNull(expression.operator); 412 JUnitTestCase.assertNotNull(expression.operator);
413 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); 413 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
414 JUnitTestCase.assertNotNull(expression.rightOperand); 414 JUnitTestCase.assertNotNull(expression.rightOperand);
415 } 415 }
416 void test_parseBitwiseXorExpression_normal() { 416 void test_parseBitwiseXorExpression_normal() {
417 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi on", "x ^ y", []); 417 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "x ^ y", []);
418 JUnitTestCase.assertNotNull(expression.leftOperand); 418 JUnitTestCase.assertNotNull(expression.leftOperand);
419 JUnitTestCase.assertNotNull(expression.operator); 419 JUnitTestCase.assertNotNull(expression.operator);
420 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); 420 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
421 JUnitTestCase.assertNotNull(expression.rightOperand); 421 JUnitTestCase.assertNotNull(expression.rightOperand);
422 } 422 }
423 void test_parseBitwiseXorExpression_super() { 423 void test_parseBitwiseXorExpression_super() {
424 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi on", "super ^ y", []); 424 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "super ^ y", []);
425 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 425 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
426 JUnitTestCase.assertNotNull(expression.operator); 426 JUnitTestCase.assertNotNull(expression.operator);
427 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); 427 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
428 JUnitTestCase.assertNotNull(expression.rightOperand); 428 JUnitTestCase.assertNotNull(expression.rightOperand);
429 } 429 }
430 void test_parseBlock_empty() { 430 void test_parseBlock_empty() {
431 Block block = ParserTestCase.parse6("parseBlock", "{}", []); 431 Block block = ParserTestCase.parse5("parseBlock", "{}", []);
432 JUnitTestCase.assertNotNull(block.leftBracket); 432 JUnitTestCase.assertNotNull(block.leftBracket);
433 EngineTestCase.assertSize(0, block.statements); 433 EngineTestCase.assertSize(0, block.statements);
434 JUnitTestCase.assertNotNull(block.rightBracket); 434 JUnitTestCase.assertNotNull(block.rightBracket);
435 } 435 }
436 void test_parseBlock_nonEmpty() { 436 void test_parseBlock_nonEmpty() {
437 Block block = ParserTestCase.parse6("parseBlock", "{;}", []); 437 Block block = ParserTestCase.parse5("parseBlock", "{;}", []);
438 JUnitTestCase.assertNotNull(block.leftBracket); 438 JUnitTestCase.assertNotNull(block.leftBracket);
439 EngineTestCase.assertSize(1, block.statements); 439 EngineTestCase.assertSize(1, block.statements);
440 JUnitTestCase.assertNotNull(block.rightBracket); 440 JUnitTestCase.assertNotNull(block.rightBracket);
441 } 441 }
442 void test_parseBreakStatement_label() { 442 void test_parseBreakStatement_label() {
443 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre ak foo;", []); 443 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak foo;", []);
444 JUnitTestCase.assertNotNull(statement.keyword); 444 JUnitTestCase.assertNotNull(statement.keyword);
445 JUnitTestCase.assertNotNull(statement.label); 445 JUnitTestCase.assertNotNull(statement.label);
446 JUnitTestCase.assertNotNull(statement.semicolon); 446 JUnitTestCase.assertNotNull(statement.semicolon);
447 } 447 }
448 void test_parseBreakStatement_noLabel() { 448 void test_parseBreakStatement_noLabel() {
449 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); 449 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
450 JUnitTestCase.assertNotNull(statement.keyword); 450 JUnitTestCase.assertNotNull(statement.keyword);
451 JUnitTestCase.assertNull(statement.label); 451 JUnitTestCase.assertNull(statement.label);
452 JUnitTestCase.assertNotNull(statement.semicolon); 452 JUnitTestCase.assertNotNull(statement.semicolon);
453 } 453 }
454 void test_parseCascadeSection_i() { 454 void test_parseCascadeSection_i() {
455 IndexExpression section = ParserTestCase.parse6("parseCascadeSection", "..[i ]", []); 455 IndexExpression section = ParserTestCase.parse5("parseCascadeSection", "..[i ]", []);
456 JUnitTestCase.assertNull(section.array); 456 JUnitTestCase.assertNull(section.array);
457 JUnitTestCase.assertNotNull(section.leftBracket); 457 JUnitTestCase.assertNotNull(section.leftBracket);
458 JUnitTestCase.assertNotNull(section.index); 458 JUnitTestCase.assertNotNull(section.index);
459 JUnitTestCase.assertNotNull(section.rightBracket); 459 JUnitTestCase.assertNotNull(section.rightBracket);
460 } 460 }
461 void test_parseCascadeSection_ia() { 461 void test_parseCascadeSection_ia() {
462 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe ction", "..[i](b)", []); 462 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..[i](b)", []);
463 EngineTestCase.assertInstanceOf(IndexExpression, section.function); 463 EngineTestCase.assertInstanceOf(IndexExpression, section.function);
464 JUnitTestCase.assertNotNull(section.argumentList); 464 JUnitTestCase.assertNotNull(section.argumentList);
465 } 465 }
466 void test_parseCascadeSection_p() { 466 void test_parseCascadeSection_p() {
467 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a", []); 467 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a", []);
468 JUnitTestCase.assertNull(section.target); 468 JUnitTestCase.assertNull(section.target);
469 JUnitTestCase.assertNotNull(section.operator); 469 JUnitTestCase.assertNotNull(section.operator);
470 JUnitTestCase.assertNotNull(section.propertyName); 470 JUnitTestCase.assertNotNull(section.propertyName);
471 } 471 }
472 void test_parseCascadeSection_p_assign() { 472 void test_parseCascadeSection_p_assign() {
473 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection", "..a = 3", []); 473 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3", []);
474 JUnitTestCase.assertNotNull(section.leftHandSide); 474 JUnitTestCase.assertNotNull(section.leftHandSide);
475 JUnitTestCase.assertNotNull(section.operator); 475 JUnitTestCase.assertNotNull(section.operator);
476 Expression rhs = section.rightHandSide; 476 Expression rhs = section.rightHandSide;
477 JUnitTestCase.assertNotNull(rhs); 477 JUnitTestCase.assertNotNull(rhs);
478 } 478 }
479 void test_parseCascadeSection_p_assign_withCascade() { 479 void test_parseCascadeSection_p_assign_withCascade() {
480 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection", "..a = 3..m()", []); 480 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3..m()", []);
481 JUnitTestCase.assertNotNull(section.leftHandSide); 481 JUnitTestCase.assertNotNull(section.leftHandSide);
482 JUnitTestCase.assertNotNull(section.operator); 482 JUnitTestCase.assertNotNull(section.operator);
483 Expression rhs = section.rightHandSide; 483 Expression rhs = section.rightHandSide;
484 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs); 484 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs);
485 } 485 }
486 void test_parseCascadeSection_p_builtIn() { 486 void test_parseCascadeSection_p_builtIn() {
487 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..as" , []); 487 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..as" , []);
488 JUnitTestCase.assertNull(section.target); 488 JUnitTestCase.assertNull(section.target);
489 JUnitTestCase.assertNotNull(section.operator); 489 JUnitTestCase.assertNotNull(section.operator);
490 JUnitTestCase.assertNotNull(section.propertyName); 490 JUnitTestCase.assertNotNull(section.propertyName);
491 } 491 }
492 void test_parseCascadeSection_pa() { 492 void test_parseCascadeSection_pa() {
493 MethodInvocation section = ParserTestCase.parse6("parseCascadeSection", "..a (b)", []); 493 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a (b)", []);
494 JUnitTestCase.assertNull(section.target); 494 JUnitTestCase.assertNull(section.target);
495 JUnitTestCase.assertNotNull(section.period); 495 JUnitTestCase.assertNotNull(section.period);
496 JUnitTestCase.assertNotNull(section.methodName); 496 JUnitTestCase.assertNotNull(section.methodName);
497 JUnitTestCase.assertNotNull(section.argumentList); 497 JUnitTestCase.assertNotNull(section.argumentList);
498 EngineTestCase.assertSize(1, section.argumentList.arguments); 498 EngineTestCase.assertSize(1, section.argumentList.arguments);
499 } 499 }
500 void test_parseCascadeSection_paa() { 500 void test_parseCascadeSection_paa() {
501 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe ction", "..a(b)(c)", []); 501 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c)", []);
502 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); 502 EngineTestCase.assertInstanceOf(MethodInvocation, section.function);
503 JUnitTestCase.assertNotNull(section.argumentList); 503 JUnitTestCase.assertNotNull(section.argumentList);
504 EngineTestCase.assertSize(1, section.argumentList.arguments); 504 EngineTestCase.assertSize(1, section.argumentList.arguments);
505 } 505 }
506 void test_parseCascadeSection_paapaa() { 506 void test_parseCascadeSection_paapaa() {
507 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe ction", "..a(b)(c).d(e)(f)", []); 507 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c).d(e)(f)", []);
508 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi on); 508 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi on);
509 JUnitTestCase.assertNotNull(section.argumentList); 509 JUnitTestCase.assertNotNull(section.argumentList);
510 EngineTestCase.assertSize(1, section.argumentList.arguments); 510 EngineTestCase.assertSize(1, section.argumentList.arguments);
511 } 511 }
512 void test_parseCascadeSection_pap() { 512 void test_parseCascadeSection_pap() {
513 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a(b ).c", []); 513 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a(b ).c", []);
514 JUnitTestCase.assertNotNull(section.target); 514 JUnitTestCase.assertNotNull(section.target);
515 JUnitTestCase.assertNotNull(section.operator); 515 JUnitTestCase.assertNotNull(section.operator);
516 JUnitTestCase.assertNotNull(section.propertyName); 516 JUnitTestCase.assertNotNull(section.propertyName);
517 } 517 }
518 void test_parseClassDeclaration_abstract() { 518 void test_parseClassDeclaration_abstract() {
519 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl ass A {}"); 519 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl ass A {}");
520 JUnitTestCase.assertNull(declaration.documentationComment); 520 JUnitTestCase.assertNull(declaration.documentationComment);
521 JUnitTestCase.assertNotNull(declaration.abstractKeyword); 521 JUnitTestCase.assertNotNull(declaration.abstractKeyword);
522 JUnitTestCase.assertNull(declaration.extendsClause); 522 JUnitTestCase.assertNull(declaration.extendsClause);
523 JUnitTestCase.assertNull(declaration.implementsClause); 523 JUnitTestCase.assertNull(declaration.implementsClause);
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 JUnitTestCase.assertNotNull(constructor.returnType); 897 JUnitTestCase.assertNotNull(constructor.returnType);
898 JUnitTestCase.assertNull(constructor.period); 898 JUnitTestCase.assertNull(constructor.period);
899 JUnitTestCase.assertNull(constructor.name); 899 JUnitTestCase.assertNull(constructor.name);
900 JUnitTestCase.assertNotNull(constructor.parameters); 900 JUnitTestCase.assertNotNull(constructor.parameters);
901 JUnitTestCase.assertNotNull(constructor.separator); 901 JUnitTestCase.assertNotNull(constructor.separator);
902 EngineTestCase.assertSize(0, constructor.initializers); 902 EngineTestCase.assertSize(0, constructor.initializers);
903 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); 903 JUnitTestCase.assertNotNull(constructor.redirectedConstructor);
904 JUnitTestCase.assertNotNull(constructor.body); 904 JUnitTestCase.assertNotNull(constructor.body);
905 } 905 }
906 void test_parseCombinators_h() { 906 void test_parseCombinators_h() {
907 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi de a;", []); 907 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a;", []);
908 EngineTestCase.assertSize(1, combinators); 908 EngineTestCase.assertSize(1, combinators);
909 HideCombinator combinator = combinators[0] as HideCombinator; 909 HideCombinator combinator = combinators[0] as HideCombinator;
910 JUnitTestCase.assertNotNull(combinator); 910 JUnitTestCase.assertNotNull(combinator);
911 JUnitTestCase.assertNotNull(combinator.keyword); 911 JUnitTestCase.assertNotNull(combinator.keyword);
912 EngineTestCase.assertSize(1, combinator.hiddenNames); 912 EngineTestCase.assertSize(1, combinator.hiddenNames);
913 } 913 }
914 void test_parseCombinators_hs() { 914 void test_parseCombinators_hs() {
915 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi de a show b;", []); 915 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b;", []);
916 EngineTestCase.assertSize(2, combinators); 916 EngineTestCase.assertSize(2, combinators);
917 HideCombinator hideCombinator = combinators[0] as HideCombinator; 917 HideCombinator hideCombinator = combinators[0] as HideCombinator;
918 JUnitTestCase.assertNotNull(hideCombinator); 918 JUnitTestCase.assertNotNull(hideCombinator);
919 JUnitTestCase.assertNotNull(hideCombinator.keyword); 919 JUnitTestCase.assertNotNull(hideCombinator.keyword);
920 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); 920 EngineTestCase.assertSize(1, hideCombinator.hiddenNames);
921 ShowCombinator showCombinator = combinators[1] as ShowCombinator; 921 ShowCombinator showCombinator = combinators[1] as ShowCombinator;
922 JUnitTestCase.assertNotNull(showCombinator); 922 JUnitTestCase.assertNotNull(showCombinator);
923 JUnitTestCase.assertNotNull(showCombinator.keyword); 923 JUnitTestCase.assertNotNull(showCombinator.keyword);
924 EngineTestCase.assertSize(1, showCombinator.shownNames); 924 EngineTestCase.assertSize(1, showCombinator.shownNames);
925 } 925 }
926 void test_parseCombinators_hshs() { 926 void test_parseCombinators_hshs() {
927 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi de a show b hide c show d;", []); 927 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b hide c show d;", []);
928 EngineTestCase.assertSize(4, combinators); 928 EngineTestCase.assertSize(4, combinators);
929 } 929 }
930 void test_parseCombinators_s() { 930 void test_parseCombinators_s() {
931 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "sh ow a;", []); 931 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "sh ow a;", []);
932 EngineTestCase.assertSize(1, combinators); 932 EngineTestCase.assertSize(1, combinators);
933 ShowCombinator combinator = combinators[0] as ShowCombinator; 933 ShowCombinator combinator = combinators[0] as ShowCombinator;
934 JUnitTestCase.assertNotNull(combinator); 934 JUnitTestCase.assertNotNull(combinator);
935 JUnitTestCase.assertNotNull(combinator.keyword); 935 JUnitTestCase.assertNotNull(combinator.keyword);
936 EngineTestCase.assertSize(1, combinator.shownNames); 936 EngineTestCase.assertSize(1, combinator.shownNames);
937 } 937 }
938 void test_parseCommentAndMetadata_c() { 938 void test_parseCommentAndMetadata_c() {
939 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "/** 1 */ void", []); 939 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ void", []);
940 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 940 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
941 EngineTestCase.assertSize(0, commentAndMetadata.metadata); 941 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
942 } 942 }
943 void test_parseCommentAndMetadata_cmc() { 943 void test_parseCommentAndMetadata_cmc() {
944 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ void", []); 944 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ void", []);
945 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 945 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
946 EngineTestCase.assertSize(1, commentAndMetadata.metadata); 946 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
947 } 947 }
948 void test_parseCommentAndMetadata_cmcm() { 948 void test_parseCommentAndMetadata_cmcm() {
949 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); 949 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ @B void", []);
950 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 950 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
951 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 951 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
952 } 952 }
953 void test_parseCommentAndMetadata_cmm() { 953 void test_parseCommentAndMetadata_cmm() {
954 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "/** 1 */ @A @B void", []); 954 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A @B void", []);
955 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 955 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
956 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 956 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
957 } 957 }
958 void test_parseCommentAndMetadata_m() { 958 void test_parseCommentAndMetadata_m() {
959 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "@A void", []); 959 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A void", []);
960 JUnitTestCase.assertNull(commentAndMetadata.comment); 960 JUnitTestCase.assertNull(commentAndMetadata.comment);
961 EngineTestCase.assertSize(1, commentAndMetadata.metadata); 961 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
962 } 962 }
963 void test_parseCommentAndMetadata_mcm() { 963 void test_parseCommentAndMetadata_mcm() {
964 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "@A /** 1 */ @B void", []); 964 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B void", []);
965 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 965 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
966 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 966 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
967 } 967 }
968 void test_parseCommentAndMetadata_mcmc() { 968 void test_parseCommentAndMetadata_mcmc() {
969 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); 969 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B /** 2 */ void", []);
970 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 970 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
971 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 971 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
972 } 972 }
973 void test_parseCommentAndMetadata_mm() { 973 void test_parseCommentAndMetadata_mm() {
974 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "@A @B(x) void", []); 974 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A @B(x) void", []);
975 JUnitTestCase.assertNull(commentAndMetadata.comment); 975 JUnitTestCase.assertNull(commentAndMetadata.comment);
976 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 976 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
977 } 977 }
978 void test_parseCommentAndMetadata_none() { 978 void test_parseCommentAndMetadata_none() {
979 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA ndMetadata", "void", []); 979 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "void", []);
980 JUnitTestCase.assertNull(commentAndMetadata.comment); 980 JUnitTestCase.assertNull(commentAndMetadata.comment);
981 EngineTestCase.assertSize(0, commentAndMetadata.metadata); 981 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
982 } 982 }
983 void test_parseCommentReference_new_prefixed() { 983 void test_parseCommentReference_new_prefixed() {
984 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a.b", 7], ""); 984 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a.b", 7], "");
985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier); 985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier);
986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; 986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix;
987 JUnitTestCase.assertNotNull(prefix11.token); 987 JUnitTestCase.assertNotNull(prefix11.token);
988 JUnitTestCase.assertEquals("a", prefix11.name); 988 JUnitTestCase.assertEquals("a", prefix11.name);
989 JUnitTestCase.assertEquals(11, prefix11.offset); 989 JUnitTestCase.assertEquals(11, prefix11.offset);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 reference = references[1]; 1044 reference = references[1];
1045 JUnitTestCase.assertNotNull(reference); 1045 JUnitTestCase.assertNotNull(reference);
1046 JUnitTestCase.assertNotNull(reference.identifier); 1046 JUnitTestCase.assertNotNull(reference.identifier);
1047 JUnitTestCase.assertEquals(20, reference.offset); 1047 JUnitTestCase.assertEquals(20, reference.offset);
1048 reference = references[2]; 1048 reference = references[2];
1049 JUnitTestCase.assertNotNull(reference); 1049 JUnitTestCase.assertNotNull(reference);
1050 JUnitTestCase.assertNotNull(reference.identifier); 1050 JUnitTestCase.assertNotNull(reference.identifier);
1051 JUnitTestCase.assertEquals(35, reference.offset); 1051 JUnitTestCase.assertEquals(35, reference.offset);
1052 } 1052 }
1053 void test_parseCompilationUnit_abstractAsPrefix_parameterized() { 1053 void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
1054 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "abstra ct<dynamic> _abstract = new abstract.A();", []); 1054 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "abstra ct<dynamic> _abstract = new abstract.A();", []);
1055 JUnitTestCase.assertNull(unit.scriptTag); 1055 JUnitTestCase.assertNull(unit.scriptTag);
1056 EngineTestCase.assertSize(0, unit.directives); 1056 EngineTestCase.assertSize(0, unit.directives);
1057 EngineTestCase.assertSize(1, unit.declarations); 1057 EngineTestCase.assertSize(1, unit.declarations);
1058 } 1058 }
1059 void test_parseCompilationUnit_directives_multiple() { 1059 void test_parseCompilationUnit_directives_multiple() {
1060 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar y l;\npart 'a.dart';", []); 1060 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;\npart 'a.dart';", []);
1061 JUnitTestCase.assertNull(unit.scriptTag); 1061 JUnitTestCase.assertNull(unit.scriptTag);
1062 EngineTestCase.assertSize(2, unit.directives); 1062 EngineTestCase.assertSize(2, unit.directives);
1063 EngineTestCase.assertSize(0, unit.declarations); 1063 EngineTestCase.assertSize(0, unit.declarations);
1064 } 1064 }
1065 void test_parseCompilationUnit_directives_single() { 1065 void test_parseCompilationUnit_directives_single() {
1066 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar y l;", []); 1066 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;", []);
1067 JUnitTestCase.assertNull(unit.scriptTag); 1067 JUnitTestCase.assertNull(unit.scriptTag);
1068 EngineTestCase.assertSize(1, unit.directives); 1068 EngineTestCase.assertSize(1, unit.directives);
1069 EngineTestCase.assertSize(0, unit.declarations); 1069 EngineTestCase.assertSize(0, unit.declarations);
1070 } 1070 }
1071 void test_parseCompilationUnit_empty() { 1071 void test_parseCompilationUnit_empty() {
1072 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "", []) ; 1072 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "", []) ;
1073 JUnitTestCase.assertNull(unit.scriptTag); 1073 JUnitTestCase.assertNull(unit.scriptTag);
1074 EngineTestCase.assertSize(0, unit.directives); 1074 EngineTestCase.assertSize(0, unit.directives);
1075 EngineTestCase.assertSize(0, unit.declarations); 1075 EngineTestCase.assertSize(0, unit.declarations);
1076 } 1076 }
1077 void test_parseCompilationUnit_exportAsPrefix() { 1077 void test_parseCompilationUnit_exportAsPrefix() {
1078 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export .A _export = new export.A();", []); 1078 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export .A _export = new export.A();", []);
1079 JUnitTestCase.assertNull(unit.scriptTag); 1079 JUnitTestCase.assertNull(unit.scriptTag);
1080 EngineTestCase.assertSize(0, unit.directives); 1080 EngineTestCase.assertSize(0, unit.directives);
1081 EngineTestCase.assertSize(1, unit.declarations); 1081 EngineTestCase.assertSize(1, unit.declarations);
1082 } 1082 }
1083 void test_parseCompilationUnit_exportAsPrefix_parameterized() { 1083 void test_parseCompilationUnit_exportAsPrefix_parameterized() {
1084 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export <dynamic> _export = new export.A();", []); 1084 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export <dynamic> _export = new export.A();", []);
1085 JUnitTestCase.assertNull(unit.scriptTag); 1085 JUnitTestCase.assertNull(unit.scriptTag);
1086 EngineTestCase.assertSize(0, unit.directives); 1086 EngineTestCase.assertSize(0, unit.directives);
1087 EngineTestCase.assertSize(1, unit.declarations); 1087 EngineTestCase.assertSize(1, unit.declarations);
1088 } 1088 }
1089 void test_parseCompilationUnit_operatorAsPrefix_parameterized() { 1089 void test_parseCompilationUnit_operatorAsPrefix_parameterized() {
1090 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "operat or<dynamic> _operator = new operator.A();", []); 1090 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "operat or<dynamic> _operator = new operator.A();", []);
1091 JUnitTestCase.assertNull(unit.scriptTag); 1091 JUnitTestCase.assertNull(unit.scriptTag);
1092 EngineTestCase.assertSize(0, unit.directives); 1092 EngineTestCase.assertSize(0, unit.directives);
1093 EngineTestCase.assertSize(1, unit.declarations); 1093 EngineTestCase.assertSize(1, unit.declarations);
1094 } 1094 }
1095 void test_parseCompilationUnit_script() { 1095 void test_parseCompilationUnit_script() {
1096 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "#! /bi n/dart", []); 1096 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "#! /bi n/dart", []);
1097 JUnitTestCase.assertNotNull(unit.scriptTag); 1097 JUnitTestCase.assertNotNull(unit.scriptTag);
1098 EngineTestCase.assertSize(0, unit.directives); 1098 EngineTestCase.assertSize(0, unit.directives);
1099 EngineTestCase.assertSize(0, unit.declarations); 1099 EngineTestCase.assertSize(0, unit.declarations);
1100 } 1100 }
1101 void test_parseCompilationUnit_topLevelDeclaration() { 1101 void test_parseCompilationUnit_topLevelDeclaration() {
1102 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class A {}", []); 1102 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class A {}", []);
1103 JUnitTestCase.assertNull(unit.scriptTag); 1103 JUnitTestCase.assertNull(unit.scriptTag);
1104 EngineTestCase.assertSize(0, unit.directives); 1104 EngineTestCase.assertSize(0, unit.directives);
1105 EngineTestCase.assertSize(1, unit.declarations); 1105 EngineTestCase.assertSize(1, unit.declarations);
1106 } 1106 }
1107 void test_parseCompilationUnit_typedefAsPrefix() { 1107 void test_parseCompilationUnit_typedefAsPrefix() {
1108 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "typede f.A _typedef = new typedef.A();", []); 1108 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "typede f.A _typedef = new typedef.A();", []);
1109 JUnitTestCase.assertNull(unit.scriptTag); 1109 JUnitTestCase.assertNull(unit.scriptTag);
1110 EngineTestCase.assertSize(0, unit.directives); 1110 EngineTestCase.assertSize(0, unit.directives);
1111 EngineTestCase.assertSize(1, unit.declarations); 1111 EngineTestCase.assertSize(1, unit.declarations);
1112 } 1112 }
1113 void test_parseCompilationUnitMember_abstractAsPrefix() { 1113 void test_parseCompilationUnitMember_abstractAsPrefix() {
1114 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n ew abstract.A();"); 1114 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n ew abstract.A();");
1115 JUnitTestCase.assertNotNull(declaration.semicolon); 1115 JUnitTestCase.assertNotNull(declaration.semicolon);
1116 JUnitTestCase.assertNotNull(declaration.variables); 1116 JUnitTestCase.assertNotNull(declaration.variables);
1117 } 1117 }
1118 void test_parseCompilationUnitMember_class() { 1118 void test_parseCompilationUnitMember_class() {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb er", <Object> [emptyCommentAndMetadata()], "typedef F();"); 1248 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb er", <Object> [emptyCommentAndMetadata()], "typedef F();");
1249 JUnitTestCase.assertEquals("F", typeAlias.name.name); 1249 JUnitTestCase.assertEquals("F", typeAlias.name.name);
1250 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); 1250 EngineTestCase.assertSize(0, typeAlias.parameters.parameters);
1251 } 1251 }
1252 void test_parseCompilationUnitMember_variable() { 1252 void test_parseCompilationUnitMember_variable() {
1253 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); 1253 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;");
1254 JUnitTestCase.assertNotNull(declaration.semicolon); 1254 JUnitTestCase.assertNotNull(declaration.semicolon);
1255 JUnitTestCase.assertNotNull(declaration.variables); 1255 JUnitTestCase.assertNotNull(declaration.variables);
1256 } 1256 }
1257 void test_parseConditionalExpression() { 1257 void test_parseConditionalExpression() {
1258 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx pression", "x ? y : z", []); 1258 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y : z", []);
1259 JUnitTestCase.assertNotNull(expression.condition); 1259 JUnitTestCase.assertNotNull(expression.condition);
1260 JUnitTestCase.assertNotNull(expression.question); 1260 JUnitTestCase.assertNotNull(expression.question);
1261 JUnitTestCase.assertNotNull(expression.thenExpression); 1261 JUnitTestCase.assertNotNull(expression.thenExpression);
1262 JUnitTestCase.assertNotNull(expression.colon); 1262 JUnitTestCase.assertNotNull(expression.colon);
1263 JUnitTestCase.assertNotNull(expression.elseExpression); 1263 JUnitTestCase.assertNotNull(expression.elseExpression);
1264 } 1264 }
1265 void test_parseConstExpression_instanceCreation() { 1265 void test_parseConstExpression_instanceCreation() {
1266 InstanceCreationExpression expression = ParserTestCase.parse6("parseConstExp ression", "const A()", []); 1266 InstanceCreationExpression expression = ParserTestCase.parse5("parseConstExp ression", "const A()", []);
1267 JUnitTestCase.assertNotNull(expression.keyword); 1267 JUnitTestCase.assertNotNull(expression.keyword);
1268 ConstructorName name = expression.constructorName; 1268 ConstructorName name = expression.constructorName;
1269 JUnitTestCase.assertNotNull(name); 1269 JUnitTestCase.assertNotNull(name);
1270 JUnitTestCase.assertNotNull(name.type); 1270 JUnitTestCase.assertNotNull(name.type);
1271 JUnitTestCase.assertNull(name.period); 1271 JUnitTestCase.assertNull(name.period);
1272 JUnitTestCase.assertNull(name.name); 1272 JUnitTestCase.assertNull(name.name);
1273 JUnitTestCase.assertNotNull(expression.argumentList); 1273 JUnitTestCase.assertNotNull(expression.argumentList);
1274 } 1274 }
1275 void test_parseConstExpression_listLiteral_typed() { 1275 void test_parseConstExpression_listLiteral_typed() {
1276 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const < A> []", []); 1276 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const < A> []", []);
1277 JUnitTestCase.assertNotNull(literal.modifier); 1277 JUnitTestCase.assertNotNull(literal.modifier);
1278 JUnitTestCase.assertNotNull(literal.typeArguments); 1278 JUnitTestCase.assertNotNull(literal.typeArguments);
1279 JUnitTestCase.assertNotNull(literal.leftBracket); 1279 JUnitTestCase.assertNotNull(literal.leftBracket);
1280 EngineTestCase.assertSize(0, literal.elements); 1280 EngineTestCase.assertSize(0, literal.elements);
1281 JUnitTestCase.assertNotNull(literal.rightBracket); 1281 JUnitTestCase.assertNotNull(literal.rightBracket);
1282 } 1282 }
1283 void test_parseConstExpression_listLiteral_untyped() { 1283 void test_parseConstExpression_listLiteral_untyped() {
1284 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const [ ]", []); 1284 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const [ ]", []);
1285 JUnitTestCase.assertNotNull(literal.modifier); 1285 JUnitTestCase.assertNotNull(literal.modifier);
1286 JUnitTestCase.assertNull(literal.typeArguments); 1286 JUnitTestCase.assertNull(literal.typeArguments);
1287 JUnitTestCase.assertNotNull(literal.leftBracket); 1287 JUnitTestCase.assertNotNull(literal.leftBracket);
1288 EngineTestCase.assertSize(0, literal.elements); 1288 EngineTestCase.assertSize(0, literal.elements);
1289 JUnitTestCase.assertNotNull(literal.rightBracket); 1289 JUnitTestCase.assertNotNull(literal.rightBracket);
1290 } 1290 }
1291 void test_parseConstExpression_mapLiteral_typed() { 1291 void test_parseConstExpression_mapLiteral_typed() {
1292 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const <A > {}", []); 1292 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <A > {}", []);
1293 JUnitTestCase.assertNotNull(literal.leftBracket); 1293 JUnitTestCase.assertNotNull(literal.leftBracket);
1294 EngineTestCase.assertSize(0, literal.entries); 1294 EngineTestCase.assertSize(0, literal.entries);
1295 JUnitTestCase.assertNotNull(literal.rightBracket); 1295 JUnitTestCase.assertNotNull(literal.rightBracket);
1296 JUnitTestCase.assertNotNull(literal.typeArguments); 1296 JUnitTestCase.assertNotNull(literal.typeArguments);
1297 } 1297 }
1298 void test_parseConstExpression_mapLiteral_untyped() { 1298 void test_parseConstExpression_mapLiteral_untyped() {
1299 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const {} ", []); 1299 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const {} ", []);
1300 JUnitTestCase.assertNotNull(literal.leftBracket); 1300 JUnitTestCase.assertNotNull(literal.leftBracket);
1301 EngineTestCase.assertSize(0, literal.entries); 1301 EngineTestCase.assertSize(0, literal.entries);
1302 JUnitTestCase.assertNotNull(literal.rightBracket); 1302 JUnitTestCase.assertNotNull(literal.rightBracket);
1303 JUnitTestCase.assertNull(literal.typeArguments); 1303 JUnitTestCase.assertNull(literal.typeArguments);
1304 } 1304 }
1305 void test_parseConstructor() { 1305 void test_parseConstructor() {
1306 } 1306 }
1307 void test_parseConstructorFieldInitializer_qualified() { 1307 void test_parseConstructorFieldInitializer_qualified() {
1308 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru ctorFieldInitializer", "this.a = b", []); 1308 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "this.a = b", []);
1309 JUnitTestCase.assertNotNull(invocation.equals); 1309 JUnitTestCase.assertNotNull(invocation.equals);
1310 JUnitTestCase.assertNotNull(invocation.expression); 1310 JUnitTestCase.assertNotNull(invocation.expression);
1311 JUnitTestCase.assertNotNull(invocation.fieldName); 1311 JUnitTestCase.assertNotNull(invocation.fieldName);
1312 JUnitTestCase.assertNotNull(invocation.keyword); 1312 JUnitTestCase.assertNotNull(invocation.keyword);
1313 JUnitTestCase.assertNotNull(invocation.period); 1313 JUnitTestCase.assertNotNull(invocation.period);
1314 } 1314 }
1315 void test_parseConstructorFieldInitializer_unqualified() { 1315 void test_parseConstructorFieldInitializer_unqualified() {
1316 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru ctorFieldInitializer", "a = b", []); 1316 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "a = b", []);
1317 JUnitTestCase.assertNotNull(invocation.equals); 1317 JUnitTestCase.assertNotNull(invocation.equals);
1318 JUnitTestCase.assertNotNull(invocation.expression); 1318 JUnitTestCase.assertNotNull(invocation.expression);
1319 JUnitTestCase.assertNotNull(invocation.fieldName); 1319 JUnitTestCase.assertNotNull(invocation.fieldName);
1320 JUnitTestCase.assertNull(invocation.keyword); 1320 JUnitTestCase.assertNull(invocation.keyword);
1321 JUnitTestCase.assertNull(invocation.period); 1321 JUnitTestCase.assertNull(invocation.period);
1322 } 1322 }
1323 void test_parseConstructorName_named_noPrefix() { 1323 void test_parseConstructorName_named_noPrefix() {
1324 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A.n;", []); 1324 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A.n;", []);
1325 JUnitTestCase.assertNotNull(name.type); 1325 JUnitTestCase.assertNotNull(name.type);
1326 JUnitTestCase.assertNull(name.period); 1326 JUnitTestCase.assertNull(name.period);
1327 JUnitTestCase.assertNull(name.name); 1327 JUnitTestCase.assertNull(name.name);
1328 } 1328 }
1329 void test_parseConstructorName_named_prefixed() { 1329 void test_parseConstructorName_named_prefixed() {
1330 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A.n; ", []); 1330 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A.n; ", []);
1331 JUnitTestCase.assertNotNull(name.type); 1331 JUnitTestCase.assertNotNull(name.type);
1332 JUnitTestCase.assertNotNull(name.period); 1332 JUnitTestCase.assertNotNull(name.period);
1333 JUnitTestCase.assertNotNull(name.name); 1333 JUnitTestCase.assertNotNull(name.name);
1334 } 1334 }
1335 void test_parseConstructorName_unnamed_noPrefix() { 1335 void test_parseConstructorName_unnamed_noPrefix() {
1336 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A;", [ ]); 1336 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A;", [ ]);
1337 JUnitTestCase.assertNotNull(name.type); 1337 JUnitTestCase.assertNotNull(name.type);
1338 JUnitTestCase.assertNull(name.period); 1338 JUnitTestCase.assertNull(name.period);
1339 JUnitTestCase.assertNull(name.name); 1339 JUnitTestCase.assertNull(name.name);
1340 } 1340 }
1341 void test_parseConstructorName_unnamed_prefixed() { 1341 void test_parseConstructorName_unnamed_prefixed() {
1342 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A;", []); 1342 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A;", []);
1343 JUnitTestCase.assertNotNull(name.type); 1343 JUnitTestCase.assertNotNull(name.type);
1344 JUnitTestCase.assertNull(name.period); 1344 JUnitTestCase.assertNull(name.period);
1345 JUnitTestCase.assertNull(name.name); 1345 JUnitTestCase.assertNull(name.name);
1346 } 1346 }
1347 void test_parseContinueStatement_label() { 1347 void test_parseContinueStatement_label() {
1348 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement" , "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); 1348 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1349 JUnitTestCase.assertNotNull(statement.keyword); 1349 JUnitTestCase.assertNotNull(statement.keyword);
1350 JUnitTestCase.assertNotNull(statement.label); 1350 JUnitTestCase.assertNotNull(statement.label);
1351 JUnitTestCase.assertNotNull(statement.semicolon); 1351 JUnitTestCase.assertNotNull(statement.semicolon);
1352 } 1352 }
1353 void test_parseContinueStatement_noLabel() { 1353 void test_parseContinueStatement_noLabel() {
1354 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement" , "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); 1354 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1355 JUnitTestCase.assertNotNull(statement.keyword); 1355 JUnitTestCase.assertNotNull(statement.keyword);
1356 JUnitTestCase.assertNull(statement.label); 1356 JUnitTestCase.assertNull(statement.label);
1357 JUnitTestCase.assertNotNull(statement.semicolon); 1357 JUnitTestCase.assertNotNull(statement.semicolon);
1358 } 1358 }
1359 void test_parseDeclaredIdentifier_const() {
1360 DeclaredIdentifier declaredIdentifier = ParserTestCase.parse("parseDeclaredI dentifier", <Object> [emptyCommentAndMetadata()], "const A a");
1361 JUnitTestCase.assertNotNull(declaredIdentifier.keyword);
1362 JUnitTestCase.assertTrue(declaredIdentifier.isConst());
1363 JUnitTestCase.assertNotNull(declaredIdentifier.type);
1364 }
1365 void test_parseDeclaredIdentifier_final() {
1366 DeclaredIdentifier declaredIdentifier = ParserTestCase.parse("parseDeclaredI dentifier", <Object> [emptyCommentAndMetadata()], "final A a");
1367 JUnitTestCase.assertNotNull(declaredIdentifier.keyword);
1368 JUnitTestCase.assertTrue(declaredIdentifier.isFinal());
1369 JUnitTestCase.assertNotNull(declaredIdentifier.type);
1370 }
1371 void test_parseDeclaredIdentifier_type() {
1372 DeclaredIdentifier declaredIdentifier = ParserTestCase.parse("parseDeclaredI dentifier", <Object> [emptyCommentAndMetadata()], "A a");
1373 JUnitTestCase.assertNull(declaredIdentifier.keyword);
1374 JUnitTestCase.assertNotNull(declaredIdentifier.type);
1375 }
1376 void test_parseDeclaredIdentifier_var() {
1377 DeclaredIdentifier declaredIdentifier = ParserTestCase.parse("parseDeclaredI dentifier", <Object> [emptyCommentAndMetadata()], "var a");
1378 JUnitTestCase.assertNotNull(declaredIdentifier.keyword);
1379 JUnitTestCase.assertNull(declaredIdentifier.type);
1380 }
1381 void test_parseDirective_export() { 1359 void test_parseDirective_export() {
1382 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';"); 1360 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
1383 JUnitTestCase.assertNotNull(directive.keyword); 1361 JUnitTestCase.assertNotNull(directive.keyword);
1384 JUnitTestCase.assertNotNull(directive.uri); 1362 JUnitTestCase.assertNotNull(directive.uri);
1385 EngineTestCase.assertSize(0, directive.combinators); 1363 EngineTestCase.assertSize(0, directive.combinators);
1386 JUnitTestCase.assertNotNull(directive.semicolon); 1364 JUnitTestCase.assertNotNull(directive.semicolon);
1387 } 1365 }
1388 void test_parseDirective_import() { 1366 void test_parseDirective_import() {
1389 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart';"); 1367 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "import 'lib/lib.dart';");
1390 JUnitTestCase.assertNotNull(directive.keyword); 1368 JUnitTestCase.assertNotNull(directive.keyword);
(...skipping 16 matching lines...) Expand all
1407 JUnitTestCase.assertNotNull(directive.semicolon); 1385 JUnitTestCase.assertNotNull(directive.semicolon);
1408 } 1386 }
1409 void test_parseDirective_partOf() { 1387 void test_parseDirective_partOf() {
1410 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;"); 1388 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;");
1411 JUnitTestCase.assertNotNull(directive.partToken); 1389 JUnitTestCase.assertNotNull(directive.partToken);
1412 JUnitTestCase.assertNotNull(directive.ofToken); 1390 JUnitTestCase.assertNotNull(directive.ofToken);
1413 JUnitTestCase.assertNotNull(directive.libraryName); 1391 JUnitTestCase.assertNotNull(directive.libraryName);
1414 JUnitTestCase.assertNotNull(directive.semicolon); 1392 JUnitTestCase.assertNotNull(directive.semicolon);
1415 } 1393 }
1416 void test_parseDocumentationComment_block() { 1394 void test_parseDocumentationComment_block() {
1417 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** */ class", []); 1395 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */ class", []);
1418 JUnitTestCase.assertFalse(comment.isBlock()); 1396 JUnitTestCase.assertFalse(comment.isBlock());
1419 JUnitTestCase.assertTrue(comment.isDocumentation()); 1397 JUnitTestCase.assertTrue(comment.isDocumentation());
1420 JUnitTestCase.assertFalse(comment.isEndOfLine()); 1398 JUnitTestCase.assertFalse(comment.isEndOfLine());
1421 } 1399 }
1422 void test_parseDocumentationComment_block_withReference() { 1400 void test_parseDocumentationComment_block_withReference() {
1423 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** [a ] */ class", []); 1401 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a ] */ class", []);
1424 JUnitTestCase.assertFalse(comment.isBlock()); 1402 JUnitTestCase.assertFalse(comment.isBlock());
1425 JUnitTestCase.assertTrue(comment.isDocumentation()); 1403 JUnitTestCase.assertTrue(comment.isDocumentation());
1426 JUnitTestCase.assertFalse(comment.isEndOfLine()); 1404 JUnitTestCase.assertFalse(comment.isEndOfLine());
1427 NodeList<CommentReference> references2 = comment.references; 1405 NodeList<CommentReference> references2 = comment.references;
1428 EngineTestCase.assertSize(1, references2); 1406 EngineTestCase.assertSize(1, references2);
1429 CommentReference reference = references2[0]; 1407 CommentReference reference = references2[0];
1430 JUnitTestCase.assertNotNull(reference); 1408 JUnitTestCase.assertNotNull(reference);
1431 JUnitTestCase.assertEquals(5, reference.offset); 1409 JUnitTestCase.assertEquals(5, reference.offset);
1432 } 1410 }
1433 void test_parseDocumentationComment_endOfLine() { 1411 void test_parseDocumentationComment_endOfLine() {
1434 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/// \n /// \n class", []); 1412 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n /// \n class", []);
1435 JUnitTestCase.assertFalse(comment.isBlock()); 1413 JUnitTestCase.assertFalse(comment.isBlock());
1436 JUnitTestCase.assertTrue(comment.isDocumentation()); 1414 JUnitTestCase.assertTrue(comment.isDocumentation());
1437 JUnitTestCase.assertFalse(comment.isEndOfLine()); 1415 JUnitTestCase.assertFalse(comment.isEndOfLine());
1438 } 1416 }
1439 void test_parseDoStatement() { 1417 void test_parseDoStatement() {
1440 DoStatement statement = ParserTestCase.parse6("parseDoStatement", "do {} whi le (x);", []); 1418 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi le (x);", []);
1441 JUnitTestCase.assertNotNull(statement.doKeyword); 1419 JUnitTestCase.assertNotNull(statement.doKeyword);
1442 JUnitTestCase.assertNotNull(statement.body); 1420 JUnitTestCase.assertNotNull(statement.body);
1443 JUnitTestCase.assertNotNull(statement.whileKeyword); 1421 JUnitTestCase.assertNotNull(statement.whileKeyword);
1444 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1422 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1445 JUnitTestCase.assertNotNull(statement.condition); 1423 JUnitTestCase.assertNotNull(statement.condition);
1446 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1424 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1447 JUnitTestCase.assertNotNull(statement.semicolon); 1425 JUnitTestCase.assertNotNull(statement.semicolon);
1448 } 1426 }
1449 void test_parseEmptyStatement() { 1427 void test_parseEmptyStatement() {
1450 EmptyStatement statement = ParserTestCase.parse6("parseEmptyStatement", ";", []); 1428 EmptyStatement statement = ParserTestCase.parse5("parseEmptyStatement", ";", []);
1451 JUnitTestCase.assertNotNull(statement.semicolon); 1429 JUnitTestCase.assertNotNull(statement.semicolon);
1452 } 1430 }
1453 void test_parseEqualityExpression_normal() { 1431 void test_parseEqualityExpression_normal() {
1454 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression ", "x == y", []); 1432 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "x == y", []);
1455 JUnitTestCase.assertNotNull(expression.leftOperand); 1433 JUnitTestCase.assertNotNull(expression.leftOperand);
1456 JUnitTestCase.assertNotNull(expression.operator); 1434 JUnitTestCase.assertNotNull(expression.operator);
1457 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1435 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1458 JUnitTestCase.assertNotNull(expression.rightOperand); 1436 JUnitTestCase.assertNotNull(expression.rightOperand);
1459 } 1437 }
1460 void test_parseEqualityExpression_super() { 1438 void test_parseEqualityExpression_super() {
1461 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression ", "super == y", []); 1439 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "super == y", []);
1462 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 1440 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
1463 JUnitTestCase.assertNotNull(expression.operator); 1441 JUnitTestCase.assertNotNull(expression.operator);
1464 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1442 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1465 JUnitTestCase.assertNotNull(expression.rightOperand); 1443 JUnitTestCase.assertNotNull(expression.rightOperand);
1466 } 1444 }
1467 void test_parseExportDirective_hide() { 1445 void test_parseExportDirective_hide() {
1468 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); 1446 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;");
1469 JUnitTestCase.assertNotNull(directive.keyword); 1447 JUnitTestCase.assertNotNull(directive.keyword);
1470 JUnitTestCase.assertNotNull(directive.uri); 1448 JUnitTestCase.assertNotNull(directive.uri);
1471 EngineTestCase.assertSize(1, directive.combinators); 1449 EngineTestCase.assertSize(1, directive.combinators);
(...skipping 21 matching lines...) Expand all
1493 JUnitTestCase.assertNotNull(directive.semicolon); 1471 JUnitTestCase.assertNotNull(directive.semicolon);
1494 } 1472 }
1495 void test_parseExportDirective_show_hide() { 1473 void test_parseExportDirective_show_hide() {
1496 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); 1474 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;");
1497 JUnitTestCase.assertNotNull(directive.keyword); 1475 JUnitTestCase.assertNotNull(directive.keyword);
1498 JUnitTestCase.assertNotNull(directive.uri); 1476 JUnitTestCase.assertNotNull(directive.uri);
1499 EngineTestCase.assertSize(2, directive.combinators); 1477 EngineTestCase.assertSize(2, directive.combinators);
1500 JUnitTestCase.assertNotNull(directive.semicolon); 1478 JUnitTestCase.assertNotNull(directive.semicolon);
1501 } 1479 }
1502 void test_parseExpression_assign() { 1480 void test_parseExpression_assign() {
1503 AssignmentExpression expression = ParserTestCase.parse6("parseExpression", " x = y", []); 1481 AssignmentExpression expression = ParserTestCase.parse5("parseExpression", " x = y", []);
1504 JUnitTestCase.assertNotNull(expression.leftHandSide); 1482 JUnitTestCase.assertNotNull(expression.leftHandSide);
1505 JUnitTestCase.assertNotNull(expression.operator); 1483 JUnitTestCase.assertNotNull(expression.operator);
1506 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); 1484 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
1507 JUnitTestCase.assertNotNull(expression.rightHandSide); 1485 JUnitTestCase.assertNotNull(expression.rightHandSide);
1508 } 1486 }
1509 void test_parseExpression_comparison() { 1487 void test_parseExpression_comparison() {
1510 BinaryExpression expression = ParserTestCase.parse6("parseExpression", "--a. b == c", []); 1488 BinaryExpression expression = ParserTestCase.parse5("parseExpression", "--a. b == c", []);
1511 JUnitTestCase.assertNotNull(expression.leftOperand); 1489 JUnitTestCase.assertNotNull(expression.leftOperand);
1512 JUnitTestCase.assertNotNull(expression.operator); 1490 JUnitTestCase.assertNotNull(expression.operator);
1513 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1491 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1514 JUnitTestCase.assertNotNull(expression.rightOperand); 1492 JUnitTestCase.assertNotNull(expression.rightOperand);
1515 } 1493 }
1516 void test_parseExpression_invokeFunctionExpression() { 1494 void test_parseExpression_invokeFunctionExpression() {
1517 FunctionExpressionInvocation invocation = ParserTestCase.parse6("parseExpres sion", "(a) {return a + a;} (3)", []); 1495 FunctionExpressionInvocation invocation = ParserTestCase.parse5("parseExpres sion", "(a) {return a + a;} (3)", []);
1518 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); 1496 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
1519 FunctionExpression expression = invocation.function as FunctionExpression; 1497 FunctionExpression expression = invocation.function as FunctionExpression;
1520 JUnitTestCase.assertNotNull(expression.parameters); 1498 JUnitTestCase.assertNotNull(expression.parameters);
1521 JUnitTestCase.assertNotNull(expression.body); 1499 JUnitTestCase.assertNotNull(expression.body);
1522 ArgumentList list = invocation.argumentList; 1500 ArgumentList list = invocation.argumentList;
1523 JUnitTestCase.assertNotNull(list); 1501 JUnitTestCase.assertNotNull(list);
1524 EngineTestCase.assertSize(1, list.arguments); 1502 EngineTestCase.assertSize(1, list.arguments);
1525 } 1503 }
1526 void test_parseExpression_superMethodInvocation() { 1504 void test_parseExpression_superMethodInvocation() {
1527 MethodInvocation invocation = ParserTestCase.parse6("parseExpression", "supe r.m()", []); 1505 MethodInvocation invocation = ParserTestCase.parse5("parseExpression", "supe r.m()", []);
1528 JUnitTestCase.assertNotNull(invocation.target); 1506 JUnitTestCase.assertNotNull(invocation.target);
1529 JUnitTestCase.assertNotNull(invocation.methodName); 1507 JUnitTestCase.assertNotNull(invocation.methodName);
1530 JUnitTestCase.assertNotNull(invocation.argumentList); 1508 JUnitTestCase.assertNotNull(invocation.argumentList);
1531 } 1509 }
1532 void test_parseExpressionList_multiple() { 1510 void test_parseExpressionList_multiple() {
1533 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2 , 3", []); 1511 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3", []);
1534 EngineTestCase.assertSize(3, result); 1512 EngineTestCase.assertSize(3, result);
1535 } 1513 }
1536 void test_parseExpressionList_single() { 1514 void test_parseExpressionList_single() {
1537 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1", []); 1515 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1", []);
1538 EngineTestCase.assertSize(1, result); 1516 EngineTestCase.assertSize(1, result);
1539 } 1517 }
1540 void test_parseExpressionWithoutCascade_assign() { 1518 void test_parseExpressionWithoutCascade_assign() {
1541 AssignmentExpression expression = ParserTestCase.parse6("parseExpressionWith outCascade", "x = y", []); 1519 AssignmentExpression expression = ParserTestCase.parse5("parseExpressionWith outCascade", "x = y", []);
1542 JUnitTestCase.assertNotNull(expression.leftHandSide); 1520 JUnitTestCase.assertNotNull(expression.leftHandSide);
1543 JUnitTestCase.assertNotNull(expression.operator); 1521 JUnitTestCase.assertNotNull(expression.operator);
1544 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); 1522 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
1545 JUnitTestCase.assertNotNull(expression.rightHandSide); 1523 JUnitTestCase.assertNotNull(expression.rightHandSide);
1546 } 1524 }
1547 void test_parseExpressionWithoutCascade_comparison() { 1525 void test_parseExpressionWithoutCascade_comparison() {
1548 BinaryExpression expression = ParserTestCase.parse6("parseExpressionWithoutC ascade", "--a.b == c", []); 1526 BinaryExpression expression = ParserTestCase.parse5("parseExpressionWithoutC ascade", "--a.b == c", []);
1549 JUnitTestCase.assertNotNull(expression.leftOperand); 1527 JUnitTestCase.assertNotNull(expression.leftOperand);
1550 JUnitTestCase.assertNotNull(expression.operator); 1528 JUnitTestCase.assertNotNull(expression.operator);
1551 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1529 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1552 JUnitTestCase.assertNotNull(expression.rightOperand); 1530 JUnitTestCase.assertNotNull(expression.rightOperand);
1553 } 1531 }
1554 void test_parseExpressionWithoutCascade_superMethodInvocation() { 1532 void test_parseExpressionWithoutCascade_superMethodInvocation() {
1555 MethodInvocation invocation = ParserTestCase.parse6("parseExpressionWithoutC ascade", "super.m()", []); 1533 MethodInvocation invocation = ParserTestCase.parse5("parseExpressionWithoutC ascade", "super.m()", []);
1556 JUnitTestCase.assertNotNull(invocation.target); 1534 JUnitTestCase.assertNotNull(invocation.target);
1557 JUnitTestCase.assertNotNull(invocation.methodName); 1535 JUnitTestCase.assertNotNull(invocation.methodName);
1558 JUnitTestCase.assertNotNull(invocation.argumentList); 1536 JUnitTestCase.assertNotNull(invocation.argumentList);
1559 } 1537 }
1560 void test_parseExtendsClause() { 1538 void test_parseExtendsClause() {
1561 ExtendsClause clause = ParserTestCase.parse6("parseExtendsClause", "extends B", []); 1539 ExtendsClause clause = ParserTestCase.parse5("parseExtendsClause", "extends B", []);
1562 JUnitTestCase.assertNotNull(clause.keyword); 1540 JUnitTestCase.assertNotNull(clause.keyword);
1563 JUnitTestCase.assertNotNull(clause.superclass); 1541 JUnitTestCase.assertNotNull(clause.superclass);
1564 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); 1542 EngineTestCase.assertInstanceOf(TypeName, clause.superclass);
1565 } 1543 }
1566 void test_parseFinalConstVarOrType_const_noType() { 1544 void test_parseFinalConstVarOrType_const_noType() {
1567 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const"); 1545 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const");
1568 Token keyword31 = result.keyword; 1546 Token keyword32 = result.keyword;
1569 JUnitTestCase.assertNotNull(keyword31); 1547 JUnitTestCase.assertNotNull(keyword32);
1570 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); 1548 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type);
1571 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword31 as KeywordToken)).keyw ord); 1549 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword32 as KeywordToken)).keyw ord);
1572 JUnitTestCase.assertNull(result.type); 1550 JUnitTestCase.assertNull(result.type);
1573 } 1551 }
1574 void test_parseFinalConstVarOrType_const_type() { 1552 void test_parseFinalConstVarOrType_const_type() {
1575 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const A a"); 1553 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const A a");
1576 Token keyword32 = result.keyword; 1554 Token keyword33 = result.keyword;
1577 JUnitTestCase.assertNotNull(keyword32); 1555 JUnitTestCase.assertNotNull(keyword33);
1578 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); 1556 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type);
1579 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword32 as KeywordToken)).keyw ord); 1557 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword33 as KeywordToken)).keyw ord);
1580 JUnitTestCase.assertNotNull(result.type); 1558 JUnitTestCase.assertNotNull(result.type);
1581 } 1559 }
1582 void test_parseFinalConstVarOrType_final_noType() { 1560 void test_parseFinalConstVarOrType_final_noType() {
1583 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final"); 1561 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final");
1584 Token keyword33 = result.keyword; 1562 Token keyword34 = result.keyword;
1585 JUnitTestCase.assertNotNull(keyword33); 1563 JUnitTestCase.assertNotNull(keyword34);
1586 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); 1564 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type);
1587 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword33 as KeywordToken)).keyw ord); 1565 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword34 as KeywordToken)).keyw ord);
1588 JUnitTestCase.assertNull(result.type); 1566 JUnitTestCase.assertNull(result.type);
1589 } 1567 }
1590 void test_parseFinalConstVarOrType_final_type() { 1568 void test_parseFinalConstVarOrType_final_type() {
1591 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final A a"); 1569 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "final A a");
1592 Token keyword34 = result.keyword; 1570 Token keyword35 = result.keyword;
1593 JUnitTestCase.assertNotNull(keyword34); 1571 JUnitTestCase.assertNotNull(keyword35);
1594 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type); 1572 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword35.type);
1595 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword34 as KeywordToken)).keyw ord); 1573 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword35 as KeywordToken)).keyw ord);
1596 JUnitTestCase.assertNotNull(result.type); 1574 JUnitTestCase.assertNotNull(result.type);
1597 } 1575 }
1598 void test_parseFinalConstVarOrType_type_parameterized() { 1576 void test_parseFinalConstVarOrType_type_parameterized() {
1599 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A<B> a"); 1577 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A<B> a");
1600 JUnitTestCase.assertNull(result.keyword); 1578 JUnitTestCase.assertNull(result.keyword);
1601 JUnitTestCase.assertNotNull(result.type); 1579 JUnitTestCase.assertNotNull(result.type);
1602 } 1580 }
1603 void test_parseFinalConstVarOrType_type_prefixed() { 1581 void test_parseFinalConstVarOrType_type_prefixed() {
1604 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A a"); 1582 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A a");
1605 JUnitTestCase.assertNull(result.keyword); 1583 JUnitTestCase.assertNull(result.keyword);
1606 JUnitTestCase.assertNotNull(result.type); 1584 JUnitTestCase.assertNotNull(result.type);
1607 } 1585 }
1608 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { 1586 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() {
1609 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A<B> a"); 1587 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "p.A<B> a");
1610 JUnitTestCase.assertNull(result.keyword); 1588 JUnitTestCase.assertNull(result.keyword);
1611 JUnitTestCase.assertNotNull(result.type); 1589 JUnitTestCase.assertNotNull(result.type);
1612 } 1590 }
1613 void test_parseFinalConstVarOrType_type_simple() { 1591 void test_parseFinalConstVarOrType_type_simple() {
1614 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A a"); 1592 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "A a");
1615 JUnitTestCase.assertNull(result.keyword); 1593 JUnitTestCase.assertNull(result.keyword);
1616 JUnitTestCase.assertNotNull(result.type); 1594 JUnitTestCase.assertNotNull(result.type);
1617 } 1595 }
1618 void test_parseFinalConstVarOrType_var() { 1596 void test_parseFinalConstVarOrType_var() {
1619 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "var"); 1597 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "var");
1620 Token keyword35 = result.keyword; 1598 Token keyword36 = result.keyword;
1621 JUnitTestCase.assertNotNull(keyword35); 1599 JUnitTestCase.assertNotNull(keyword36);
1622 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword35.type); 1600 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword36.type);
1623 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword35 as KeywordToken)).keywor d); 1601 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword36 as KeywordToken)).keywor d);
1624 JUnitTestCase.assertNull(result.type); 1602 JUnitTestCase.assertNull(result.type);
1625 } 1603 }
1626 void test_parseFormalParameter_final_withType_named() { 1604 void test_parseFormalParameter_final_withType_named() {
1627 ParameterKind kind = ParameterKind.NAMED; 1605 ParameterKind kind = ParameterKind.NAMED;
1628 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a : null"); 1606 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete r", <Object> [kind], "final A a : null");
1629 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter; 1607 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1630 JUnitTestCase.assertNotNull(simpleParameter.identifier); 1608 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1631 JUnitTestCase.assertNotNull(simpleParameter.keyword); 1609 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1632 JUnitTestCase.assertNotNull(simpleParameter.type); 1610 JUnitTestCase.assertNotNull(simpleParameter.type);
1633 JUnitTestCase.assertEquals(kind, simpleParameter.kind); 1611 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter; 1691 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP arameter;
1714 JUnitTestCase.assertNotNull(simpleParameter.identifier); 1692 JUnitTestCase.assertNotNull(simpleParameter.identifier);
1715 JUnitTestCase.assertNotNull(simpleParameter.keyword); 1693 JUnitTestCase.assertNotNull(simpleParameter.keyword);
1716 JUnitTestCase.assertNull(simpleParameter.type); 1694 JUnitTestCase.assertNull(simpleParameter.type);
1717 JUnitTestCase.assertEquals(kind, simpleParameter.kind); 1695 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
1718 JUnitTestCase.assertNotNull(parameter.separator); 1696 JUnitTestCase.assertNotNull(parameter.separator);
1719 JUnitTestCase.assertNotNull(parameter.defaultValue); 1697 JUnitTestCase.assertNotNull(parameter.defaultValue);
1720 JUnitTestCase.assertEquals(kind, parameter.kind); 1698 JUnitTestCase.assertEquals(kind, parameter.kind);
1721 } 1699 }
1722 void test_parseFormalParameterList_empty() { 1700 void test_parseFormalParameterList_empty() {
1723 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "()", []); 1701 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "()", []);
1724 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1702 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1725 JUnitTestCase.assertNull(parameterList.leftDelimiter); 1703 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1726 EngineTestCase.assertSize(0, parameterList.parameters); 1704 EngineTestCase.assertSize(0, parameterList.parameters);
1727 JUnitTestCase.assertNull(parameterList.rightDelimiter); 1705 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1728 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1706 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1729 } 1707 }
1730 void test_parseFormalParameterList_named_multiple() { 1708 void test_parseFormalParameterList_named_multiple() {
1731 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "({A a : 1, B b, C c : 3})", []); 1709 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a : 1, B b, C c : 3})", []);
1732 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1710 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1733 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1711 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1734 EngineTestCase.assertSize(3, parameterList.parameters); 1712 EngineTestCase.assertSize(3, parameterList.parameters);
1735 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1713 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1736 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1714 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1737 } 1715 }
1738 void test_parseFormalParameterList_named_single() { 1716 void test_parseFormalParameterList_named_single() {
1739 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "({A a})", []); 1717 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a})", []);
1740 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1718 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1741 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1719 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1742 EngineTestCase.assertSize(1, parameterList.parameters); 1720 EngineTestCase.assertSize(1, parameterList.parameters);
1743 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1721 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1744 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1722 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1745 } 1723 }
1746 void test_parseFormalParameterList_normal_multiple() { 1724 void test_parseFormalParameterList_normal_multiple() {
1747 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "(A a, B b, C c)", []); 1725 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, B b, C c)", []);
1748 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1726 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1749 JUnitTestCase.assertNull(parameterList.leftDelimiter); 1727 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1750 EngineTestCase.assertSize(3, parameterList.parameters); 1728 EngineTestCase.assertSize(3, parameterList.parameters);
1751 JUnitTestCase.assertNull(parameterList.rightDelimiter); 1729 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1752 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1730 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1753 } 1731 }
1754 void test_parseFormalParameterList_normal_named() { 1732 void test_parseFormalParameterList_normal_named() {
1755 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "(A a, {B b})", []); 1733 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, {B b})", []);
1756 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1734 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1757 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1735 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1758 EngineTestCase.assertSize(2, parameterList.parameters); 1736 EngineTestCase.assertSize(2, parameterList.parameters);
1759 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1737 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1760 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1738 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1761 } 1739 }
1762 void test_parseFormalParameterList_normal_positional() { 1740 void test_parseFormalParameterList_normal_positional() {
1763 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "(A a, [B b])", []); 1741 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, [B b])", []);
1764 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1742 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1765 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1743 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1766 EngineTestCase.assertSize(2, parameterList.parameters); 1744 EngineTestCase.assertSize(2, parameterList.parameters);
1767 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1745 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1768 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1746 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1769 } 1747 }
1770 void test_parseFormalParameterList_normal_single() { 1748 void test_parseFormalParameterList_normal_single() {
1771 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "(A a)", []); 1749 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a)", []);
1772 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1750 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1773 JUnitTestCase.assertNull(parameterList.leftDelimiter); 1751 JUnitTestCase.assertNull(parameterList.leftDelimiter);
1774 EngineTestCase.assertSize(1, parameterList.parameters); 1752 EngineTestCase.assertSize(1, parameterList.parameters);
1775 JUnitTestCase.assertNull(parameterList.rightDelimiter); 1753 JUnitTestCase.assertNull(parameterList.rightDelimiter);
1776 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1754 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1777 } 1755 }
1778 void test_parseFormalParameterList_positional_multiple() { 1756 void test_parseFormalParameterList_positional_multiple() {
1779 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "([A a = null, B b, C c = null])", []); 1757 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null, B b, C c = null])", []);
1780 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1758 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1781 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1759 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1782 EngineTestCase.assertSize(3, parameterList.parameters); 1760 EngineTestCase.assertSize(3, parameterList.parameters);
1783 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1761 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1784 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1762 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1785 } 1763 }
1786 void test_parseFormalParameterList_positional_single() { 1764 void test_parseFormalParameterList_positional_single() {
1787 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame terList", "([A a = null])", []); 1765 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null])", []);
1788 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 1766 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
1789 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 1767 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
1790 EngineTestCase.assertSize(1, parameterList.parameters); 1768 EngineTestCase.assertSize(1, parameterList.parameters);
1791 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 1769 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
1792 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 1770 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
1793 } 1771 }
1794 void test_parseForStatement_each_identifier() { 1772 void test_parseForStatement_each_identifier() {
1795 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for (element in list) {}", []); 1773 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (element in list) {}", []);
1796 JUnitTestCase.assertNotNull(statement.forKeyword); 1774 JUnitTestCase.assertNotNull(statement.forKeyword);
1797 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1775 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1798 JUnitTestCase.assertNotNull(statement.loopVariable); 1776 JUnitTestCase.assertNotNull(statement.loopVariable);
1799 JUnitTestCase.assertNotNull(statement.inKeyword); 1777 JUnitTestCase.assertNotNull(statement.inKeyword);
1800 JUnitTestCase.assertNotNull(statement.iterator); 1778 JUnitTestCase.assertNotNull(statement.iterator);
1801 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1779 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1802 JUnitTestCase.assertNotNull(statement.body); 1780 JUnitTestCase.assertNotNull(statement.body);
1803 } 1781 }
1804 void test_parseForStatement_each_noType_metadata() { 1782 void test_parseForStatement_each_noType_metadata() {
1805 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for (@A var element in list) {}", []); 1783 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var element in list) {}", []);
1806 JUnitTestCase.assertNotNull(statement.forKeyword); 1784 JUnitTestCase.assertNotNull(statement.forKeyword);
1807 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1785 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1808 JUnitTestCase.assertNotNull(statement.loopVariable); 1786 JUnitTestCase.assertNotNull(statement.loopVariable);
1809 EngineTestCase.assertSize(1, statement.loopVariable.metadata); 1787 EngineTestCase.assertSize(1, statement.loopVariable.metadata);
1810 JUnitTestCase.assertNotNull(statement.inKeyword); 1788 JUnitTestCase.assertNotNull(statement.inKeyword);
1811 JUnitTestCase.assertNotNull(statement.iterator); 1789 JUnitTestCase.assertNotNull(statement.iterator);
1812 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1790 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1813 JUnitTestCase.assertNotNull(statement.body); 1791 JUnitTestCase.assertNotNull(statement.body);
1814 } 1792 }
1815 void test_parseForStatement_each_type() { 1793 void test_parseForStatement_each_type() {
1816 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for (A element in list) {}", []); 1794 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (A element in list) {}", []);
1817 JUnitTestCase.assertNotNull(statement.forKeyword); 1795 JUnitTestCase.assertNotNull(statement.forKeyword);
1818 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1796 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1819 JUnitTestCase.assertNotNull(statement.loopVariable); 1797 JUnitTestCase.assertNotNull(statement.loopVariable);
1820 JUnitTestCase.assertNotNull(statement.inKeyword); 1798 JUnitTestCase.assertNotNull(statement.inKeyword);
1821 JUnitTestCase.assertNotNull(statement.iterator); 1799 JUnitTestCase.assertNotNull(statement.iterator);
1822 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1800 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1823 JUnitTestCase.assertNotNull(statement.body); 1801 JUnitTestCase.assertNotNull(statement.body);
1824 } 1802 }
1825 void test_parseForStatement_each_var() { 1803 void test_parseForStatement_each_var() {
1826 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for (var element in list) {}", []); 1804 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (var element in list) {}", []);
1827 JUnitTestCase.assertNotNull(statement.forKeyword); 1805 JUnitTestCase.assertNotNull(statement.forKeyword);
1828 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1806 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1829 JUnitTestCase.assertNotNull(statement.loopVariable); 1807 JUnitTestCase.assertNotNull(statement.loopVariable);
1830 JUnitTestCase.assertNotNull(statement.inKeyword); 1808 JUnitTestCase.assertNotNull(statement.inKeyword);
1831 JUnitTestCase.assertNotNull(statement.iterator); 1809 JUnitTestCase.assertNotNull(statement.iterator);
1832 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1810 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1833 JUnitTestCase.assertNotNull(statement.body); 1811 JUnitTestCase.assertNotNull(statement.body);
1834 } 1812 }
1835 void test_parseForStatement_loop_c() { 1813 void test_parseForStatement_loop_c() {
1836 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (; i < count;) {}", []); 1814 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count;) {}", []);
1837 JUnitTestCase.assertNotNull(statement.forKeyword); 1815 JUnitTestCase.assertNotNull(statement.forKeyword);
1838 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1816 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1839 JUnitTestCase.assertNull(statement.variables); 1817 JUnitTestCase.assertNull(statement.variables);
1840 JUnitTestCase.assertNull(statement.initialization); 1818 JUnitTestCase.assertNull(statement.initialization);
1841 JUnitTestCase.assertNotNull(statement.leftSeparator); 1819 JUnitTestCase.assertNotNull(statement.leftSeparator);
1842 JUnitTestCase.assertNotNull(statement.condition); 1820 JUnitTestCase.assertNotNull(statement.condition);
1843 JUnitTestCase.assertNotNull(statement.rightSeparator); 1821 JUnitTestCase.assertNotNull(statement.rightSeparator);
1844 EngineTestCase.assertSize(0, statement.updaters); 1822 EngineTestCase.assertSize(0, statement.updaters);
1845 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1823 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1846 JUnitTestCase.assertNotNull(statement.body); 1824 JUnitTestCase.assertNotNull(statement.body);
1847 } 1825 }
1848 void test_parseForStatement_loop_cu() { 1826 void test_parseForStatement_loop_cu() {
1849 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (; i < count; i++) {}", []); 1827 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count; i++) {}", []);
1850 JUnitTestCase.assertNotNull(statement.forKeyword); 1828 JUnitTestCase.assertNotNull(statement.forKeyword);
1851 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1829 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1852 JUnitTestCase.assertNull(statement.variables); 1830 JUnitTestCase.assertNull(statement.variables);
1853 JUnitTestCase.assertNull(statement.initialization); 1831 JUnitTestCase.assertNull(statement.initialization);
1854 JUnitTestCase.assertNotNull(statement.leftSeparator); 1832 JUnitTestCase.assertNotNull(statement.leftSeparator);
1855 JUnitTestCase.assertNotNull(statement.condition); 1833 JUnitTestCase.assertNotNull(statement.condition);
1856 JUnitTestCase.assertNotNull(statement.rightSeparator); 1834 JUnitTestCase.assertNotNull(statement.rightSeparator);
1857 EngineTestCase.assertSize(1, statement.updaters); 1835 EngineTestCase.assertSize(1, statement.updaters);
1858 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1836 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1859 JUnitTestCase.assertNotNull(statement.body); 1837 JUnitTestCase.assertNotNull(statement.body);
1860 } 1838 }
1861 void test_parseForStatement_loop_ecu() { 1839 void test_parseForStatement_loop_ecu() {
1862 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (i- -; i < count; i++) {}", []); 1840 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (i- -; i < count; i++) {}", []);
1863 JUnitTestCase.assertNotNull(statement.forKeyword); 1841 JUnitTestCase.assertNotNull(statement.forKeyword);
1864 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1842 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1865 JUnitTestCase.assertNull(statement.variables); 1843 JUnitTestCase.assertNull(statement.variables);
1866 JUnitTestCase.assertNotNull(statement.initialization); 1844 JUnitTestCase.assertNotNull(statement.initialization);
1867 JUnitTestCase.assertNotNull(statement.leftSeparator); 1845 JUnitTestCase.assertNotNull(statement.leftSeparator);
1868 JUnitTestCase.assertNotNull(statement.condition); 1846 JUnitTestCase.assertNotNull(statement.condition);
1869 JUnitTestCase.assertNotNull(statement.rightSeparator); 1847 JUnitTestCase.assertNotNull(statement.rightSeparator);
1870 EngineTestCase.assertSize(1, statement.updaters); 1848 EngineTestCase.assertSize(1, statement.updaters);
1871 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1849 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1872 JUnitTestCase.assertNotNull(statement.body); 1850 JUnitTestCase.assertNotNull(statement.body);
1873 } 1851 }
1874 void test_parseForStatement_loop_i() { 1852 void test_parseForStatement_loop_i() {
1875 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va r i = 0;;) {}", []); 1853 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;;) {}", []);
1876 JUnitTestCase.assertNotNull(statement.forKeyword); 1854 JUnitTestCase.assertNotNull(statement.forKeyword);
1877 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1855 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1878 VariableDeclarationList variables8 = statement.variables; 1856 VariableDeclarationList variables8 = statement.variables;
1879 JUnitTestCase.assertNotNull(variables8); 1857 JUnitTestCase.assertNotNull(variables8);
1858 EngineTestCase.assertSize(0, variables8.metadata);
1880 EngineTestCase.assertSize(1, variables8.variables); 1859 EngineTestCase.assertSize(1, variables8.variables);
1881 JUnitTestCase.assertNull(statement.initialization); 1860 JUnitTestCase.assertNull(statement.initialization);
1882 JUnitTestCase.assertNotNull(statement.leftSeparator); 1861 JUnitTestCase.assertNotNull(statement.leftSeparator);
1883 JUnitTestCase.assertNull(statement.condition); 1862 JUnitTestCase.assertNull(statement.condition);
1884 JUnitTestCase.assertNotNull(statement.rightSeparator); 1863 JUnitTestCase.assertNotNull(statement.rightSeparator);
1885 EngineTestCase.assertSize(0, statement.updaters); 1864 EngineTestCase.assertSize(0, statement.updaters);
1886 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1865 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1887 JUnitTestCase.assertNotNull(statement.body); 1866 JUnitTestCase.assertNotNull(statement.body);
1888 } 1867 }
1889 void test_parseForStatement_loop_ic() { 1868 void test_parseForStatement_loop_i_withMetadata() {
1890 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va r i = 0; i < count;) {}", []); 1869 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var i = 0;;) {}", []);
1891 JUnitTestCase.assertNotNull(statement.forKeyword); 1870 JUnitTestCase.assertNotNull(statement.forKeyword);
1892 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1871 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1893 VariableDeclarationList variables9 = statement.variables; 1872 VariableDeclarationList variables9 = statement.variables;
1894 JUnitTestCase.assertNotNull(variables9); 1873 JUnitTestCase.assertNotNull(variables9);
1874 EngineTestCase.assertSize(1, variables9.metadata);
1895 EngineTestCase.assertSize(1, variables9.variables); 1875 EngineTestCase.assertSize(1, variables9.variables);
1896 JUnitTestCase.assertNull(statement.initialization); 1876 JUnitTestCase.assertNull(statement.initialization);
1897 JUnitTestCase.assertNotNull(statement.leftSeparator); 1877 JUnitTestCase.assertNotNull(statement.leftSeparator);
1898 JUnitTestCase.assertNotNull(statement.condition); 1878 JUnitTestCase.assertNull(statement.condition);
1899 JUnitTestCase.assertNotNull(statement.rightSeparator); 1879 JUnitTestCase.assertNotNull(statement.rightSeparator);
1900 EngineTestCase.assertSize(0, statement.updaters); 1880 EngineTestCase.assertSize(0, statement.updaters);
1901 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1881 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1902 JUnitTestCase.assertNotNull(statement.body); 1882 JUnitTestCase.assertNotNull(statement.body);
1903 } 1883 }
1904 void test_parseForStatement_loop_icu() { 1884 void test_parseForStatement_loop_ic() {
1905 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va r i = 0; i < count; i++) {}", []); 1885 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count;) {}", []);
1906 JUnitTestCase.assertNotNull(statement.forKeyword); 1886 JUnitTestCase.assertNotNull(statement.forKeyword);
1907 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1887 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1908 VariableDeclarationList variables10 = statement.variables; 1888 VariableDeclarationList variables10 = statement.variables;
1909 JUnitTestCase.assertNotNull(variables10); 1889 JUnitTestCase.assertNotNull(variables10);
1910 EngineTestCase.assertSize(1, variables10.variables); 1890 EngineTestCase.assertSize(1, variables10.variables);
1911 JUnitTestCase.assertNull(statement.initialization); 1891 JUnitTestCase.assertNull(statement.initialization);
1912 JUnitTestCase.assertNotNull(statement.leftSeparator); 1892 JUnitTestCase.assertNotNull(statement.leftSeparator);
1913 JUnitTestCase.assertNotNull(statement.condition); 1893 JUnitTestCase.assertNotNull(statement.condition);
1914 JUnitTestCase.assertNotNull(statement.rightSeparator); 1894 JUnitTestCase.assertNotNull(statement.rightSeparator);
1895 EngineTestCase.assertSize(0, statement.updaters);
1896 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1897 JUnitTestCase.assertNotNull(statement.body);
1898 }
1899 void test_parseForStatement_loop_icu() {
1900 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count; i++) {}", []);
1901 JUnitTestCase.assertNotNull(statement.forKeyword);
1902 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1903 VariableDeclarationList variables11 = statement.variables;
1904 JUnitTestCase.assertNotNull(variables11);
1905 EngineTestCase.assertSize(1, variables11.variables);
1906 JUnitTestCase.assertNull(statement.initialization);
1907 JUnitTestCase.assertNotNull(statement.leftSeparator);
1908 JUnitTestCase.assertNotNull(statement.condition);
1909 JUnitTestCase.assertNotNull(statement.rightSeparator);
1915 EngineTestCase.assertSize(1, statement.updaters); 1910 EngineTestCase.assertSize(1, statement.updaters);
1916 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1911 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1917 JUnitTestCase.assertNotNull(statement.body); 1912 JUnitTestCase.assertNotNull(statement.body);
1918 } 1913 }
1919 void test_parseForStatement_loop_iicuu() { 1914 void test_parseForStatement_loop_iicuu() {
1920 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (in t i = 0, j = count; i < j; i++, j--) {}", []); 1915 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (in t i = 0, j = count; i < j; i++, j--) {}", []);
1921 JUnitTestCase.assertNotNull(statement.forKeyword); 1916 JUnitTestCase.assertNotNull(statement.forKeyword);
1922 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1917 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1923 VariableDeclarationList variables11 = statement.variables; 1918 VariableDeclarationList variables12 = statement.variables;
1924 JUnitTestCase.assertNotNull(variables11); 1919 JUnitTestCase.assertNotNull(variables12);
1925 EngineTestCase.assertSize(2, variables11.variables); 1920 EngineTestCase.assertSize(2, variables12.variables);
1926 JUnitTestCase.assertNull(statement.initialization); 1921 JUnitTestCase.assertNull(statement.initialization);
1927 JUnitTestCase.assertNotNull(statement.leftSeparator); 1922 JUnitTestCase.assertNotNull(statement.leftSeparator);
1928 JUnitTestCase.assertNotNull(statement.condition); 1923 JUnitTestCase.assertNotNull(statement.condition);
1929 JUnitTestCase.assertNotNull(statement.rightSeparator); 1924 JUnitTestCase.assertNotNull(statement.rightSeparator);
1930 EngineTestCase.assertSize(2, statement.updaters); 1925 EngineTestCase.assertSize(2, statement.updaters);
1931 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1926 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1932 JUnitTestCase.assertNotNull(statement.body); 1927 JUnitTestCase.assertNotNull(statement.body);
1933 } 1928 }
1934 void test_parseForStatement_loop_iu() { 1929 void test_parseForStatement_loop_iu() {
1935 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va r i = 0;; i++) {}", []); 1930 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;; i++) {}", []);
1936 JUnitTestCase.assertNotNull(statement.forKeyword); 1931 JUnitTestCase.assertNotNull(statement.forKeyword);
1937 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1932 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1938 VariableDeclarationList variables12 = statement.variables; 1933 VariableDeclarationList variables13 = statement.variables;
1939 JUnitTestCase.assertNotNull(variables12); 1934 JUnitTestCase.assertNotNull(variables13);
1940 EngineTestCase.assertSize(1, variables12.variables); 1935 EngineTestCase.assertSize(1, variables13.variables);
1941 JUnitTestCase.assertNull(statement.initialization); 1936 JUnitTestCase.assertNull(statement.initialization);
1942 JUnitTestCase.assertNotNull(statement.leftSeparator); 1937 JUnitTestCase.assertNotNull(statement.leftSeparator);
1943 JUnitTestCase.assertNull(statement.condition); 1938 JUnitTestCase.assertNull(statement.condition);
1944 JUnitTestCase.assertNotNull(statement.rightSeparator); 1939 JUnitTestCase.assertNotNull(statement.rightSeparator);
1945 EngineTestCase.assertSize(1, statement.updaters); 1940 EngineTestCase.assertSize(1, statement.updaters);
1946 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1941 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1947 JUnitTestCase.assertNotNull(statement.body); 1942 JUnitTestCase.assertNotNull(statement.body);
1948 } 1943 }
1949 void test_parseForStatement_loop_u() { 1944 void test_parseForStatement_loop_u() {
1950 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;; i++) {}", []); 1945 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;; i++) {}", []);
1951 JUnitTestCase.assertNotNull(statement.forKeyword); 1946 JUnitTestCase.assertNotNull(statement.forKeyword);
1952 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1947 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1953 JUnitTestCase.assertNull(statement.variables); 1948 JUnitTestCase.assertNull(statement.variables);
1954 JUnitTestCase.assertNull(statement.initialization); 1949 JUnitTestCase.assertNull(statement.initialization);
1955 JUnitTestCase.assertNotNull(statement.leftSeparator); 1950 JUnitTestCase.assertNotNull(statement.leftSeparator);
1956 JUnitTestCase.assertNull(statement.condition); 1951 JUnitTestCase.assertNull(statement.condition);
1957 JUnitTestCase.assertNotNull(statement.rightSeparator); 1952 JUnitTestCase.assertNotNull(statement.rightSeparator);
1958 EngineTestCase.assertSize(1, statement.updaters); 1953 EngineTestCase.assertSize(1, statement.updaters);
1959 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1954 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1960 JUnitTestCase.assertNotNull(statement.body); 1955 JUnitTestCase.assertNotNull(statement.body);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 JUnitTestCase.assertEquals(comment, declaration.documentationComment); 2001 JUnitTestCase.assertEquals(comment, declaration.documentationComment);
2007 JUnitTestCase.assertEquals(returnType, declaration.returnType); 2002 JUnitTestCase.assertEquals(returnType, declaration.returnType);
2008 JUnitTestCase.assertNotNull(declaration.name); 2003 JUnitTestCase.assertNotNull(declaration.name);
2009 FunctionExpression expression = declaration.functionExpression; 2004 FunctionExpression expression = declaration.functionExpression;
2010 JUnitTestCase.assertNotNull(expression); 2005 JUnitTestCase.assertNotNull(expression);
2011 JUnitTestCase.assertNotNull(expression.body); 2006 JUnitTestCase.assertNotNull(expression.body);
2012 JUnitTestCase.assertNotNull(expression.parameters); 2007 JUnitTestCase.assertNotNull(expression.parameters);
2013 JUnitTestCase.assertNotNull(declaration.propertyKeyword); 2008 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
2014 } 2009 }
2015 void test_parseFunctionDeclarationStatement() { 2010 void test_parseFunctionDeclarationStatement() {
2016 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseFunctio nDeclarationStatement", "void f(int p) => p * 2;", []); 2011 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseFunctio nDeclarationStatement", "void f(int p) => p * 2;", []);
2017 JUnitTestCase.assertNotNull(statement.functionDeclaration); 2012 JUnitTestCase.assertNotNull(statement.functionDeclaration);
2018 } 2013 }
2019 void test_parseFunctionExpression_body_inExpression() { 2014 void test_parseFunctionExpression_body_inExpression() {
2020 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi on", "(int i) => i++", []); 2015 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "(int i) => i++", []);
2021 JUnitTestCase.assertNotNull(expression.body); 2016 JUnitTestCase.assertNotNull(expression.body);
2022 JUnitTestCase.assertNotNull(expression.parameters); 2017 JUnitTestCase.assertNotNull(expression.parameters);
2023 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic olon); 2018 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic olon);
2024 } 2019 }
2025 void test_parseFunctionExpression_minimal() { 2020 void test_parseFunctionExpression_minimal() {
2026 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi on", "() {}", []); 2021 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "() {}", []);
2027 JUnitTestCase.assertNotNull(expression.body); 2022 JUnitTestCase.assertNotNull(expression.body);
2028 JUnitTestCase.assertNotNull(expression.parameters); 2023 JUnitTestCase.assertNotNull(expression.parameters);
2029 } 2024 }
2030 void test_parseGetter_nonStatic() { 2025 void test_parseGetter_nonStatic() {
2031 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 2026 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2032 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l); 2027 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2033 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "get a;"); 2028 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "get a;");
2034 JUnitTestCase.assertNotNull(method.body); 2029 JUnitTestCase.assertNotNull(method.body);
2035 JUnitTestCase.assertEquals(comment, method.documentationComment); 2030 JUnitTestCase.assertEquals(comment, method.documentationComment);
2036 JUnitTestCase.assertNull(method.externalKeyword); 2031 JUnitTestCase.assertNull(method.externalKeyword);
(...skipping 13 matching lines...) Expand all
2050 JUnitTestCase.assertEquals(comment, method.documentationComment); 2045 JUnitTestCase.assertEquals(comment, method.documentationComment);
2051 JUnitTestCase.assertNull(method.externalKeyword); 2046 JUnitTestCase.assertNull(method.externalKeyword);
2052 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); 2047 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
2053 JUnitTestCase.assertNotNull(method.name); 2048 JUnitTestCase.assertNotNull(method.name);
2054 JUnitTestCase.assertNull(method.operatorKeyword); 2049 JUnitTestCase.assertNull(method.operatorKeyword);
2055 JUnitTestCase.assertNull(method.parameters); 2050 JUnitTestCase.assertNull(method.parameters);
2056 JUnitTestCase.assertNotNull(method.propertyKeyword); 2051 JUnitTestCase.assertNotNull(method.propertyKeyword);
2057 JUnitTestCase.assertEquals(returnType, method.returnType); 2052 JUnitTestCase.assertEquals(returnType, method.returnType);
2058 } 2053 }
2059 void test_parseIdentifierList_multiple() { 2054 void test_parseIdentifierList_multiple() {
2060 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", " a, b, c", []); 2055 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a, b, c", []);
2061 EngineTestCase.assertSize(3, list); 2056 EngineTestCase.assertSize(3, list);
2062 } 2057 }
2063 void test_parseIdentifierList_single() { 2058 void test_parseIdentifierList_single() {
2064 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", " a", []); 2059 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a", []);
2065 EngineTestCase.assertSize(1, list); 2060 EngineTestCase.assertSize(1, list);
2066 } 2061 }
2067 void test_parseIfStatement_else_block() { 2062 void test_parseIfStatement_else_block() {
2068 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {} else {}", []); 2063 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} else {}", []);
2069 JUnitTestCase.assertNotNull(statement.ifKeyword); 2064 JUnitTestCase.assertNotNull(statement.ifKeyword);
2070 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2065 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2071 JUnitTestCase.assertNotNull(statement.condition); 2066 JUnitTestCase.assertNotNull(statement.condition);
2072 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2067 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2073 JUnitTestCase.assertNotNull(statement.thenStatement); 2068 JUnitTestCase.assertNotNull(statement.thenStatement);
2074 JUnitTestCase.assertNotNull(statement.elseKeyword); 2069 JUnitTestCase.assertNotNull(statement.elseKeyword);
2075 JUnitTestCase.assertNotNull(statement.elseStatement); 2070 JUnitTestCase.assertNotNull(statement.elseStatement);
2076 } 2071 }
2077 void test_parseIfStatement_else_statement() { 2072 void test_parseIfStatement_else_statement() {
2078 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f( x); else f(y);", []); 2073 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x); else f(y);", []);
2079 JUnitTestCase.assertNotNull(statement.ifKeyword); 2074 JUnitTestCase.assertNotNull(statement.ifKeyword);
2080 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2075 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2081 JUnitTestCase.assertNotNull(statement.condition); 2076 JUnitTestCase.assertNotNull(statement.condition);
2082 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2077 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2083 JUnitTestCase.assertNotNull(statement.thenStatement); 2078 JUnitTestCase.assertNotNull(statement.thenStatement);
2084 JUnitTestCase.assertNotNull(statement.elseKeyword); 2079 JUnitTestCase.assertNotNull(statement.elseKeyword);
2085 JUnitTestCase.assertNotNull(statement.elseStatement); 2080 JUnitTestCase.assertNotNull(statement.elseStatement);
2086 } 2081 }
2087 void test_parseIfStatement_noElse_block() { 2082 void test_parseIfStatement_noElse_block() {
2088 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {} ", []); 2083 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} ", []);
2089 JUnitTestCase.assertNotNull(statement.ifKeyword); 2084 JUnitTestCase.assertNotNull(statement.ifKeyword);
2090 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2085 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2091 JUnitTestCase.assertNotNull(statement.condition); 2086 JUnitTestCase.assertNotNull(statement.condition);
2092 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2087 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2093 JUnitTestCase.assertNotNull(statement.thenStatement); 2088 JUnitTestCase.assertNotNull(statement.thenStatement);
2094 JUnitTestCase.assertNull(statement.elseKeyword); 2089 JUnitTestCase.assertNull(statement.elseKeyword);
2095 JUnitTestCase.assertNull(statement.elseStatement); 2090 JUnitTestCase.assertNull(statement.elseStatement);
2096 } 2091 }
2097 void test_parseIfStatement_noElse_statement() { 2092 void test_parseIfStatement_noElse_statement() {
2098 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f( x);", []); 2093 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x);", []);
2099 JUnitTestCase.assertNotNull(statement.ifKeyword); 2094 JUnitTestCase.assertNotNull(statement.ifKeyword);
2100 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2095 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2101 JUnitTestCase.assertNotNull(statement.condition); 2096 JUnitTestCase.assertNotNull(statement.condition);
2102 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2097 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2103 JUnitTestCase.assertNotNull(statement.thenStatement); 2098 JUnitTestCase.assertNotNull(statement.thenStatement);
2104 JUnitTestCase.assertNull(statement.elseKeyword); 2099 JUnitTestCase.assertNull(statement.elseKeyword);
2105 JUnitTestCase.assertNull(statement.elseStatement); 2100 JUnitTestCase.assertNull(statement.elseStatement);
2106 } 2101 }
2107 void test_parseImplementsClause_multiple() { 2102 void test_parseImplementsClause_multiple() {
2108 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im plements A, B, C", []); 2103 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A, B, C", []);
2109 EngineTestCase.assertSize(3, clause.interfaces); 2104 EngineTestCase.assertSize(3, clause.interfaces);
2110 JUnitTestCase.assertNotNull(clause.keyword); 2105 JUnitTestCase.assertNotNull(clause.keyword);
2111 } 2106 }
2112 void test_parseImplementsClause_single() { 2107 void test_parseImplementsClause_single() {
2113 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im plements A", []); 2108 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A", []);
2114 EngineTestCase.assertSize(1, clause.interfaces); 2109 EngineTestCase.assertSize(1, clause.interfaces);
2115 JUnitTestCase.assertNotNull(clause.keyword); 2110 JUnitTestCase.assertNotNull(clause.keyword);
2116 } 2111 }
2117 void test_parseImportDirective_hide() { 2112 void test_parseImportDirective_hide() {
2118 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); 2113 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;");
2119 JUnitTestCase.assertNotNull(directive.keyword); 2114 JUnitTestCase.assertNotNull(directive.keyword);
2120 JUnitTestCase.assertNotNull(directive.uri); 2115 JUnitTestCase.assertNotNull(directive.uri);
2121 JUnitTestCase.assertNull(directive.asToken); 2116 JUnitTestCase.assertNull(directive.asToken);
2122 JUnitTestCase.assertNull(directive.prefix); 2117 JUnitTestCase.assertNull(directive.prefix);
2123 EngineTestCase.assertSize(1, directive.combinators); 2118 EngineTestCase.assertSize(1, directive.combinators);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2241 JUnitTestCase.assertNotNull(expression.argumentList); 2236 JUnitTestCase.assertNotNull(expression.argumentList);
2242 } 2237 }
2243 void test_parseLibraryDirective() { 2238 void test_parseLibraryDirective() {
2244 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", < Object> [emptyCommentAndMetadata()], "library l;"); 2239 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", < Object> [emptyCommentAndMetadata()], "library l;");
2245 JUnitTestCase.assertNotNull(directive.libraryToken); 2240 JUnitTestCase.assertNotNull(directive.libraryToken);
2246 JUnitTestCase.assertNotNull(directive.name); 2241 JUnitTestCase.assertNotNull(directive.name);
2247 JUnitTestCase.assertNotNull(directive.semicolon); 2242 JUnitTestCase.assertNotNull(directive.semicolon);
2248 } 2243 }
2249 void test_parseLibraryIdentifier_multiple() { 2244 void test_parseLibraryIdentifier_multiple() {
2250 String name = "a.b.c"; 2245 String name = "a.b.c";
2251 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier ", name, []); 2246 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []);
2252 JUnitTestCase.assertEquals(name, identifier.name); 2247 JUnitTestCase.assertEquals(name, identifier.name);
2253 } 2248 }
2254 void test_parseLibraryIdentifier_single() { 2249 void test_parseLibraryIdentifier_single() {
2255 String name = "a"; 2250 String name = "a";
2256 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier ", name, []); 2251 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []);
2257 JUnitTestCase.assertEquals(name, identifier.name); 2252 JUnitTestCase.assertEquals(name, identifier.name);
2258 } 2253 }
2259 void test_parseListLiteral_empty_oneToken() { 2254 void test_parseListLiteral_empty_oneToken() {
2260 Token token9 = TokenFactory.token(Keyword.CONST); 2255 Token token9 = TokenFactory.token(Keyword.CONST);
2261 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null) ; 2256 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null) ;
2262 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en9, typeArguments], "[]"); 2257 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en9, typeArguments], "[]");
2263 JUnitTestCase.assertEquals(token9, literal.modifier); 2258 JUnitTestCase.assertEquals(token9, literal.modifier);
2264 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); 2259 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2265 JUnitTestCase.assertNotNull(literal.leftBracket); 2260 JUnitTestCase.assertNotNull(literal.leftBracket);
2266 EngineTestCase.assertSize(0, literal.elements); 2261 EngineTestCase.assertSize(0, literal.elements);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
2318 } 2313 }
2319 void test_parseListOrMapLiteral_map_type() { 2314 void test_parseListOrMapLiteral_map_type() {
2320 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<int> {'1' : 1}"); 2315 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<int> {'1' : 1}");
2321 JUnitTestCase.assertNull(literal.modifier); 2316 JUnitTestCase.assertNull(literal.modifier);
2322 JUnitTestCase.assertNotNull(literal.typeArguments); 2317 JUnitTestCase.assertNotNull(literal.typeArguments);
2323 JUnitTestCase.assertNotNull(literal.leftBracket); 2318 JUnitTestCase.assertNotNull(literal.leftBracket);
2324 EngineTestCase.assertSize(1, literal.entries); 2319 EngineTestCase.assertSize(1, literal.entries);
2325 JUnitTestCase.assertNotNull(literal.rightBracket); 2320 JUnitTestCase.assertNotNull(literal.rightBracket);
2326 } 2321 }
2327 void test_parseLogicalAndExpression() { 2322 void test_parseLogicalAndExpression() {
2328 BinaryExpression expression = ParserTestCase.parse6("parseLogicalAndExpressi on", "x && y", []); 2323 BinaryExpression expression = ParserTestCase.parse5("parseLogicalAndExpressi on", "x && y", []);
2329 JUnitTestCase.assertNotNull(expression.leftOperand); 2324 JUnitTestCase.assertNotNull(expression.leftOperand);
2330 JUnitTestCase.assertNotNull(expression.operator); 2325 JUnitTestCase.assertNotNull(expression.operator);
2331 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato r.type); 2326 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato r.type);
2332 JUnitTestCase.assertNotNull(expression.rightOperand); 2327 JUnitTestCase.assertNotNull(expression.rightOperand);
2333 } 2328 }
2334 void test_parseLogicalOrExpression() { 2329 void test_parseLogicalOrExpression() {
2335 BinaryExpression expression = ParserTestCase.parse6("parseLogicalOrExpressio n", "x || y", []); 2330 BinaryExpression expression = ParserTestCase.parse5("parseLogicalOrExpressio n", "x || y", []);
2336 JUnitTestCase.assertNotNull(expression.leftOperand); 2331 JUnitTestCase.assertNotNull(expression.leftOperand);
2337 JUnitTestCase.assertNotNull(expression.operator); 2332 JUnitTestCase.assertNotNull(expression.operator);
2338 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); 2333 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type);
2339 JUnitTestCase.assertNotNull(expression.rightOperand); 2334 JUnitTestCase.assertNotNull(expression.rightOperand);
2340 } 2335 }
2341 void test_parseMapLiteral_empty() { 2336 void test_parseMapLiteral_empty() {
2342 Token token11 = TokenFactory.token(Keyword.CONST); 2337 Token token11 = TokenFactory.token(Keyword.CONST);
2343 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null) ; 2338 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null) ;
2344 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token 11, typeArguments], "{}"); 2339 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token 11, typeArguments], "{}");
2345 JUnitTestCase.assertEquals(token11, literal.modifier); 2340 JUnitTestCase.assertEquals(token11, literal.modifier);
2346 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); 2341 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2347 JUnitTestCase.assertNotNull(literal.leftBracket); 2342 JUnitTestCase.assertNotNull(literal.leftBracket);
2348 EngineTestCase.assertSize(0, literal.entries); 2343 EngineTestCase.assertSize(0, literal.entries);
2349 JUnitTestCase.assertNotNull(literal.rightBracket); 2344 JUnitTestCase.assertNotNull(literal.rightBracket);
2350 } 2345 }
2351 void test_parseMapLiteral_multiple() { 2346 void test_parseMapLiteral_multiple() {
2352 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'a' : b, 'x' : y}"); 2347 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'a' : b, 'x' : y}");
2353 JUnitTestCase.assertNotNull(literal.leftBracket); 2348 JUnitTestCase.assertNotNull(literal.leftBracket);
2354 EngineTestCase.assertSize(2, literal.entries); 2349 EngineTestCase.assertSize(2, literal.entries);
2355 JUnitTestCase.assertNotNull(literal.rightBracket); 2350 JUnitTestCase.assertNotNull(literal.rightBracket);
2356 } 2351 }
2357 void test_parseMapLiteral_single() { 2352 void test_parseMapLiteral_single() {
2358 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}"); 2353 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}");
2359 JUnitTestCase.assertNotNull(literal.leftBracket); 2354 JUnitTestCase.assertNotNull(literal.leftBracket);
2360 EngineTestCase.assertSize(1, literal.entries); 2355 EngineTestCase.assertSize(1, literal.entries);
2361 JUnitTestCase.assertNotNull(literal.rightBracket); 2356 JUnitTestCase.assertNotNull(literal.rightBracket);
2362 } 2357 }
2363 void test_parseMapLiteralEntry() { 2358 void test_parseMapLiteralEntry() {
2364 MapLiteralEntry entry = ParserTestCase.parse6("parseMapLiteralEntry", "'x' : y", []); 2359 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "'x' : y", []);
2365 JUnitTestCase.assertNotNull(entry.key); 2360 JUnitTestCase.assertNotNull(entry.key);
2366 JUnitTestCase.assertNotNull(entry.separator); 2361 JUnitTestCase.assertNotNull(entry.separator);
2367 JUnitTestCase.assertNotNull(entry.value); 2362 JUnitTestCase.assertNotNull(entry.value);
2368 } 2363 }
2369 void test_parseModifiers_abstract() { 2364 void test_parseModifiers_abstract() {
2370 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "abstract A", []); 2365 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "abstract A", []);
2371 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); 2366 JUnitTestCase.assertNotNull(modifiers.abstractKeyword);
2372 } 2367 }
2373 void test_parseModifiers_const() { 2368 void test_parseModifiers_const() {
2374 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "const A", []) ; 2369 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "const A", []) ;
2375 JUnitTestCase.assertNotNull(modifiers.constKeyword); 2370 JUnitTestCase.assertNotNull(modifiers.constKeyword);
2376 } 2371 }
2377 void test_parseModifiers_external() { 2372 void test_parseModifiers_external() {
2378 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "external A", []); 2373 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "external A", []);
2379 JUnitTestCase.assertNotNull(modifiers.externalKeyword); 2374 JUnitTestCase.assertNotNull(modifiers.externalKeyword);
2380 } 2375 }
2381 void test_parseModifiers_factory() { 2376 void test_parseModifiers_factory() {
2382 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "factory A", [ ]); 2377 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "factory A", [ ]);
2383 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); 2378 JUnitTestCase.assertNotNull(modifiers.factoryKeyword);
2384 } 2379 }
2385 void test_parseModifiers_final() { 2380 void test_parseModifiers_final() {
2386 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "final A", []) ; 2381 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "final A", []) ;
2387 JUnitTestCase.assertNotNull(modifiers.finalKeyword); 2382 JUnitTestCase.assertNotNull(modifiers.finalKeyword);
2388 } 2383 }
2389 void test_parseModifiers_static() { 2384 void test_parseModifiers_static() {
2390 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "static A", [] ); 2385 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "static A", [] );
2391 JUnitTestCase.assertNotNull(modifiers.staticKeyword); 2386 JUnitTestCase.assertNotNull(modifiers.staticKeyword);
2392 } 2387 }
2393 void test_parseModifiers_var() { 2388 void test_parseModifiers_var() {
2394 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "var A", []); 2389 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "var A", []);
2395 JUnitTestCase.assertNotNull(modifiers.varKeyword); 2390 JUnitTestCase.assertNotNull(modifiers.varKeyword);
2396 } 2391 }
2397 void test_parseMultiplicativeExpression_normal() { 2392 void test_parseMultiplicativeExpression_normal() {
2398 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr ession", "x * y", []); 2393 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "x * y", []);
2399 JUnitTestCase.assertNotNull(expression.leftOperand); 2394 JUnitTestCase.assertNotNull(expression.leftOperand);
2400 JUnitTestCase.assertNotNull(expression.operator); 2395 JUnitTestCase.assertNotNull(expression.operator);
2401 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); 2396 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
2402 JUnitTestCase.assertNotNull(expression.rightOperand); 2397 JUnitTestCase.assertNotNull(expression.rightOperand);
2403 } 2398 }
2404 void test_parseMultiplicativeExpression_super() { 2399 void test_parseMultiplicativeExpression_super() {
2405 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr ession", "super * y", []); 2400 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "super * y", []);
2406 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 2401 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
2407 JUnitTestCase.assertNotNull(expression.operator); 2402 JUnitTestCase.assertNotNull(expression.operator);
2408 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); 2403 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
2409 JUnitTestCase.assertNotNull(expression.rightOperand); 2404 JUnitTestCase.assertNotNull(expression.rightOperand);
2410 } 2405 }
2411 void test_parseNewExpression() { 2406 void test_parseNewExpression() {
2412 InstanceCreationExpression expression = ParserTestCase.parse6("parseNewExpre ssion", "new A()", []); 2407 InstanceCreationExpression expression = ParserTestCase.parse5("parseNewExpre ssion", "new A()", []);
2413 JUnitTestCase.assertNotNull(expression.keyword); 2408 JUnitTestCase.assertNotNull(expression.keyword);
2414 ConstructorName name = expression.constructorName; 2409 ConstructorName name = expression.constructorName;
2415 JUnitTestCase.assertNotNull(name); 2410 JUnitTestCase.assertNotNull(name);
2416 JUnitTestCase.assertNotNull(name.type); 2411 JUnitTestCase.assertNotNull(name.type);
2417 JUnitTestCase.assertNull(name.period); 2412 JUnitTestCase.assertNull(name.period);
2418 JUnitTestCase.assertNull(name.name); 2413 JUnitTestCase.assertNull(name.name);
2419 JUnitTestCase.assertNotNull(expression.argumentList); 2414 JUnitTestCase.assertNotNull(expression.argumentList);
2420 } 2415 }
2421 void test_parseNonLabeledStatement_const_list_empty() { 2416 void test_parseNonLabeledStatement_const_list_empty() {
2422 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const [];", []); 2417 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [];", []);
2423 JUnitTestCase.assertNotNull(statement.expression); 2418 JUnitTestCase.assertNotNull(statement.expression);
2424 } 2419 }
2425 void test_parseNonLabeledStatement_const_list_nonEmpty() { 2420 void test_parseNonLabeledStatement_const_list_nonEmpty() {
2426 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const [1, 2];", []); 2421 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [1, 2];", []);
2427 JUnitTestCase.assertNotNull(statement.expression); 2422 JUnitTestCase.assertNotNull(statement.expression);
2428 } 2423 }
2429 void test_parseNonLabeledStatement_const_map_empty() { 2424 void test_parseNonLabeledStatement_const_map_empty() {
2430 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const {};", []); 2425 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {};", []);
2431 JUnitTestCase.assertNotNull(statement.expression); 2426 JUnitTestCase.assertNotNull(statement.expression);
2432 } 2427 }
2433 void test_parseNonLabeledStatement_const_map_nonEmpty() { 2428 void test_parseNonLabeledStatement_const_map_nonEmpty() {
2434 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const {'a' : 1};", []); 2429 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {'a' : 1};", []);
2435 JUnitTestCase.assertNotNull(statement.expression); 2430 JUnitTestCase.assertNotNull(statement.expression);
2436 } 2431 }
2437 void test_parseNonLabeledStatement_const_object() { 2432 void test_parseNonLabeledStatement_const_object() {
2438 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const A();", []); 2433 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A();", []);
2439 JUnitTestCase.assertNotNull(statement.expression); 2434 JUnitTestCase.assertNotNull(statement.expression);
2440 } 2435 }
2441 void test_parseNonLabeledStatement_const_object_named_typeParameters() { 2436 void test_parseNonLabeledStatement_const_object_named_typeParameters() {
2442 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "const A<B>.c();", []); 2437 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A<B>.c();", []);
2443 JUnitTestCase.assertNotNull(statement.expression); 2438 JUnitTestCase.assertNotNull(statement.expression);
2444 } 2439 }
2445 void test_parseNonLabeledStatement_constructorInvocation() { 2440 void test_parseNonLabeledStatement_constructorInvocation() {
2446 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "new C().m();", []); 2441 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "new C().m();", []);
2447 JUnitTestCase.assertNotNull(statement.expression); 2442 JUnitTestCase.assertNotNull(statement.expression);
2448 } 2443 }
2449 void test_parseNonLabeledStatement_false() { 2444 void test_parseNonLabeledStatement_false() {
2450 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "false;", []); 2445 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "false;", []);
2451 JUnitTestCase.assertNotNull(statement.expression); 2446 JUnitTestCase.assertNotNull(statement.expression);
2452 } 2447 }
2453 void test_parseNonLabeledStatement_functionDeclaration() { 2448 void test_parseNonLabeledStatement_functionDeclaration() {
2454 ParserTestCase.parse6("parseNonLabeledStatement", "f() {};", []); 2449 ParserTestCase.parse5("parseNonLabeledStatement", "f() {};", []);
2455 } 2450 }
2456 void test_parseNonLabeledStatement_functionDeclaration_arguments() { 2451 void test_parseNonLabeledStatement_functionDeclaration_arguments() {
2457 ParserTestCase.parse6("parseNonLabeledStatement", "f(void g()) {};", []); 2452 ParserTestCase.parse5("parseNonLabeledStatement", "f(void g()) {};", []);
2458 } 2453 }
2459 void test_parseNonLabeledStatement_functionExpressionIndex() { 2454 void test_parseNonLabeledStatement_functionExpressionIndex() {
2460 ParserTestCase.parse6("parseNonLabeledStatement", "() {}[0] = null;", []); 2455 ParserTestCase.parse5("parseNonLabeledStatement", "() {}[0] = null;", []);
2461 } 2456 }
2462 void test_parseNonLabeledStatement_functionInvocation() { 2457 void test_parseNonLabeledStatement_functionInvocation() {
2463 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "f();", []); 2458 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "f();", []);
2464 JUnitTestCase.assertNotNull(statement.expression); 2459 JUnitTestCase.assertNotNull(statement.expression);
2465 } 2460 }
2466 void test_parseNonLabeledStatement_invokeFunctionExpression() { 2461 void test_parseNonLabeledStatement_invokeFunctionExpression() {
2467 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "(a) {return a + a;} (3);", []); 2462 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "(a) {return a + a;} (3);", []);
2468 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr ession); 2463 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr ession);
2469 FunctionExpressionInvocation invocation = statement.expression as FunctionEx pressionInvocation; 2464 FunctionExpressionInvocation invocation = statement.expression as FunctionEx pressionInvocation;
2470 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); 2465 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
2471 FunctionExpression expression = invocation.function as FunctionExpression; 2466 FunctionExpression expression = invocation.function as FunctionExpression;
2472 JUnitTestCase.assertNotNull(expression.parameters); 2467 JUnitTestCase.assertNotNull(expression.parameters);
2473 JUnitTestCase.assertNotNull(expression.body); 2468 JUnitTestCase.assertNotNull(expression.body);
2474 ArgumentList list = invocation.argumentList; 2469 ArgumentList list = invocation.argumentList;
2475 JUnitTestCase.assertNotNull(list); 2470 JUnitTestCase.assertNotNull(list);
2476 EngineTestCase.assertSize(1, list.arguments); 2471 EngineTestCase.assertSize(1, list.arguments);
2477 } 2472 }
2478 void test_parseNonLabeledStatement_null() { 2473 void test_parseNonLabeledStatement_null() {
2479 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "null;", []); 2474 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "null;", []);
2480 JUnitTestCase.assertNotNull(statement.expression); 2475 JUnitTestCase.assertNotNull(statement.expression);
2481 } 2476 }
2482 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { 2477 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() {
2483 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "library.getName();", []); 2478 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "library.getName();", []);
2484 JUnitTestCase.assertNotNull(statement.expression); 2479 JUnitTestCase.assertNotNull(statement.expression);
2485 } 2480 }
2486 void test_parseNonLabeledStatement_true() { 2481 void test_parseNonLabeledStatement_true() {
2487 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "true;", []); 2482 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "true;", []);
2488 JUnitTestCase.assertNotNull(statement.expression); 2483 JUnitTestCase.assertNotNull(statement.expression);
2489 } 2484 }
2490 void test_parseNonLabeledStatement_typeCast() { 2485 void test_parseNonLabeledStatement_typeCast() {
2491 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem ent", "double.NAN as num;", []); 2486 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "double.NAN as num;", []);
2492 JUnitTestCase.assertNotNull(statement.expression); 2487 JUnitTestCase.assertNotNull(statement.expression);
2493 } 2488 }
2494 void test_parseNormalFormalParameter_field_const_noType() { 2489 void test_parseNormalFormalParameter_field_const_noType() {
2495 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "const this.a)", []); 2490 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const this.a)", []);
2496 JUnitTestCase.assertNotNull(parameter.keyword); 2491 JUnitTestCase.assertNotNull(parameter.keyword);
2497 JUnitTestCase.assertNull(parameter.type); 2492 JUnitTestCase.assertNull(parameter.type);
2498 JUnitTestCase.assertNotNull(parameter.identifier); 2493 JUnitTestCase.assertNotNull(parameter.identifier);
2499 } 2494 }
2500 void test_parseNormalFormalParameter_field_const_type() { 2495 void test_parseNormalFormalParameter_field_const_type() {
2501 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "const A this.a)", []); 2496 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const A this.a)", []);
2502 JUnitTestCase.assertNotNull(parameter.keyword); 2497 JUnitTestCase.assertNotNull(parameter.keyword);
2503 JUnitTestCase.assertNotNull(parameter.type); 2498 JUnitTestCase.assertNotNull(parameter.type);
2504 JUnitTestCase.assertNotNull(parameter.identifier); 2499 JUnitTestCase.assertNotNull(parameter.identifier);
2505 } 2500 }
2506 void test_parseNormalFormalParameter_field_final_noType() { 2501 void test_parseNormalFormalParameter_field_final_noType() {
2507 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "final this.a)", []); 2502 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final this.a)", []);
2508 JUnitTestCase.assertNotNull(parameter.keyword); 2503 JUnitTestCase.assertNotNull(parameter.keyword);
2509 JUnitTestCase.assertNull(parameter.type); 2504 JUnitTestCase.assertNull(parameter.type);
2510 JUnitTestCase.assertNotNull(parameter.identifier); 2505 JUnitTestCase.assertNotNull(parameter.identifier);
2511 } 2506 }
2512 void test_parseNormalFormalParameter_field_final_type() { 2507 void test_parseNormalFormalParameter_field_final_type() {
2513 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "final A this.a)", []); 2508 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final A this.a)", []);
2514 JUnitTestCase.assertNotNull(parameter.keyword); 2509 JUnitTestCase.assertNotNull(parameter.keyword);
2515 JUnitTestCase.assertNotNull(parameter.type); 2510 JUnitTestCase.assertNotNull(parameter.type);
2516 JUnitTestCase.assertNotNull(parameter.identifier); 2511 JUnitTestCase.assertNotNull(parameter.identifier);
2517 } 2512 }
2518 void test_parseNormalFormalParameter_field_noType() { 2513 void test_parseNormalFormalParameter_field_noType() {
2519 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "this.a)", []); 2514 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a)", []);
2520 JUnitTestCase.assertNull(parameter.keyword); 2515 JUnitTestCase.assertNull(parameter.keyword);
2521 JUnitTestCase.assertNull(parameter.type); 2516 JUnitTestCase.assertNull(parameter.type);
2522 JUnitTestCase.assertNotNull(parameter.identifier); 2517 JUnitTestCase.assertNotNull(parameter.identifier);
2523 } 2518 }
2524 void test_parseNormalFormalParameter_field_type() { 2519 void test_parseNormalFormalParameter_field_type() {
2525 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "A this.a)", []); 2520 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "A this.a)", []);
2526 JUnitTestCase.assertNull(parameter.keyword); 2521 JUnitTestCase.assertNull(parameter.keyword);
2527 JUnitTestCase.assertNotNull(parameter.type); 2522 JUnitTestCase.assertNotNull(parameter.type);
2528 JUnitTestCase.assertNotNull(parameter.identifier); 2523 JUnitTestCase.assertNotNull(parameter.identifier);
2529 } 2524 }
2530 void test_parseNormalFormalParameter_field_var() { 2525 void test_parseNormalFormalParameter_field_var() {
2531 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar ameter", "var this.a)", []); 2526 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "var this.a)", []);
2532 JUnitTestCase.assertNotNull(parameter.keyword); 2527 JUnitTestCase.assertNotNull(parameter.keyword);
2533 JUnitTestCase.assertNull(parameter.type); 2528 JUnitTestCase.assertNull(parameter.type);
2534 JUnitTestCase.assertNotNull(parameter.identifier); 2529 JUnitTestCase.assertNotNull(parameter.identifier);
2535 } 2530 }
2536 void test_parseNormalFormalParameter_function_noType() { 2531 void test_parseNormalFormalParameter_function_noType() {
2537 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF ormalParameter", "a())", []); 2532 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "a())", []);
2538 JUnitTestCase.assertNull(parameter.returnType); 2533 JUnitTestCase.assertNull(parameter.returnType);
2539 JUnitTestCase.assertNotNull(parameter.identifier); 2534 JUnitTestCase.assertNotNull(parameter.identifier);
2540 JUnitTestCase.assertNotNull(parameter.parameters); 2535 JUnitTestCase.assertNotNull(parameter.parameters);
2541 } 2536 }
2542 void test_parseNormalFormalParameter_function_type() { 2537 void test_parseNormalFormalParameter_function_type() {
2543 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF ormalParameter", "A a())", []); 2538 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "A a())", []);
2544 JUnitTestCase.assertNotNull(parameter.returnType); 2539 JUnitTestCase.assertNotNull(parameter.returnType);
2545 JUnitTestCase.assertNotNull(parameter.identifier); 2540 JUnitTestCase.assertNotNull(parameter.identifier);
2546 JUnitTestCase.assertNotNull(parameter.parameters); 2541 JUnitTestCase.assertNotNull(parameter.parameters);
2547 } 2542 }
2548 void test_parseNormalFormalParameter_function_void() { 2543 void test_parseNormalFormalParameter_function_void() {
2549 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF ormalParameter", "void a())", []); 2544 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "void a())", []);
2550 JUnitTestCase.assertNotNull(parameter.returnType); 2545 JUnitTestCase.assertNotNull(parameter.returnType);
2551 JUnitTestCase.assertNotNull(parameter.identifier); 2546 JUnitTestCase.assertNotNull(parameter.identifier);
2552 JUnitTestCase.assertNotNull(parameter.parameters); 2547 JUnitTestCase.assertNotNull(parameter.parameters);
2553 } 2548 }
2554 void test_parseNormalFormalParameter_simple_const_noType() { 2549 void test_parseNormalFormalParameter_simple_const_noType() {
2555 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "const a)", []); 2550 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const a)", []);
2556 JUnitTestCase.assertNotNull(parameter.keyword); 2551 JUnitTestCase.assertNotNull(parameter.keyword);
2557 JUnitTestCase.assertNull(parameter.type); 2552 JUnitTestCase.assertNull(parameter.type);
2558 JUnitTestCase.assertNotNull(parameter.identifier); 2553 JUnitTestCase.assertNotNull(parameter.identifier);
2559 } 2554 }
2560 void test_parseNormalFormalParameter_simple_const_type() { 2555 void test_parseNormalFormalParameter_simple_const_type() {
2561 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "const A a)", []); 2556 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const A a)", []);
2562 JUnitTestCase.assertNotNull(parameter.keyword); 2557 JUnitTestCase.assertNotNull(parameter.keyword);
2563 JUnitTestCase.assertNotNull(parameter.type); 2558 JUnitTestCase.assertNotNull(parameter.type);
2564 JUnitTestCase.assertNotNull(parameter.identifier); 2559 JUnitTestCase.assertNotNull(parameter.identifier);
2565 } 2560 }
2566 void test_parseNormalFormalParameter_simple_final_noType() { 2561 void test_parseNormalFormalParameter_simple_final_noType() {
2567 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "final a)", []); 2562 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final a)", []);
2568 JUnitTestCase.assertNotNull(parameter.keyword); 2563 JUnitTestCase.assertNotNull(parameter.keyword);
2569 JUnitTestCase.assertNull(parameter.type); 2564 JUnitTestCase.assertNull(parameter.type);
2570 JUnitTestCase.assertNotNull(parameter.identifier); 2565 JUnitTestCase.assertNotNull(parameter.identifier);
2571 } 2566 }
2572 void test_parseNormalFormalParameter_simple_final_type() { 2567 void test_parseNormalFormalParameter_simple_final_type() {
2573 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "final A a)", []); 2568 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final A a)", []);
2574 JUnitTestCase.assertNotNull(parameter.keyword); 2569 JUnitTestCase.assertNotNull(parameter.keyword);
2575 JUnitTestCase.assertNotNull(parameter.type); 2570 JUnitTestCase.assertNotNull(parameter.type);
2576 JUnitTestCase.assertNotNull(parameter.identifier); 2571 JUnitTestCase.assertNotNull(parameter.identifier);
2577 } 2572 }
2578 void test_parseNormalFormalParameter_simple_noType() { 2573 void test_parseNormalFormalParameter_simple_noType() {
2579 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "a)", []); 2574 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "a)", []);
2580 JUnitTestCase.assertNull(parameter.keyword); 2575 JUnitTestCase.assertNull(parameter.keyword);
2581 JUnitTestCase.assertNull(parameter.type); 2576 JUnitTestCase.assertNull(parameter.type);
2582 JUnitTestCase.assertNotNull(parameter.identifier); 2577 JUnitTestCase.assertNotNull(parameter.identifier);
2583 } 2578 }
2584 void test_parseNormalFormalParameter_simple_type() { 2579 void test_parseNormalFormalParameter_simple_type() {
2585 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa rameter", "A a)", []); 2580 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "A a)", []);
2586 JUnitTestCase.assertNull(parameter.keyword); 2581 JUnitTestCase.assertNull(parameter.keyword);
2587 JUnitTestCase.assertNotNull(parameter.type); 2582 JUnitTestCase.assertNotNull(parameter.type);
2588 JUnitTestCase.assertNotNull(parameter.identifier); 2583 JUnitTestCase.assertNotNull(parameter.identifier);
2589 } 2584 }
2590 void test_parseOperator() { 2585 void test_parseOperator() {
2591 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 2586 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2592 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l); 2587 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2593 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); 2588 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c ommentAndMetadata(comment, []), null, returnType], "operator +(A a);");
2594 JUnitTestCase.assertNotNull(method.body); 2589 JUnitTestCase.assertNotNull(method.body);
2595 JUnitTestCase.assertEquals(comment, method.documentationComment); 2590 JUnitTestCase.assertEquals(comment, method.documentationComment);
(...skipping 14 matching lines...) Expand all
2610 JUnitTestCase.assertNotNull(directive.semicolon); 2605 JUnitTestCase.assertNotNull(directive.semicolon);
2611 } 2606 }
2612 void test_parsePartDirective_partOf() { 2607 void test_parsePartDirective_partOf() {
2613 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje ct> [emptyCommentAndMetadata()], "part of l;"); 2608 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje ct> [emptyCommentAndMetadata()], "part of l;");
2614 JUnitTestCase.assertNotNull(directive.partToken); 2609 JUnitTestCase.assertNotNull(directive.partToken);
2615 JUnitTestCase.assertNotNull(directive.ofToken); 2610 JUnitTestCase.assertNotNull(directive.ofToken);
2616 JUnitTestCase.assertNotNull(directive.libraryName); 2611 JUnitTestCase.assertNotNull(directive.libraryName);
2617 JUnitTestCase.assertNotNull(directive.semicolon); 2612 JUnitTestCase.assertNotNull(directive.semicolon);
2618 } 2613 }
2619 void test_parsePostfixExpression_decrement() { 2614 void test_parsePostfixExpression_decrement() {
2620 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression ", "i--", []); 2615 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i--", []);
2621 JUnitTestCase.assertNotNull(expression.operand); 2616 JUnitTestCase.assertNotNull(expression.operand);
2622 JUnitTestCase.assertNotNull(expression.operator); 2617 JUnitTestCase.assertNotNull(expression.operator);
2623 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); 2618 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
2624 } 2619 }
2625 void test_parsePostfixExpression_increment() { 2620 void test_parsePostfixExpression_increment() {
2626 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression ", "i++", []); 2621 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i++", []);
2627 JUnitTestCase.assertNotNull(expression.operand); 2622 JUnitTestCase.assertNotNull(expression.operand);
2628 JUnitTestCase.assertNotNull(expression.operator); 2623 JUnitTestCase.assertNotNull(expression.operator);
2629 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 2624 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
2630 } 2625 }
2631 void test_parsePostfixExpression_none_indexExpression() { 2626 void test_parsePostfixExpression_none_indexExpression() {
2632 IndexExpression expression = ParserTestCase.parse6("parsePostfixExpression", "a[0]", []); 2627 IndexExpression expression = ParserTestCase.parse5("parsePostfixExpression", "a[0]", []);
2633 JUnitTestCase.assertNotNull(expression.array); 2628 JUnitTestCase.assertNotNull(expression.array);
2634 JUnitTestCase.assertNotNull(expression.index); 2629 JUnitTestCase.assertNotNull(expression.index);
2635 } 2630 }
2636 void test_parsePostfixExpression_none_methodInvocation() { 2631 void test_parsePostfixExpression_none_methodInvocation() {
2637 MethodInvocation expression = ParserTestCase.parse6("parsePostfixExpression" , "a.m()", []); 2632 MethodInvocation expression = ParserTestCase.parse5("parsePostfixExpression" , "a.m()", []);
2638 JUnitTestCase.assertNotNull(expression.target); 2633 JUnitTestCase.assertNotNull(expression.target);
2639 JUnitTestCase.assertNotNull(expression.methodName); 2634 JUnitTestCase.assertNotNull(expression.methodName);
2640 JUnitTestCase.assertNotNull(expression.argumentList); 2635 JUnitTestCase.assertNotNull(expression.argumentList);
2641 } 2636 }
2642 void test_parsePostfixExpression_none_propertyAccess() { 2637 void test_parsePostfixExpression_none_propertyAccess() {
2643 PrefixedIdentifier expression = ParserTestCase.parse6("parsePostfixExpressio n", "a.b", []); 2638 PrefixedIdentifier expression = ParserTestCase.parse5("parsePostfixExpressio n", "a.b", []);
2644 JUnitTestCase.assertNotNull(expression.prefix); 2639 JUnitTestCase.assertNotNull(expression.prefix);
2645 JUnitTestCase.assertNotNull(expression.identifier); 2640 JUnitTestCase.assertNotNull(expression.identifier);
2646 } 2641 }
2647 void test_parsePrefixedIdentifier_noPrefix() { 2642 void test_parsePrefixedIdentifier_noPrefix() {
2648 String lexeme = "bar"; 2643 String lexeme = "bar";
2649 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifier ", lexeme, []); 2644 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifier ", lexeme, []);
2650 JUnitTestCase.assertNotNull(identifier.token); 2645 JUnitTestCase.assertNotNull(identifier.token);
2651 JUnitTestCase.assertEquals(lexeme, identifier.name); 2646 JUnitTestCase.assertEquals(lexeme, identifier.name);
2652 } 2647 }
2653 void test_parsePrefixedIdentifier_prefix() { 2648 void test_parsePrefixedIdentifier_prefix() {
2654 String lexeme = "foo.bar"; 2649 String lexeme = "foo.bar";
2655 PrefixedIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifi er", lexeme, []); 2650 PrefixedIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifi er", lexeme, []);
2656 JUnitTestCase.assertEquals("foo", identifier.prefix.name); 2651 JUnitTestCase.assertEquals("foo", identifier.prefix.name);
2657 JUnitTestCase.assertNotNull(identifier.period); 2652 JUnitTestCase.assertNotNull(identifier.period);
2658 JUnitTestCase.assertEquals("bar", identifier.identifier.name); 2653 JUnitTestCase.assertEquals("bar", identifier.identifier.name);
2659 } 2654 }
2660 void test_parsePrimaryExpression_argumentDefinitionTest() { 2655 void test_parsePrimaryExpression_argumentDefinitionTest() {
2661 ArgumentDefinitionTest expression = ParserTestCase.parse6("parseArgumentDefi nitionTest", "?a", []); 2656 ArgumentDefinitionTest expression = ParserTestCase.parse5("parseArgumentDefi nitionTest", "?a", []);
2662 JUnitTestCase.assertNotNull(expression.question); 2657 JUnitTestCase.assertNotNull(expression.question);
2663 JUnitTestCase.assertNotNull(expression.identifier); 2658 JUnitTestCase.assertNotNull(expression.identifier);
2664 } 2659 }
2665 void test_parsePrimaryExpression_const() { 2660 void test_parsePrimaryExpression_const() {
2666 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE xpression", "const A()", []); 2661 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "const A()", []);
2667 JUnitTestCase.assertNotNull(expression); 2662 JUnitTestCase.assertNotNull(expression);
2668 } 2663 }
2669 void test_parsePrimaryExpression_double() { 2664 void test_parsePrimaryExpression_double() {
2670 String doubleLiteral = "3.2e4"; 2665 String doubleLiteral = "3.2e4";
2671 DoubleLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", doub leLiteral, []); 2666 DoubleLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", doub leLiteral, []);
2672 JUnitTestCase.assertNotNull(literal.literal); 2667 JUnitTestCase.assertNotNull(literal.literal);
2673 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); 2668 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value);
2674 } 2669 }
2675 void test_parsePrimaryExpression_false() { 2670 void test_parsePrimaryExpression_false() {
2676 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "fa lse", []); 2671 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "fa lse", []);
2677 JUnitTestCase.assertNotNull(literal.literal); 2672 JUnitTestCase.assertNotNull(literal.literal);
2678 JUnitTestCase.assertFalse(literal.value); 2673 JUnitTestCase.assertFalse(literal.value);
2679 } 2674 }
2680 void test_parsePrimaryExpression_function_arguments() { 2675 void test_parsePrimaryExpression_function_arguments() {
2681 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio n", "(int i) => i + 1", []); 2676 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "(int i) => i + 1", []);
2682 JUnitTestCase.assertNotNull(expression.parameters); 2677 JUnitTestCase.assertNotNull(expression.parameters);
2683 JUnitTestCase.assertNotNull(expression.body); 2678 JUnitTestCase.assertNotNull(expression.body);
2684 } 2679 }
2685 void test_parsePrimaryExpression_function_noArguments() { 2680 void test_parsePrimaryExpression_function_noArguments() {
2686 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio n", "() => 42", []); 2681 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "() => 42", []);
2687 JUnitTestCase.assertNotNull(expression.parameters); 2682 JUnitTestCase.assertNotNull(expression.parameters);
2688 JUnitTestCase.assertNotNull(expression.body); 2683 JUnitTestCase.assertNotNull(expression.body);
2689 } 2684 }
2690 void test_parsePrimaryExpression_hex() { 2685 void test_parsePrimaryExpression_hex() {
2691 String hexLiteral = "3F"; 2686 String hexLiteral = "3F";
2692 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "0x ${hexLiteral}", []); 2687 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "0x ${hexLiteral}", []);
2693 JUnitTestCase.assertNotNull(literal.literal); 2688 JUnitTestCase.assertNotNull(literal.literal);
2694 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); 2689 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value);
2695 } 2690 }
2696 void test_parsePrimaryExpression_identifier() { 2691 void test_parsePrimaryExpression_identifier() {
2697 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrimaryExpression" , "a", []); 2692 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrimaryExpression" , "a", []);
2698 JUnitTestCase.assertNotNull(identifier); 2693 JUnitTestCase.assertNotNull(identifier);
2699 } 2694 }
2700 void test_parsePrimaryExpression_int() { 2695 void test_parsePrimaryExpression_int() {
2701 String intLiteral = "472"; 2696 String intLiteral = "472";
2702 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", int Literal, []); 2697 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", int Literal, []);
2703 JUnitTestCase.assertNotNull(literal.literal); 2698 JUnitTestCase.assertNotNull(literal.literal);
2704 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); 2699 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value);
2705 } 2700 }
2706 void test_parsePrimaryExpression_listLiteral() { 2701 void test_parsePrimaryExpression_listLiteral() {
2707 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[ ]", []); 2702 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[ ]", []);
2708 JUnitTestCase.assertNotNull(literal); 2703 JUnitTestCase.assertNotNull(literal);
2709 } 2704 }
2710 void test_parsePrimaryExpression_listLiteral_index() { 2705 void test_parsePrimaryExpression_listLiteral_index() {
2711 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[]", []); 2706 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[]", []);
2712 JUnitTestCase.assertNotNull(literal); 2707 JUnitTestCase.assertNotNull(literal);
2713 } 2708 }
2714 void test_parsePrimaryExpression_listLiteral_typed() { 2709 void test_parsePrimaryExpression_listLiteral_typed() {
2715 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>[ ]", []); 2710 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>[ ]", []);
2716 JUnitTestCase.assertNotNull(literal.typeArguments); 2711 JUnitTestCase.assertNotNull(literal.typeArguments);
2717 EngineTestCase.assertSize(1, literal.typeArguments.arguments); 2712 EngineTestCase.assertSize(1, literal.typeArguments.arguments);
2718 } 2713 }
2719 void test_parsePrimaryExpression_mapLiteral() { 2714 void test_parsePrimaryExpression_mapLiteral() {
2720 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "{}", [ ]); 2715 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "{}", [ ]);
2721 JUnitTestCase.assertNotNull(literal); 2716 JUnitTestCase.assertNotNull(literal);
2722 } 2717 }
2723 void test_parsePrimaryExpression_mapLiteral_typed() { 2718 void test_parsePrimaryExpression_mapLiteral_typed() {
2724 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>{}" , []); 2719 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>{}" , []);
2725 JUnitTestCase.assertNotNull(literal.typeArguments); 2720 JUnitTestCase.assertNotNull(literal.typeArguments);
2726 EngineTestCase.assertSize(1, literal.typeArguments.arguments); 2721 EngineTestCase.assertSize(1, literal.typeArguments.arguments);
2727 } 2722 }
2728 void test_parsePrimaryExpression_new() { 2723 void test_parsePrimaryExpression_new() {
2729 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE xpression", "new A()", []); 2724 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "new A()", []);
2730 JUnitTestCase.assertNotNull(expression); 2725 JUnitTestCase.assertNotNull(expression);
2731 } 2726 }
2732 void test_parsePrimaryExpression_null() { 2727 void test_parsePrimaryExpression_null() {
2733 NullLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "null" , []); 2728 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null" , []);
2734 JUnitTestCase.assertNotNull(literal.literal); 2729 JUnitTestCase.assertNotNull(literal.literal);
2735 } 2730 }
2736 void test_parsePrimaryExpression_parenthesized() { 2731 void test_parsePrimaryExpression_parenthesized() {
2737 ParenthesizedExpression expression = ParserTestCase.parse6("parsePrimaryExpr ession", "()", []); 2732 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr ession", "()", []);
2738 JUnitTestCase.assertNotNull(expression); 2733 JUnitTestCase.assertNotNull(expression);
2739 } 2734 }
2740 void test_parsePrimaryExpression_string() { 2735 void test_parsePrimaryExpression_string() {
2741 SimpleStringLiteral literal = ParserTestCase.parse6("parsePrimaryExpression" , "\"string\"", []); 2736 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression" , "\"string\"", []);
2742 JUnitTestCase.assertFalse(literal.isMultiline()); 2737 JUnitTestCase.assertFalse(literal.isMultiline());
2743 JUnitTestCase.assertEquals("string", literal.value); 2738 JUnitTestCase.assertEquals("string", literal.value);
2744 } 2739 }
2745 void test_parsePrimaryExpression_super() { 2740 void test_parsePrimaryExpression_super() {
2746 PropertyAccess propertyAccess = ParserTestCase.parse6("parsePrimaryExpressio n", "super.x", []); 2741 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio n", "super.x", []);
2747 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); 2742 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression);
2748 JUnitTestCase.assertNotNull(propertyAccess.operator); 2743 JUnitTestCase.assertNotNull(propertyAccess.operator);
2749 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); 2744 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type);
2750 JUnitTestCase.assertNotNull(propertyAccess.propertyName); 2745 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
2751 } 2746 }
2752 void test_parsePrimaryExpression_this() { 2747 void test_parsePrimaryExpression_this() {
2753 ThisExpression expression = ParserTestCase.parse6("parsePrimaryExpression", "this", []); 2748 ThisExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "this", []);
2754 JUnitTestCase.assertNotNull(expression.keyword); 2749 JUnitTestCase.assertNotNull(expression.keyword);
2755 } 2750 }
2756 void test_parsePrimaryExpression_true() { 2751 void test_parsePrimaryExpression_true() {
2757 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "tr ue", []); 2752 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "tr ue", []);
2758 JUnitTestCase.assertNotNull(literal.literal); 2753 JUnitTestCase.assertNotNull(literal.literal);
2759 JUnitTestCase.assertTrue(literal.value); 2754 JUnitTestCase.assertTrue(literal.value);
2760 } 2755 }
2761 void test_Parser() { 2756 void test_Parser() {
2762 JUnitTestCase.assertNotNull(new Parser(null, null)); 2757 JUnitTestCase.assertNotNull(new Parser(null, null));
2763 } 2758 }
2764 void test_parseRedirectingConstructorInvocation_named() { 2759 void test_parseRedirectingConstructorInvocation_named() {
2765 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe directingConstructorInvocation", "this.a()", []); 2760 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this.a()", []);
2766 JUnitTestCase.assertNotNull(invocation.argumentList); 2761 JUnitTestCase.assertNotNull(invocation.argumentList);
2767 JUnitTestCase.assertNotNull(invocation.constructorName); 2762 JUnitTestCase.assertNotNull(invocation.constructorName);
2768 JUnitTestCase.assertNotNull(invocation.keyword); 2763 JUnitTestCase.assertNotNull(invocation.keyword);
2769 JUnitTestCase.assertNotNull(invocation.period); 2764 JUnitTestCase.assertNotNull(invocation.period);
2770 } 2765 }
2771 void test_parseRedirectingConstructorInvocation_unnamed() { 2766 void test_parseRedirectingConstructorInvocation_unnamed() {
2772 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe directingConstructorInvocation", "this()", []); 2767 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this()", []);
2773 JUnitTestCase.assertNotNull(invocation.argumentList); 2768 JUnitTestCase.assertNotNull(invocation.argumentList);
2774 JUnitTestCase.assertNull(invocation.constructorName); 2769 JUnitTestCase.assertNull(invocation.constructorName);
2775 JUnitTestCase.assertNotNull(invocation.keyword); 2770 JUnitTestCase.assertNotNull(invocation.keyword);
2776 JUnitTestCase.assertNull(invocation.period); 2771 JUnitTestCase.assertNull(invocation.period);
2777 } 2772 }
2778 void test_parseRelationalExpression_as() { 2773 void test_parseRelationalExpression_as() {
2779 AsExpression expression = ParserTestCase.parse6("parseRelationalExpression", "x as Y", []); 2774 AsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x as Y", []);
2780 JUnitTestCase.assertNotNull(expression.expression); 2775 JUnitTestCase.assertNotNull(expression.expression);
2781 JUnitTestCase.assertNotNull(expression.asOperator); 2776 JUnitTestCase.assertNotNull(expression.asOperator);
2782 JUnitTestCase.assertNotNull(expression.type); 2777 JUnitTestCase.assertNotNull(expression.type);
2783 } 2778 }
2784 void test_parseRelationalExpression_is() { 2779 void test_parseRelationalExpression_is() {
2785 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression", "x is y", []); 2780 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is y", []);
2786 JUnitTestCase.assertNotNull(expression.expression); 2781 JUnitTestCase.assertNotNull(expression.expression);
2787 JUnitTestCase.assertNotNull(expression.isOperator); 2782 JUnitTestCase.assertNotNull(expression.isOperator);
2788 JUnitTestCase.assertNull(expression.notOperator); 2783 JUnitTestCase.assertNull(expression.notOperator);
2789 JUnitTestCase.assertNotNull(expression.type); 2784 JUnitTestCase.assertNotNull(expression.type);
2790 } 2785 }
2791 void test_parseRelationalExpression_isNot() { 2786 void test_parseRelationalExpression_isNot() {
2792 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression", "x is! y", []); 2787 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is! y", []);
2793 JUnitTestCase.assertNotNull(expression.expression); 2788 JUnitTestCase.assertNotNull(expression.expression);
2794 JUnitTestCase.assertNotNull(expression.isOperator); 2789 JUnitTestCase.assertNotNull(expression.isOperator);
2795 JUnitTestCase.assertNotNull(expression.notOperator); 2790 JUnitTestCase.assertNotNull(expression.notOperator);
2796 JUnitTestCase.assertNotNull(expression.type); 2791 JUnitTestCase.assertNotNull(expression.type);
2797 } 2792 }
2798 void test_parseRelationalExpression_normal() { 2793 void test_parseRelationalExpression_normal() {
2799 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi on", "x < y", []); 2794 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "x < y", []);
2800 JUnitTestCase.assertNotNull(expression.leftOperand); 2795 JUnitTestCase.assertNotNull(expression.leftOperand);
2801 JUnitTestCase.assertNotNull(expression.operator); 2796 JUnitTestCase.assertNotNull(expression.operator);
2802 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); 2797 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
2803 JUnitTestCase.assertNotNull(expression.rightOperand); 2798 JUnitTestCase.assertNotNull(expression.rightOperand);
2804 } 2799 }
2805 void test_parseRelationalExpression_super() { 2800 void test_parseRelationalExpression_super() {
2806 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi on", "super < y", []); 2801 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "super < y", []);
2807 JUnitTestCase.assertNotNull(expression.leftOperand); 2802 JUnitTestCase.assertNotNull(expression.leftOperand);
2808 JUnitTestCase.assertNotNull(expression.operator); 2803 JUnitTestCase.assertNotNull(expression.operator);
2809 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); 2804 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
2810 JUnitTestCase.assertNotNull(expression.rightOperand); 2805 JUnitTestCase.assertNotNull(expression.rightOperand);
2811 } 2806 }
2807 void test_parseRethrowExpression() {
2808 RethrowExpression expression = ParserTestCase.parse5("parseRethrowExpression ", "rethrow;", []);
2809 JUnitTestCase.assertNotNull(expression.keyword);
2810 }
2812 void test_parseReturnStatement_noValue() { 2811 void test_parseReturnStatement_noValue() {
2813 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r eturn;", []); 2812 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn;", []);
2814 JUnitTestCase.assertNotNull(statement.keyword); 2813 JUnitTestCase.assertNotNull(statement.keyword);
2815 JUnitTestCase.assertNull(statement.expression); 2814 JUnitTestCase.assertNull(statement.expression);
2816 JUnitTestCase.assertNotNull(statement.semicolon); 2815 JUnitTestCase.assertNotNull(statement.semicolon);
2817 } 2816 }
2818 void test_parseReturnStatement_value() { 2817 void test_parseReturnStatement_value() {
2819 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r eturn x;", []); 2818 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn x;", []);
2820 JUnitTestCase.assertNotNull(statement.keyword); 2819 JUnitTestCase.assertNotNull(statement.keyword);
2821 JUnitTestCase.assertNotNull(statement.expression); 2820 JUnitTestCase.assertNotNull(statement.expression);
2822 JUnitTestCase.assertNotNull(statement.semicolon); 2821 JUnitTestCase.assertNotNull(statement.semicolon);
2823 } 2822 }
2824 void test_parseReturnType_nonVoid() { 2823 void test_parseReturnType_nonVoid() {
2825 TypeName typeName = ParserTestCase.parse6("parseReturnType", "A<B>", []); 2824 TypeName typeName = ParserTestCase.parse5("parseReturnType", "A<B>", []);
2826 JUnitTestCase.assertNotNull(typeName.name); 2825 JUnitTestCase.assertNotNull(typeName.name);
2827 JUnitTestCase.assertNotNull(typeName.typeArguments); 2826 JUnitTestCase.assertNotNull(typeName.typeArguments);
2828 } 2827 }
2829 void test_parseReturnType_void() { 2828 void test_parseReturnType_void() {
2830 TypeName typeName = ParserTestCase.parse6("parseReturnType", "void", []); 2829 TypeName typeName = ParserTestCase.parse5("parseReturnType", "void", []);
2831 JUnitTestCase.assertNotNull(typeName.name); 2830 JUnitTestCase.assertNotNull(typeName.name);
2832 JUnitTestCase.assertNull(typeName.typeArguments); 2831 JUnitTestCase.assertNull(typeName.typeArguments);
2833 } 2832 }
2834 void test_parseSetter_nonStatic() { 2833 void test_parseSetter_nonStatic() {
2835 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 2834 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2836 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l); 2835 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul l);
2837 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); 2836 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "set a(var x);");
2838 JUnitTestCase.assertNotNull(method.body); 2837 JUnitTestCase.assertNotNull(method.body);
2839 JUnitTestCase.assertEquals(comment, method.documentationComment); 2838 JUnitTestCase.assertEquals(comment, method.documentationComment);
2840 JUnitTestCase.assertNull(method.externalKeyword); 2839 JUnitTestCase.assertNull(method.externalKeyword);
(...skipping 13 matching lines...) Expand all
2854 JUnitTestCase.assertEquals(comment, method.documentationComment); 2853 JUnitTestCase.assertEquals(comment, method.documentationComment);
2855 JUnitTestCase.assertNull(method.externalKeyword); 2854 JUnitTestCase.assertNull(method.externalKeyword);
2856 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); 2855 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
2857 JUnitTestCase.assertNotNull(method.name); 2856 JUnitTestCase.assertNotNull(method.name);
2858 JUnitTestCase.assertNull(method.operatorKeyword); 2857 JUnitTestCase.assertNull(method.operatorKeyword);
2859 JUnitTestCase.assertNotNull(method.parameters); 2858 JUnitTestCase.assertNotNull(method.parameters);
2860 JUnitTestCase.assertNotNull(method.propertyKeyword); 2859 JUnitTestCase.assertNotNull(method.propertyKeyword);
2861 JUnitTestCase.assertEquals(returnType, method.returnType); 2860 JUnitTestCase.assertEquals(returnType, method.returnType);
2862 } 2861 }
2863 void test_parseShiftExpression_normal() { 2862 void test_parseShiftExpression_normal() {
2864 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression", "x << y", []); 2863 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "x << y", []);
2865 JUnitTestCase.assertNotNull(expression.leftOperand); 2864 JUnitTestCase.assertNotNull(expression.leftOperand);
2866 JUnitTestCase.assertNotNull(expression.operator); 2865 JUnitTestCase.assertNotNull(expression.operator);
2867 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); 2866 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
2868 JUnitTestCase.assertNotNull(expression.rightOperand); 2867 JUnitTestCase.assertNotNull(expression.rightOperand);
2869 } 2868 }
2870 void test_parseShiftExpression_super() { 2869 void test_parseShiftExpression_super() {
2871 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression", "super << y", []); 2870 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "super << y", []);
2872 JUnitTestCase.assertNotNull(expression.leftOperand); 2871 JUnitTestCase.assertNotNull(expression.leftOperand);
2873 JUnitTestCase.assertNotNull(expression.operator); 2872 JUnitTestCase.assertNotNull(expression.operator);
2874 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); 2873 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
2875 JUnitTestCase.assertNotNull(expression.rightOperand); 2874 JUnitTestCase.assertNotNull(expression.rightOperand);
2876 } 2875 }
2877 void test_parseSimpleIdentifier_builtInIdentifier() { 2876 void test_parseSimpleIdentifier_builtInIdentifier() {
2878 String lexeme = "as"; 2877 String lexeme = "as";
2879 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier", lexeme, []); 2878 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []);
2880 JUnitTestCase.assertNotNull(identifier.token); 2879 JUnitTestCase.assertNotNull(identifier.token);
2881 JUnitTestCase.assertEquals(lexeme, identifier.name); 2880 JUnitTestCase.assertEquals(lexeme, identifier.name);
2882 } 2881 }
2883 void test_parseSimpleIdentifier_normalIdentifier() { 2882 void test_parseSimpleIdentifier_normalIdentifier() {
2884 String lexeme = "foo"; 2883 String lexeme = "foo";
2885 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier", lexeme, []); 2884 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []);
2886 JUnitTestCase.assertNotNull(identifier.token); 2885 JUnitTestCase.assertNotNull(identifier.token);
2887 JUnitTestCase.assertEquals(lexeme, identifier.name); 2886 JUnitTestCase.assertEquals(lexeme, identifier.name);
2888 } 2887 }
2889 void test_parseSimpleIdentifier1_normalIdentifier() { 2888 void test_parseSimpleIdentifier1_normalIdentifier() {
2890 } 2889 }
2891 void test_parseStatement_functionDeclaration() { 2890 void test_parseStatement_functionDeclaration() {
2892 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseStateme nt", "int f(a, b) {};", []); 2891 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseStateme nt", "int f(a, b) {};", []);
2893 JUnitTestCase.assertNotNull(statement.functionDeclaration); 2892 JUnitTestCase.assertNotNull(statement.functionDeclaration);
2894 } 2893 }
2895 void test_parseStatement_mulipleLabels() { 2894 void test_parseStatement_mulipleLabels() {
2896 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: m: return x;", []); 2895 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: m: return x;", []);
2897 EngineTestCase.assertSize(2, statement.labels); 2896 EngineTestCase.assertSize(2, statement.labels);
2898 JUnitTestCase.assertNotNull(statement.statement); 2897 JUnitTestCase.assertNotNull(statement.statement);
2899 } 2898 }
2900 void test_parseStatement_noLabels() { 2899 void test_parseStatement_noLabels() {
2901 ParserTestCase.parse6("parseStatement", "return x;", []); 2900 ParserTestCase.parse5("parseStatement", "return x;", []);
2902 } 2901 }
2903 void test_parseStatement_singleLabel() { 2902 void test_parseStatement_singleLabel() {
2904 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: ret urn x;", []); 2903 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: ret urn x;", []);
2905 EngineTestCase.assertSize(1, statement.labels); 2904 EngineTestCase.assertSize(1, statement.labels);
2906 JUnitTestCase.assertNotNull(statement.statement); 2905 JUnitTestCase.assertNotNull(statement.statement);
2907 } 2906 }
2908 void test_parseStatements_multiple() { 2907 void test_parseStatements_multiple() {
2909 List<Statement> statements = ParserTestCase.parseStatements("return; return; ", 2, []); 2908 List<Statement> statements = ParserTestCase.parseStatements("return; return; ", 2, []);
2910 EngineTestCase.assertSize(2, statements); 2909 EngineTestCase.assertSize(2, statements);
2911 } 2910 }
2912 void test_parseStatements_single() { 2911 void test_parseStatements_single() {
2913 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, [] ); 2912 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, [] );
2914 EngineTestCase.assertSize(1, statements); 2913 EngineTestCase.assertSize(1, statements);
2915 } 2914 }
2916 void test_parseStringLiteral_adjacent() { 2915 void test_parseStringLiteral_adjacent() {
2917 AdjacentStrings literal = ParserTestCase.parse6("parseStringLiteral", "'a' ' b'", []); 2916 AdjacentStrings literal = ParserTestCase.parse5("parseStringLiteral", "'a' ' b'", []);
2918 NodeList<StringLiteral> strings2 = literal.strings; 2917 NodeList<StringLiteral> strings2 = literal.strings;
2919 EngineTestCase.assertSize(2, strings2); 2918 EngineTestCase.assertSize(2, strings2);
2920 StringLiteral firstString = strings2[0]; 2919 StringLiteral firstString = strings2[0];
2921 StringLiteral secondString = strings2[1]; 2920 StringLiteral secondString = strings2[1];
2922 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value ); 2921 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value );
2923 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu e); 2922 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu e);
2924 } 2923 }
2925 void test_parseStringLiteral_interpolated() { 2924 void test_parseStringLiteral_interpolated() {
2926 StringInterpolation literal = ParserTestCase.parse6("parseStringLiteral", "' a \${b} c \$this d'", []); 2925 StringInterpolation literal = ParserTestCase.parse5("parseStringLiteral", "' a \${b} c \$this d'", []);
2927 NodeList<InterpolationElement> elements2 = literal.elements; 2926 NodeList<InterpolationElement> elements2 = literal.elements;
2928 EngineTestCase.assertSize(5, elements2); 2927 EngineTestCase.assertSize(5, elements2);
2929 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); 2928 JUnitTestCase.assertTrue(elements2[0] is InterpolationString);
2930 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); 2929 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression);
2931 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); 2930 JUnitTestCase.assertTrue(elements2[2] is InterpolationString);
2932 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); 2931 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression);
2933 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); 2932 JUnitTestCase.assertTrue(elements2[4] is InterpolationString);
2934 } 2933 }
2935 void test_parseStringLiteral_single() { 2934 void test_parseStringLiteral_single() {
2936 SimpleStringLiteral literal = ParserTestCase.parse6("parseStringLiteral", "' a'", []); 2935 SimpleStringLiteral literal = ParserTestCase.parse5("parseStringLiteral", "' a'", []);
2937 JUnitTestCase.assertNotNull(literal.literal); 2936 JUnitTestCase.assertNotNull(literal.literal);
2938 JUnitTestCase.assertEquals("a", literal.value); 2937 JUnitTestCase.assertEquals("a", literal.value);
2939 } 2938 }
2940 void test_parseSuperConstructorInvocation_named() { 2939 void test_parseSuperConstructorInvocation_named() {
2941 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon structorInvocation", "super.a()", []); 2940 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super.a()", []);
2942 JUnitTestCase.assertNotNull(invocation.argumentList); 2941 JUnitTestCase.assertNotNull(invocation.argumentList);
2943 JUnitTestCase.assertNotNull(invocation.constructorName); 2942 JUnitTestCase.assertNotNull(invocation.constructorName);
2944 JUnitTestCase.assertNotNull(invocation.keyword); 2943 JUnitTestCase.assertNotNull(invocation.keyword);
2945 JUnitTestCase.assertNotNull(invocation.period); 2944 JUnitTestCase.assertNotNull(invocation.period);
2946 } 2945 }
2947 void test_parseSuperConstructorInvocation_unnamed() { 2946 void test_parseSuperConstructorInvocation_unnamed() {
2948 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon structorInvocation", "super()", []); 2947 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super()", []);
2949 JUnitTestCase.assertNotNull(invocation.argumentList); 2948 JUnitTestCase.assertNotNull(invocation.argumentList);
2950 JUnitTestCase.assertNull(invocation.constructorName); 2949 JUnitTestCase.assertNull(invocation.constructorName);
2951 JUnitTestCase.assertNotNull(invocation.keyword); 2950 JUnitTestCase.assertNotNull(invocation.keyword);
2952 JUnitTestCase.assertNull(invocation.period); 2951 JUnitTestCase.assertNull(invocation.period);
2953 } 2952 }
2954 void test_parseSwitchStatement_case() { 2953 void test_parseSwitchStatement_case() {
2955 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s witch (a) {case 1: return 'I';}", []); 2954 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 1: return 'I';}", []);
2956 JUnitTestCase.assertNotNull(statement.keyword); 2955 JUnitTestCase.assertNotNull(statement.keyword);
2957 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2956 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2958 JUnitTestCase.assertNotNull(statement.expression); 2957 JUnitTestCase.assertNotNull(statement.expression);
2959 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2958 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2960 JUnitTestCase.assertNotNull(statement.leftBracket); 2959 JUnitTestCase.assertNotNull(statement.leftBracket);
2961 EngineTestCase.assertSize(1, statement.members); 2960 EngineTestCase.assertSize(1, statement.members);
2962 JUnitTestCase.assertNotNull(statement.rightBracket); 2961 JUnitTestCase.assertNotNull(statement.rightBracket);
2963 } 2962 }
2964 void test_parseSwitchStatement_empty() { 2963 void test_parseSwitchStatement_empty() {
2965 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s witch (a) {}", []); 2964 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {}", []);
2966 JUnitTestCase.assertNotNull(statement.keyword); 2965 JUnitTestCase.assertNotNull(statement.keyword);
2967 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2966 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2968 JUnitTestCase.assertNotNull(statement.expression); 2967 JUnitTestCase.assertNotNull(statement.expression);
2969 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2968 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2970 JUnitTestCase.assertNotNull(statement.leftBracket); 2969 JUnitTestCase.assertNotNull(statement.leftBracket);
2971 EngineTestCase.assertSize(0, statement.members); 2970 EngineTestCase.assertSize(0, statement.members);
2972 JUnitTestCase.assertNotNull(statement.rightBracket); 2971 JUnitTestCase.assertNotNull(statement.rightBracket);
2973 } 2972 }
2974 void test_parseSwitchStatement_labeledCase() { 2973 void test_parseSwitchStatement_labeledCase() {
2975 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s witch (a) {l1: l2: l3: case(1):}", []); 2974 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {l1: l2: l3: case(1):}", []);
2976 JUnitTestCase.assertNotNull(statement.keyword); 2975 JUnitTestCase.assertNotNull(statement.keyword);
2977 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2976 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2978 JUnitTestCase.assertNotNull(statement.expression); 2977 JUnitTestCase.assertNotNull(statement.expression);
2979 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2978 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2980 JUnitTestCase.assertNotNull(statement.leftBracket); 2979 JUnitTestCase.assertNotNull(statement.leftBracket);
2981 EngineTestCase.assertSize(1, statement.members); 2980 EngineTestCase.assertSize(1, statement.members);
2982 EngineTestCase.assertSize(3, statement.members[0].labels); 2981 EngineTestCase.assertSize(3, statement.members[0].labels);
2983 JUnitTestCase.assertNotNull(statement.rightBracket); 2982 JUnitTestCase.assertNotNull(statement.rightBracket);
2984 } 2983 }
2985 void test_parseSwitchStatement_labeledStatementInCase() { 2984 void test_parseSwitchStatement_labeledStatementInCase() {
2986 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s witch (a) {case 0: f(); l1: g(); break;}", []); 2985 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 0: f(); l1: g(); break;}", []);
2987 JUnitTestCase.assertNotNull(statement.keyword); 2986 JUnitTestCase.assertNotNull(statement.keyword);
2988 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2987 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2989 JUnitTestCase.assertNotNull(statement.expression); 2988 JUnitTestCase.assertNotNull(statement.expression);
2990 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2989 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2991 JUnitTestCase.assertNotNull(statement.leftBracket); 2990 JUnitTestCase.assertNotNull(statement.leftBracket);
2992 EngineTestCase.assertSize(1, statement.members); 2991 EngineTestCase.assertSize(1, statement.members);
2993 EngineTestCase.assertSize(3, statement.members[0].statements); 2992 EngineTestCase.assertSize(3, statement.members[0].statements);
2994 JUnitTestCase.assertNotNull(statement.rightBracket); 2993 JUnitTestCase.assertNotNull(statement.rightBracket);
2995 } 2994 }
2996 void test_parseThrowExpression_expression() { 2995 void test_parseThrowExpression() {
2997 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t hrow x;", []); 2996 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpression", " throw x;", []);
2998 JUnitTestCase.assertNotNull(statement.keyword); 2997 JUnitTestCase.assertNotNull(expression.keyword);
2999 JUnitTestCase.assertNotNull(statement.expression); 2998 JUnitTestCase.assertNotNull(expression.expression);
3000 } 2999 }
3001 void test_parseThrowExpression_noExpression() { 3000 void test_parseThrowExpressionWithoutCascade() {
3002 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t hrow;", []); 3001 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpressionWith outCascade", "throw x;", []);
3003 JUnitTestCase.assertNotNull(statement.keyword); 3002 JUnitTestCase.assertNotNull(expression.keyword);
3004 JUnitTestCase.assertNull(statement.expression); 3003 JUnitTestCase.assertNotNull(expression.expression);
3005 }
3006 void test_parseThrowExpressionWithoutCascade_expression() {
3007 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho utCascade", "throw x;", []);
3008 JUnitTestCase.assertNotNull(statement.keyword);
3009 JUnitTestCase.assertNotNull(statement.expression);
3010 }
3011 void test_parseThrowExpressionWithoutCascade_noExpression() {
3012 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho utCascade", "throw;", []);
3013 JUnitTestCase.assertNotNull(statement.keyword);
3014 JUnitTestCase.assertNull(statement.expression);
3015 } 3004 }
3016 void test_parseTryStatement_catch() { 3005 void test_parseTryStatement_catch() {
3017 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} catch (e) {}", []); 3006 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e) {}", []);
3018 JUnitTestCase.assertNotNull(statement.tryKeyword); 3007 JUnitTestCase.assertNotNull(statement.tryKeyword);
3019 JUnitTestCase.assertNotNull(statement.body); 3008 JUnitTestCase.assertNotNull(statement.body);
3020 NodeList<CatchClause> catchClauses2 = statement.catchClauses; 3009 NodeList<CatchClause> catchClauses2 = statement.catchClauses;
3021 EngineTestCase.assertSize(1, catchClauses2); 3010 EngineTestCase.assertSize(1, catchClauses2);
3022 CatchClause clause = catchClauses2[0]; 3011 CatchClause clause = catchClauses2[0];
3023 JUnitTestCase.assertNull(clause.onKeyword); 3012 JUnitTestCase.assertNull(clause.onKeyword);
3024 JUnitTestCase.assertNull(clause.exceptionType); 3013 JUnitTestCase.assertNull(clause.exceptionType);
3025 JUnitTestCase.assertNotNull(clause.catchKeyword); 3014 JUnitTestCase.assertNotNull(clause.catchKeyword);
3026 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3015 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3027 JUnitTestCase.assertNull(clause.comma); 3016 JUnitTestCase.assertNull(clause.comma);
3028 JUnitTestCase.assertNull(clause.stackTraceParameter); 3017 JUnitTestCase.assertNull(clause.stackTraceParameter);
3029 JUnitTestCase.assertNotNull(clause.body); 3018 JUnitTestCase.assertNotNull(clause.body);
3030 JUnitTestCase.assertNull(statement.finallyKeyword); 3019 JUnitTestCase.assertNull(statement.finallyKeyword);
3031 JUnitTestCase.assertNull(statement.finallyClause); 3020 JUnitTestCase.assertNull(statement.finallyClause);
3032 } 3021 }
3033 void test_parseTryStatement_catch_finally() { 3022 void test_parseTryStatement_catch_finally() {
3034 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} catch (e, s) {} finally {}", []); 3023 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e, s) {} finally {}", []);
3035 JUnitTestCase.assertNotNull(statement.tryKeyword); 3024 JUnitTestCase.assertNotNull(statement.tryKeyword);
3036 JUnitTestCase.assertNotNull(statement.body); 3025 JUnitTestCase.assertNotNull(statement.body);
3037 NodeList<CatchClause> catchClauses3 = statement.catchClauses; 3026 NodeList<CatchClause> catchClauses3 = statement.catchClauses;
3038 EngineTestCase.assertSize(1, catchClauses3); 3027 EngineTestCase.assertSize(1, catchClauses3);
3039 CatchClause clause = catchClauses3[0]; 3028 CatchClause clause = catchClauses3[0];
3040 JUnitTestCase.assertNull(clause.onKeyword); 3029 JUnitTestCase.assertNull(clause.onKeyword);
3041 JUnitTestCase.assertNull(clause.exceptionType); 3030 JUnitTestCase.assertNull(clause.exceptionType);
3042 JUnitTestCase.assertNotNull(clause.catchKeyword); 3031 JUnitTestCase.assertNotNull(clause.catchKeyword);
3043 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3032 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3044 JUnitTestCase.assertNotNull(clause.comma); 3033 JUnitTestCase.assertNotNull(clause.comma);
3045 JUnitTestCase.assertNotNull(clause.stackTraceParameter); 3034 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3046 JUnitTestCase.assertNotNull(clause.body); 3035 JUnitTestCase.assertNotNull(clause.body);
3047 JUnitTestCase.assertNotNull(statement.finallyKeyword); 3036 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3048 JUnitTestCase.assertNotNull(statement.finallyClause); 3037 JUnitTestCase.assertNotNull(statement.finallyClause);
3049 } 3038 }
3050 void test_parseTryStatement_finally() { 3039 void test_parseTryStatement_finally() {
3051 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} finally {}", []); 3040 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} finally {}", []);
3052 JUnitTestCase.assertNotNull(statement.tryKeyword); 3041 JUnitTestCase.assertNotNull(statement.tryKeyword);
3053 JUnitTestCase.assertNotNull(statement.body); 3042 JUnitTestCase.assertNotNull(statement.body);
3054 EngineTestCase.assertSize(0, statement.catchClauses); 3043 EngineTestCase.assertSize(0, statement.catchClauses);
3055 JUnitTestCase.assertNotNull(statement.finallyKeyword); 3044 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3056 JUnitTestCase.assertNotNull(statement.finallyClause); 3045 JUnitTestCase.assertNotNull(statement.finallyClause);
3057 } 3046 }
3058 void test_parseTryStatement_multiple() { 3047 void test_parseTryStatement_multiple() {
3059 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []); 3048 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []);
3060 JUnitTestCase.assertNotNull(statement.tryKeyword); 3049 JUnitTestCase.assertNotNull(statement.tryKeyword);
3061 JUnitTestCase.assertNotNull(statement.body); 3050 JUnitTestCase.assertNotNull(statement.body);
3062 EngineTestCase.assertSize(3, statement.catchClauses); 3051 EngineTestCase.assertSize(3, statement.catchClauses);
3063 JUnitTestCase.assertNull(statement.finallyKeyword); 3052 JUnitTestCase.assertNull(statement.finallyKeyword);
3064 JUnitTestCase.assertNull(statement.finallyClause); 3053 JUnitTestCase.assertNull(statement.finallyClause);
3065 } 3054 }
3066 void test_parseTryStatement_on() { 3055 void test_parseTryStatement_on() {
3067 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} on Error {}", []); 3056 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error {}", []);
3068 JUnitTestCase.assertNotNull(statement.tryKeyword); 3057 JUnitTestCase.assertNotNull(statement.tryKeyword);
3069 JUnitTestCase.assertNotNull(statement.body); 3058 JUnitTestCase.assertNotNull(statement.body);
3070 NodeList<CatchClause> catchClauses4 = statement.catchClauses; 3059 NodeList<CatchClause> catchClauses4 = statement.catchClauses;
3071 EngineTestCase.assertSize(1, catchClauses4); 3060 EngineTestCase.assertSize(1, catchClauses4);
3072 CatchClause clause = catchClauses4[0]; 3061 CatchClause clause = catchClauses4[0];
3073 JUnitTestCase.assertNotNull(clause.onKeyword); 3062 JUnitTestCase.assertNotNull(clause.onKeyword);
3074 JUnitTestCase.assertNotNull(clause.exceptionType); 3063 JUnitTestCase.assertNotNull(clause.exceptionType);
3075 JUnitTestCase.assertNull(clause.catchKeyword); 3064 JUnitTestCase.assertNull(clause.catchKeyword);
3076 JUnitTestCase.assertNull(clause.exceptionParameter); 3065 JUnitTestCase.assertNull(clause.exceptionParameter);
3077 JUnitTestCase.assertNull(clause.comma); 3066 JUnitTestCase.assertNull(clause.comma);
3078 JUnitTestCase.assertNull(clause.stackTraceParameter); 3067 JUnitTestCase.assertNull(clause.stackTraceParameter);
3079 JUnitTestCase.assertNotNull(clause.body); 3068 JUnitTestCase.assertNotNull(clause.body);
3080 JUnitTestCase.assertNull(statement.finallyKeyword); 3069 JUnitTestCase.assertNull(statement.finallyKeyword);
3081 JUnitTestCase.assertNull(statement.finallyClause); 3070 JUnitTestCase.assertNull(statement.finallyClause);
3082 } 3071 }
3083 void test_parseTryStatement_on_catch() { 3072 void test_parseTryStatement_on_catch() {
3084 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} on Error catch (e, s) {}", []); 3073 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {}", []);
3085 JUnitTestCase.assertNotNull(statement.tryKeyword); 3074 JUnitTestCase.assertNotNull(statement.tryKeyword);
3086 JUnitTestCase.assertNotNull(statement.body); 3075 JUnitTestCase.assertNotNull(statement.body);
3087 NodeList<CatchClause> catchClauses5 = statement.catchClauses; 3076 NodeList<CatchClause> catchClauses5 = statement.catchClauses;
3088 EngineTestCase.assertSize(1, catchClauses5); 3077 EngineTestCase.assertSize(1, catchClauses5);
3089 CatchClause clause = catchClauses5[0]; 3078 CatchClause clause = catchClauses5[0];
3090 JUnitTestCase.assertNotNull(clause.onKeyword); 3079 JUnitTestCase.assertNotNull(clause.onKeyword);
3091 JUnitTestCase.assertNotNull(clause.exceptionType); 3080 JUnitTestCase.assertNotNull(clause.exceptionType);
3092 JUnitTestCase.assertNotNull(clause.catchKeyword); 3081 JUnitTestCase.assertNotNull(clause.catchKeyword);
3093 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3082 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3094 JUnitTestCase.assertNotNull(clause.comma); 3083 JUnitTestCase.assertNotNull(clause.comma);
3095 JUnitTestCase.assertNotNull(clause.stackTraceParameter); 3084 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3096 JUnitTestCase.assertNotNull(clause.body); 3085 JUnitTestCase.assertNotNull(clause.body);
3097 JUnitTestCase.assertNull(statement.finallyKeyword); 3086 JUnitTestCase.assertNull(statement.finallyKeyword);
3098 JUnitTestCase.assertNull(statement.finallyClause); 3087 JUnitTestCase.assertNull(statement.finallyClause);
3099 } 3088 }
3100 void test_parseTryStatement_on_catch_finally() { 3089 void test_parseTryStatement_on_catch_finally() {
3101 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []); 3090 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []);
3102 JUnitTestCase.assertNotNull(statement.tryKeyword); 3091 JUnitTestCase.assertNotNull(statement.tryKeyword);
3103 JUnitTestCase.assertNotNull(statement.body); 3092 JUnitTestCase.assertNotNull(statement.body);
3104 NodeList<CatchClause> catchClauses6 = statement.catchClauses; 3093 NodeList<CatchClause> catchClauses6 = statement.catchClauses;
3105 EngineTestCase.assertSize(1, catchClauses6); 3094 EngineTestCase.assertSize(1, catchClauses6);
3106 CatchClause clause = catchClauses6[0]; 3095 CatchClause clause = catchClauses6[0];
3107 JUnitTestCase.assertNotNull(clause.onKeyword); 3096 JUnitTestCase.assertNotNull(clause.onKeyword);
3108 JUnitTestCase.assertNotNull(clause.exceptionType); 3097 JUnitTestCase.assertNotNull(clause.exceptionType);
3109 JUnitTestCase.assertNotNull(clause.catchKeyword); 3098 JUnitTestCase.assertNotNull(clause.catchKeyword);
3110 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3099 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3111 JUnitTestCase.assertNotNull(clause.comma); 3100 JUnitTestCase.assertNotNull(clause.comma);
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
3184 void test_parseTypeAlias_function_voidReturnType() { 3173 void test_parseTypeAlias_function_voidReturnType() {
3185 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef void F();"); 3174 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef void F();");
3186 JUnitTestCase.assertNotNull(typeAlias.keyword); 3175 JUnitTestCase.assertNotNull(typeAlias.keyword);
3187 JUnitTestCase.assertNotNull(typeAlias.name); 3176 JUnitTestCase.assertNotNull(typeAlias.name);
3188 JUnitTestCase.assertNotNull(typeAlias.parameters); 3177 JUnitTestCase.assertNotNull(typeAlias.parameters);
3189 JUnitTestCase.assertNotNull(typeAlias.returnType); 3178 JUnitTestCase.assertNotNull(typeAlias.returnType);
3190 JUnitTestCase.assertNotNull(typeAlias.semicolon); 3179 JUnitTestCase.assertNotNull(typeAlias.semicolon);
3191 JUnitTestCase.assertNull(typeAlias.typeParameters); 3180 JUnitTestCase.assertNull(typeAlias.typeParameters);
3192 } 3181 }
3193 void test_parseTypeArgumentList_multiple() { 3182 void test_parseTypeArgumentList_multiple() {
3194 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList ", "<int, int, int>", []); 3183 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int, int, int>", []);
3195 JUnitTestCase.assertNotNull(argumentList.leftBracket); 3184 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3196 EngineTestCase.assertSize(3, argumentList.arguments); 3185 EngineTestCase.assertSize(3, argumentList.arguments);
3197 JUnitTestCase.assertNotNull(argumentList.rightBracket); 3186 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3198 } 3187 }
3199 void test_parseTypeArgumentList_nested() { 3188 void test_parseTypeArgumentList_nested() {
3200 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList ", "<A<B>>", []); 3189 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<A<B>>", []);
3201 JUnitTestCase.assertNotNull(argumentList.leftBracket); 3190 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3202 EngineTestCase.assertSize(1, argumentList.arguments); 3191 EngineTestCase.assertSize(1, argumentList.arguments);
3203 TypeName argument = argumentList.arguments[0]; 3192 TypeName argument = argumentList.arguments[0];
3204 JUnitTestCase.assertNotNull(argument); 3193 JUnitTestCase.assertNotNull(argument);
3205 TypeArgumentList innerList = argument.typeArguments; 3194 TypeArgumentList innerList = argument.typeArguments;
3206 JUnitTestCase.assertNotNull(innerList); 3195 JUnitTestCase.assertNotNull(innerList);
3207 EngineTestCase.assertSize(1, innerList.arguments); 3196 EngineTestCase.assertSize(1, innerList.arguments);
3208 JUnitTestCase.assertNotNull(argumentList.rightBracket); 3197 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3209 } 3198 }
3210 void test_parseTypeArgumentList_single() { 3199 void test_parseTypeArgumentList_single() {
3211 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList ", "<int>", []); 3200 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int>", []);
3212 JUnitTestCase.assertNotNull(argumentList.leftBracket); 3201 JUnitTestCase.assertNotNull(argumentList.leftBracket);
3213 EngineTestCase.assertSize(1, argumentList.arguments); 3202 EngineTestCase.assertSize(1, argumentList.arguments);
3214 JUnitTestCase.assertNotNull(argumentList.rightBracket); 3203 JUnitTestCase.assertNotNull(argumentList.rightBracket);
3215 } 3204 }
3216 void test_parseTypeName_parameterized() { 3205 void test_parseTypeName_parameterized() {
3217 TypeName typeName = ParserTestCase.parse6("parseTypeName", "List<int>", []); 3206 TypeName typeName = ParserTestCase.parse5("parseTypeName", "List<int>", []);
3218 JUnitTestCase.assertNotNull(typeName.name); 3207 JUnitTestCase.assertNotNull(typeName.name);
3219 JUnitTestCase.assertNotNull(typeName.typeArguments); 3208 JUnitTestCase.assertNotNull(typeName.typeArguments);
3220 } 3209 }
3221 void test_parseTypeName_simple() { 3210 void test_parseTypeName_simple() {
3222 TypeName typeName = ParserTestCase.parse6("parseTypeName", "int", []); 3211 TypeName typeName = ParserTestCase.parse5("parseTypeName", "int", []);
3223 JUnitTestCase.assertNotNull(typeName.name); 3212 JUnitTestCase.assertNotNull(typeName.name);
3224 JUnitTestCase.assertNull(typeName.typeArguments); 3213 JUnitTestCase.assertNull(typeName.typeArguments);
3225 } 3214 }
3226 void test_parseTypeParameter_bounded() { 3215 void test_parseTypeParameter_bounded() {
3227 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A ext ends B", []); 3216 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A ext ends B", []);
3228 JUnitTestCase.assertNotNull(parameter.bound); 3217 JUnitTestCase.assertNotNull(parameter.bound);
3229 JUnitTestCase.assertNotNull(parameter.keyword); 3218 JUnitTestCase.assertNotNull(parameter.keyword);
3230 JUnitTestCase.assertNotNull(parameter.name); 3219 JUnitTestCase.assertNotNull(parameter.name);
3231 } 3220 }
3232 void test_parseTypeParameter_simple() { 3221 void test_parseTypeParameter_simple() {
3233 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A", [ ]); 3222 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A", [ ]);
3234 JUnitTestCase.assertNull(parameter.bound); 3223 JUnitTestCase.assertNull(parameter.bound);
3235 JUnitTestCase.assertNull(parameter.keyword); 3224 JUnitTestCase.assertNull(parameter.keyword);
3236 JUnitTestCase.assertNotNull(parameter.name); 3225 JUnitTestCase.assertNotNull(parameter.name);
3237 } 3226 }
3238 void test_parseTypeParameterList_multiple() { 3227 void test_parseTypeParameterList_multiple() {
3239 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL ist", "<A, B extends C, D>", []); 3228 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A, B extends C, D>", []);
3240 JUnitTestCase.assertNotNull(parameterList.leftBracket); 3229 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3241 JUnitTestCase.assertNotNull(parameterList.rightBracket); 3230 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3242 EngineTestCase.assertSize(3, parameterList.typeParameters); 3231 EngineTestCase.assertSize(3, parameterList.typeParameters);
3243 } 3232 }
3244 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { 3233 void test_parseTypeParameterList_parameterizedWithTrailingEquals() {
3245 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL ist", "<A extends B<E>>=", []); 3234 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A extends B<E>>=", []);
3246 JUnitTestCase.assertNotNull(parameterList.leftBracket); 3235 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3247 JUnitTestCase.assertNotNull(parameterList.rightBracket); 3236 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3248 EngineTestCase.assertSize(1, parameterList.typeParameters); 3237 EngineTestCase.assertSize(1, parameterList.typeParameters);
3249 } 3238 }
3250 void test_parseTypeParameterList_single() { 3239 void test_parseTypeParameterList_single() {
3251 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL ist", "<A>", []); 3240 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>", []);
3252 JUnitTestCase.assertNotNull(parameterList.leftBracket); 3241 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3253 JUnitTestCase.assertNotNull(parameterList.rightBracket); 3242 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3254 EngineTestCase.assertSize(1, parameterList.typeParameters); 3243 EngineTestCase.assertSize(1, parameterList.typeParameters);
3255 } 3244 }
3256 void test_parseTypeParameterList_withTrailingEquals() { 3245 void test_parseTypeParameterList_withTrailingEquals() {
3257 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL ist", "<A>=", []); 3246 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>=", []);
3258 JUnitTestCase.assertNotNull(parameterList.leftBracket); 3247 JUnitTestCase.assertNotNull(parameterList.leftBracket);
3259 JUnitTestCase.assertNotNull(parameterList.rightBracket); 3248 JUnitTestCase.assertNotNull(parameterList.rightBracket);
3260 EngineTestCase.assertSize(1, parameterList.typeParameters); 3249 EngineTestCase.assertSize(1, parameterList.typeParameters);
3261 } 3250 }
3262 void test_parseUnaryExpression_decrement_normal() { 3251 void test_parseUnaryExpression_decrement_normal() {
3263 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "--x", []); 3252 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--x", []);
3264 JUnitTestCase.assertNotNull(expression.operator); 3253 JUnitTestCase.assertNotNull(expression.operator);
3265 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); 3254 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
3266 JUnitTestCase.assertNotNull(expression.operand); 3255 JUnitTestCase.assertNotNull(expression.operand);
3267 } 3256 }
3268 void test_parseUnaryExpression_decrement_super() { 3257 void test_parseUnaryExpression_decrement_super() {
3269 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "--super", []); 3258 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super", []);
3270 JUnitTestCase.assertNotNull(expression.operator); 3259 JUnitTestCase.assertNotNull(expression.operator);
3271 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 3260 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3272 Expression innerExpression = expression.operand; 3261 Expression innerExpression = expression.operand;
3273 JUnitTestCase.assertNotNull(innerExpression); 3262 JUnitTestCase.assertNotNull(innerExpression);
3274 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); 3263 JUnitTestCase.assertTrue(innerExpression is PrefixExpression);
3275 PrefixExpression operand = innerExpression as PrefixExpression; 3264 PrefixExpression operand = innerExpression as PrefixExpression;
3276 JUnitTestCase.assertNotNull(operand.operator); 3265 JUnitTestCase.assertNotNull(operand.operator);
3277 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); 3266 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type);
3278 JUnitTestCase.assertNotNull(operand.operand); 3267 JUnitTestCase.assertNotNull(operand.operand);
3279 } 3268 }
3269 void test_parseUnaryExpression_decrement_super_propertyAccess() {
3270 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super.x", []);
3271 JUnitTestCase.assertNotNull(expression.operator);
3272 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
3273 JUnitTestCase.assertNotNull(expression.operand);
3274 PropertyAccess operand4 = expression.operand as PropertyAccess;
3275 JUnitTestCase.assertTrue(operand4.target is SuperExpression);
3276 JUnitTestCase.assertEquals("x", operand4.propertyName.name);
3277 }
3280 void test_parseUnaryExpression_increment_normal() { 3278 void test_parseUnaryExpression_increment_normal() {
3281 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "++x", []); 3279 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++x", []);
3282 JUnitTestCase.assertNotNull(expression.operator); 3280 JUnitTestCase.assertNotNull(expression.operator);
3283 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 3281 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3284 JUnitTestCase.assertNotNull(expression.operand); 3282 JUnitTestCase.assertNotNull(expression.operand);
3285 } 3283 }
3284 void test_parseUnaryExpression_increment_super_index() {
3285 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super[0]", []);
3286 JUnitTestCase.assertNotNull(expression.operator);
3287 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3288 JUnitTestCase.assertNotNull(expression.operand);
3289 IndexExpression operand5 = expression.operand as IndexExpression;
3290 JUnitTestCase.assertTrue(operand5.realTarget is SuperExpression);
3291 JUnitTestCase.assertTrue(operand5.index is IntegerLiteral);
3292 }
3293 void test_parseUnaryExpression_increment_super_propertyAccess() {
3294 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super.x", []);
3295 JUnitTestCase.assertNotNull(expression.operator);
3296 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3297 JUnitTestCase.assertNotNull(expression.operand);
3298 PropertyAccess operand6 = expression.operand as PropertyAccess;
3299 JUnitTestCase.assertTrue(operand6.target is SuperExpression);
3300 JUnitTestCase.assertEquals("x", operand6.propertyName.name);
3301 }
3286 void test_parseUnaryExpression_minus_normal() { 3302 void test_parseUnaryExpression_minus_normal() {
3287 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "-x", []); 3303 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-x", []);
3288 JUnitTestCase.assertNotNull(expression.operator); 3304 JUnitTestCase.assertNotNull(expression.operator);
3289 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 3305 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3290 JUnitTestCase.assertNotNull(expression.operand); 3306 JUnitTestCase.assertNotNull(expression.operand);
3291 } 3307 }
3292 void test_parseUnaryExpression_minus_super() { 3308 void test_parseUnaryExpression_minus_super() {
3293 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "-super", []); 3309 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-super", []);
3294 JUnitTestCase.assertNotNull(expression.operator); 3310 JUnitTestCase.assertNotNull(expression.operator);
3295 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 3311 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
3296 JUnitTestCase.assertNotNull(expression.operand); 3312 JUnitTestCase.assertNotNull(expression.operand);
3297 } 3313 }
3298 void test_parseUnaryExpression_not_normal() { 3314 void test_parseUnaryExpression_not_normal() {
3299 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "!x", []); 3315 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!x", []);
3300 JUnitTestCase.assertNotNull(expression.operator); 3316 JUnitTestCase.assertNotNull(expression.operator);
3301 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); 3317 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
3302 JUnitTestCase.assertNotNull(expression.operand); 3318 JUnitTestCase.assertNotNull(expression.operand);
3303 } 3319 }
3304 void test_parseUnaryExpression_not_super() { 3320 void test_parseUnaryExpression_not_super() {
3305 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "!super", []); 3321 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!super", []);
3306 JUnitTestCase.assertNotNull(expression.operator); 3322 JUnitTestCase.assertNotNull(expression.operator);
3307 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); 3323 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
3308 JUnitTestCase.assertNotNull(expression.operand); 3324 JUnitTestCase.assertNotNull(expression.operand);
3309 } 3325 }
3310 void test_parseUnaryExpression_tilda_normal() { 3326 void test_parseUnaryExpression_tilda_normal() {
3311 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "~x", []); 3327 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~x", []);
3312 JUnitTestCase.assertNotNull(expression.operator); 3328 JUnitTestCase.assertNotNull(expression.operator);
3313 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); 3329 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
3314 JUnitTestCase.assertNotNull(expression.operand); 3330 JUnitTestCase.assertNotNull(expression.operand);
3315 } 3331 }
3316 void test_parseUnaryExpression_tilda_super() { 3332 void test_parseUnaryExpression_tilda_super() {
3317 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression", "~super", []); 3333 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~super", []);
3318 JUnitTestCase.assertNotNull(expression.operator); 3334 JUnitTestCase.assertNotNull(expression.operator);
3319 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); 3335 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
3320 JUnitTestCase.assertNotNull(expression.operand); 3336 JUnitTestCase.assertNotNull(expression.operand);
3321 } 3337 }
3322 void test_parseVariableDeclaration_equals() { 3338 void test_parseVariableDeclaration_equals() {
3323 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar ation", "a = b", []); 3339 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a = b", []);
3324 JUnitTestCase.assertNotNull(declaration.name); 3340 JUnitTestCase.assertNotNull(declaration.name);
3325 JUnitTestCase.assertNotNull(declaration.equals); 3341 JUnitTestCase.assertNotNull(declaration.equals);
3326 JUnitTestCase.assertNotNull(declaration.initializer); 3342 JUnitTestCase.assertNotNull(declaration.initializer);
3327 } 3343 }
3328 void test_parseVariableDeclaration_noEquals() { 3344 void test_parseVariableDeclaration_noEquals() {
3329 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar ation", "a", []); 3345 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a", []);
3330 JUnitTestCase.assertNotNull(declaration.name); 3346 JUnitTestCase.assertNotNull(declaration.name);
3331 JUnitTestCase.assertNull(declaration.equals); 3347 JUnitTestCase.assertNull(declaration.equals);
3332 JUnitTestCase.assertNull(declaration.initializer); 3348 JUnitTestCase.assertNull(declaration.initializer);
3333 } 3349 }
3334 void test_parseVariableDeclarationList_const_noType() { 3350 void test_parseVariableDeclarationList_const_noType() {
3335 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "const a", []); 3351 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const a");
3336 JUnitTestCase.assertNotNull(declarationList.keyword); 3352 JUnitTestCase.assertNotNull(declarationList.keyword);
3337 JUnitTestCase.assertNull(declarationList.type); 3353 JUnitTestCase.assertNull(declarationList.type);
3338 EngineTestCase.assertSize(1, declarationList.variables); 3354 EngineTestCase.assertSize(1, declarationList.variables);
3339 } 3355 }
3340 void test_parseVariableDeclarationList_const_type() { 3356 void test_parseVariableDeclarationList_const_type() {
3341 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "const A a", []); 3357 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const A a");
3342 JUnitTestCase.assertNotNull(declarationList.keyword); 3358 JUnitTestCase.assertNotNull(declarationList.keyword);
3343 JUnitTestCase.assertNotNull(declarationList.type); 3359 JUnitTestCase.assertNotNull(declarationList.type);
3344 EngineTestCase.assertSize(1, declarationList.variables); 3360 EngineTestCase.assertSize(1, declarationList.variables);
3345 } 3361 }
3346 void test_parseVariableDeclarationList_final_noType() { 3362 void test_parseVariableDeclarationList_final_noType() {
3347 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "final a", []); 3363 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "final a");
3348 JUnitTestCase.assertNotNull(declarationList.keyword); 3364 JUnitTestCase.assertNotNull(declarationList.keyword);
3349 JUnitTestCase.assertNull(declarationList.type); 3365 JUnitTestCase.assertNull(declarationList.type);
3350 EngineTestCase.assertSize(1, declarationList.variables); 3366 EngineTestCase.assertSize(1, declarationList.variables);
3351 } 3367 }
3352 void test_parseVariableDeclarationList_final_type() { 3368 void test_parseVariableDeclarationList_final_type() {
3353 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "final A a", []); 3369 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "final A a");
3354 JUnitTestCase.assertNotNull(declarationList.keyword); 3370 JUnitTestCase.assertNotNull(declarationList.keyword);
3355 JUnitTestCase.assertNotNull(declarationList.type); 3371 JUnitTestCase.assertNotNull(declarationList.type);
3356 EngineTestCase.assertSize(1, declarationList.variables); 3372 EngineTestCase.assertSize(1, declarationList.variables);
3357 } 3373 }
3358 void test_parseVariableDeclarationList_type_multiple() { 3374 void test_parseVariableDeclarationList_type_multiple() {
3359 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "A a, b, c", []); 3375 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "A a, b, c");
3360 JUnitTestCase.assertNull(declarationList.keyword); 3376 JUnitTestCase.assertNull(declarationList.keyword);
3361 JUnitTestCase.assertNotNull(declarationList.type); 3377 JUnitTestCase.assertNotNull(declarationList.type);
3362 EngineTestCase.assertSize(3, declarationList.variables); 3378 EngineTestCase.assertSize(3, declarationList.variables);
3363 } 3379 }
3364 void test_parseVariableDeclarationList_type_single() { 3380 void test_parseVariableDeclarationList_type_single() {
3365 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "A a", []); 3381 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "A a");
3366 JUnitTestCase.assertNull(declarationList.keyword); 3382 JUnitTestCase.assertNull(declarationList.keyword);
3367 JUnitTestCase.assertNotNull(declarationList.type); 3383 JUnitTestCase.assertNotNull(declarationList.type);
3368 EngineTestCase.assertSize(1, declarationList.variables); 3384 EngineTestCase.assertSize(1, declarationList.variables);
3369 } 3385 }
3370 void test_parseVariableDeclarationList_var_multiple() { 3386 void test_parseVariableDeclarationList_var_multiple() {
3371 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "var a, b, c", []); 3387 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "var a, b, c");
3372 JUnitTestCase.assertNotNull(declarationList.keyword); 3388 JUnitTestCase.assertNotNull(declarationList.keyword);
3373 JUnitTestCase.assertNull(declarationList.type); 3389 JUnitTestCase.assertNull(declarationList.type);
3374 EngineTestCase.assertSize(3, declarationList.variables); 3390 EngineTestCase.assertSize(3, declarationList.variables);
3375 } 3391 }
3376 void test_parseVariableDeclarationList_var_single() { 3392 void test_parseVariableDeclarationList_var_single() {
3377 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab leDeclarationList", "var a", []); 3393 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "var a");
3378 JUnitTestCase.assertNotNull(declarationList.keyword); 3394 JUnitTestCase.assertNotNull(declarationList.keyword);
3379 JUnitTestCase.assertNull(declarationList.type); 3395 JUnitTestCase.assertNull(declarationList.type);
3380 EngineTestCase.assertSize(1, declarationList.variables); 3396 EngineTestCase.assertSize(1, declarationList.variables);
3381 } 3397 }
3382 void test_parseVariableDeclarationList2_type() { 3398 void test_parseVariableDeclarationList2_type() {
3383 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); 3399 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null);
3384 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [null, type], "a"); 3400 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata(), null, type], "a");
3385 JUnitTestCase.assertNull(declarationList.keyword); 3401 JUnitTestCase.assertNull(declarationList.keyword);
3386 JUnitTestCase.assertEquals(type, declarationList.type); 3402 JUnitTestCase.assertEquals(type, declarationList.type);
3387 EngineTestCase.assertSize(1, declarationList.variables); 3403 EngineTestCase.assertSize(1, declarationList.variables);
3388 } 3404 }
3389 void test_parseVariableDeclarationList2_var() { 3405 void test_parseVariableDeclarationList2_var() {
3390 Token keyword = TokenFactory.token(Keyword.VAR); 3406 Token keyword = TokenFactory.token(Keyword.VAR);
3391 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [keyword, null], "a, b, c"); 3407 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata(), keyword, null], "a, b, c ");
3392 JUnitTestCase.assertEquals(keyword, declarationList.keyword); 3408 JUnitTestCase.assertEquals(keyword, declarationList.keyword);
3393 JUnitTestCase.assertNull(declarationList.type); 3409 JUnitTestCase.assertNull(declarationList.type);
3394 EngineTestCase.assertSize(3, declarationList.variables); 3410 EngineTestCase.assertSize(3, declarationList.variables);
3395 } 3411 }
3396 void test_parseVariableDeclarationStatement_multiple() { 3412 void test_parseVariableDeclarationStatement_multiple() {
3397 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl eDeclarationStatement", "var x, y, z;", []); 3413 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x, y, z;");
3398 JUnitTestCase.assertNotNull(statement.semicolon); 3414 JUnitTestCase.assertNotNull(statement.semicolon);
3399 VariableDeclarationList variableList = statement.variables; 3415 VariableDeclarationList variableList = statement.variables;
3400 JUnitTestCase.assertNotNull(variableList); 3416 JUnitTestCase.assertNotNull(variableList);
3401 EngineTestCase.assertSize(3, variableList.variables); 3417 EngineTestCase.assertSize(3, variableList.variables);
3402 } 3418 }
3403 void test_parseVariableDeclarationStatement_single() { 3419 void test_parseVariableDeclarationStatement_single() {
3404 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl eDeclarationStatement", "var x;", []); 3420 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x;");
3405 JUnitTestCase.assertNotNull(statement.semicolon); 3421 JUnitTestCase.assertNotNull(statement.semicolon);
3406 VariableDeclarationList variableList = statement.variables; 3422 VariableDeclarationList variableList = statement.variables;
3407 JUnitTestCase.assertNotNull(variableList); 3423 JUnitTestCase.assertNotNull(variableList);
3408 EngineTestCase.assertSize(1, variableList.variables); 3424 EngineTestCase.assertSize(1, variableList.variables);
3409 } 3425 }
3410 void test_parseWhileStatement() { 3426 void test_parseWhileStatement() {
3411 WhileStatement statement = ParserTestCase.parse6("parseWhileStatement", "whi le (x) {}", []); 3427 WhileStatement statement = ParserTestCase.parse5("parseWhileStatement", "whi le (x) {}", []);
3412 JUnitTestCase.assertNotNull(statement.keyword); 3428 JUnitTestCase.assertNotNull(statement.keyword);
3413 JUnitTestCase.assertNotNull(statement.leftParenthesis); 3429 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3414 JUnitTestCase.assertNotNull(statement.condition); 3430 JUnitTestCase.assertNotNull(statement.condition);
3415 JUnitTestCase.assertNotNull(statement.rightParenthesis); 3431 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3416 JUnitTestCase.assertNotNull(statement.body); 3432 JUnitTestCase.assertNotNull(statement.body);
3417 } 3433 }
3418 void test_parseWithClause_multiple() { 3434 void test_parseWithClause_multiple() {
3419 WithClause clause = ParserTestCase.parse6("parseWithClause", "with A, B, C", []); 3435 WithClause clause = ParserTestCase.parse5("parseWithClause", "with A, B, C", []);
3420 JUnitTestCase.assertNotNull(clause.withKeyword); 3436 JUnitTestCase.assertNotNull(clause.withKeyword);
3421 EngineTestCase.assertSize(3, clause.mixinTypes); 3437 EngineTestCase.assertSize(3, clause.mixinTypes);
3422 } 3438 }
3423 void test_parseWithClause_single() { 3439 void test_parseWithClause_single() {
3424 WithClause clause = ParserTestCase.parse6("parseWithClause", "with M", []); 3440 WithClause clause = ParserTestCase.parse5("parseWithClause", "with M", []);
3425 JUnitTestCase.assertNotNull(clause.withKeyword); 3441 JUnitTestCase.assertNotNull(clause.withKeyword);
3426 EngineTestCase.assertSize(1, clause.mixinTypes); 3442 EngineTestCase.assertSize(1, clause.mixinTypes);
3427 } 3443 }
3428 void test_skipPrefixedIdentifier_invalid() { 3444 void test_skipPrefixedIdentifier_invalid() {
3429 Token following = skip("skipPrefixedIdentifier", "+"); 3445 Token following = skip("skipPrefixedIdentifier", "+");
3430 JUnitTestCase.assertNull(following); 3446 JUnitTestCase.assertNull(following);
3431 } 3447 }
3432 void test_skipPrefixedIdentifier_notPrefixed() { 3448 void test_skipPrefixedIdentifier_notPrefixed() {
3433 Token following = skip("skipPrefixedIdentifier", "a +"); 3449 Token following = skip("skipPrefixedIdentifier", "a +");
3434 JUnitTestCase.assertNotNull(following); 3450 JUnitTestCase.assertNotNull(following);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 JUnitTestCase.assertNotNull(following); 3530 JUnitTestCase.assertNotNull(following);
3515 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); 3531 JUnitTestCase.assertEquals(TokenType.PLUS, following.type);
3516 } 3532 }
3517 /** 3533 /**
3518 * Invoke the method {@link Parser#computeStringValue(String)} with the given argument. 3534 * Invoke the method {@link Parser#computeStringValue(String)} with the given argument.
3519 * @param lexeme the argument to the method 3535 * @param lexeme the argument to the method
3520 * @return the result of invoking the method 3536 * @return the result of invoking the method
3521 * @throws Exception if the method could not be invoked or throws an exception 3537 * @throws Exception if the method could not be invoked or throws an exception
3522 */ 3538 */
3523 String computeStringValue(String lexeme) { 3539 String computeStringValue(String lexeme) {
3524 AnalysisErrorListener listener = new AnalysisErrorListener_13(); 3540 AnalysisErrorListener listener = new AnalysisErrorListener_15();
3525 Parser parser = new Parser(null, listener); 3541 Parser parser = new Parser(null, listener);
3526 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme ], null) as String; 3542 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme ], null) as String;
3527 } 3543 }
3528 /** 3544 /**
3529 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse r set to the token 3545 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse r set to the token
3530 * stream produced by scanning the given source. 3546 * stream produced by scanning the given source.
3531 * @param source the source to be scanned to produce the token stream being te sted 3547 * @param source the source to be scanned to produce the token stream being te sted
3532 * @return the result of invoking the method 3548 * @return the result of invoking the method
3533 * @throws Exception if the method could not be invoked or throws an exception 3549 * @throws Exception if the method could not be invoked or throws an exception
3534 */ 3550 */
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
4409 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_prefixed); 4425 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_prefixed);
4410 }); 4426 });
4411 _ut.test('test_parseContinueStatement_label', () { 4427 _ut.test('test_parseContinueStatement_label', () {
4412 final __test = new SimpleParserTest(); 4428 final __test = new SimpleParserTest();
4413 runJUnitTest(__test, __test.test_parseContinueStatement_label); 4429 runJUnitTest(__test, __test.test_parseContinueStatement_label);
4414 }); 4430 });
4415 _ut.test('test_parseContinueStatement_noLabel', () { 4431 _ut.test('test_parseContinueStatement_noLabel', () {
4416 final __test = new SimpleParserTest(); 4432 final __test = new SimpleParserTest();
4417 runJUnitTest(__test, __test.test_parseContinueStatement_noLabel); 4433 runJUnitTest(__test, __test.test_parseContinueStatement_noLabel);
4418 }); 4434 });
4419 _ut.test('test_parseDeclaredIdentifier_const', () {
4420 final __test = new SimpleParserTest();
4421 runJUnitTest(__test, __test.test_parseDeclaredIdentifier_const);
4422 });
4423 _ut.test('test_parseDeclaredIdentifier_final', () {
4424 final __test = new SimpleParserTest();
4425 runJUnitTest(__test, __test.test_parseDeclaredIdentifier_final);
4426 });
4427 _ut.test('test_parseDeclaredIdentifier_type', () {
4428 final __test = new SimpleParserTest();
4429 runJUnitTest(__test, __test.test_parseDeclaredIdentifier_type);
4430 });
4431 _ut.test('test_parseDeclaredIdentifier_var', () {
4432 final __test = new SimpleParserTest();
4433 runJUnitTest(__test, __test.test_parseDeclaredIdentifier_var);
4434 });
4435 _ut.test('test_parseDirective_export', () { 4435 _ut.test('test_parseDirective_export', () {
4436 final __test = new SimpleParserTest(); 4436 final __test = new SimpleParserTest();
4437 runJUnitTest(__test, __test.test_parseDirective_export); 4437 runJUnitTest(__test, __test.test_parseDirective_export);
4438 }); 4438 });
4439 _ut.test('test_parseDirective_import', () { 4439 _ut.test('test_parseDirective_import', () {
4440 final __test = new SimpleParserTest(); 4440 final __test = new SimpleParserTest();
4441 runJUnitTest(__test, __test.test_parseDirective_import); 4441 runJUnitTest(__test, __test.test_parseDirective_import);
4442 }); 4442 });
4443 _ut.test('test_parseDirective_library', () { 4443 _ut.test('test_parseDirective_library', () {
4444 final __test = new SimpleParserTest(); 4444 final __test = new SimpleParserTest();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
4601 runJUnitTest(__test, __test.test_parseForStatement_loop_cu); 4601 runJUnitTest(__test, __test.test_parseForStatement_loop_cu);
4602 }); 4602 });
4603 _ut.test('test_parseForStatement_loop_ecu', () { 4603 _ut.test('test_parseForStatement_loop_ecu', () {
4604 final __test = new SimpleParserTest(); 4604 final __test = new SimpleParserTest();
4605 runJUnitTest(__test, __test.test_parseForStatement_loop_ecu); 4605 runJUnitTest(__test, __test.test_parseForStatement_loop_ecu);
4606 }); 4606 });
4607 _ut.test('test_parseForStatement_loop_i', () { 4607 _ut.test('test_parseForStatement_loop_i', () {
4608 final __test = new SimpleParserTest(); 4608 final __test = new SimpleParserTest();
4609 runJUnitTest(__test, __test.test_parseForStatement_loop_i); 4609 runJUnitTest(__test, __test.test_parseForStatement_loop_i);
4610 }); 4610 });
4611 _ut.test('test_parseForStatement_loop_i_withMetadata', () {
4612 final __test = new SimpleParserTest();
4613 runJUnitTest(__test, __test.test_parseForStatement_loop_i_withMetadata);
4614 });
4611 _ut.test('test_parseForStatement_loop_ic', () { 4615 _ut.test('test_parseForStatement_loop_ic', () {
4612 final __test = new SimpleParserTest(); 4616 final __test = new SimpleParserTest();
4613 runJUnitTest(__test, __test.test_parseForStatement_loop_ic); 4617 runJUnitTest(__test, __test.test_parseForStatement_loop_ic);
4614 }); 4618 });
4615 _ut.test('test_parseForStatement_loop_icu', () { 4619 _ut.test('test_parseForStatement_loop_icu', () {
4616 final __test = new SimpleParserTest(); 4620 final __test = new SimpleParserTest();
4617 runJUnitTest(__test, __test.test_parseForStatement_loop_icu); 4621 runJUnitTest(__test, __test.test_parseForStatement_loop_icu);
4618 }); 4622 });
4619 _ut.test('test_parseForStatement_loop_iicuu', () { 4623 _ut.test('test_parseForStatement_loop_iicuu', () {
4620 final __test = new SimpleParserTest(); 4624 final __test = new SimpleParserTest();
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
5213 runJUnitTest(__test, __test.test_parseRelationalExpression_isNot); 5217 runJUnitTest(__test, __test.test_parseRelationalExpression_isNot);
5214 }); 5218 });
5215 _ut.test('test_parseRelationalExpression_normal', () { 5219 _ut.test('test_parseRelationalExpression_normal', () {
5216 final __test = new SimpleParserTest(); 5220 final __test = new SimpleParserTest();
5217 runJUnitTest(__test, __test.test_parseRelationalExpression_normal); 5221 runJUnitTest(__test, __test.test_parseRelationalExpression_normal);
5218 }); 5222 });
5219 _ut.test('test_parseRelationalExpression_super', () { 5223 _ut.test('test_parseRelationalExpression_super', () {
5220 final __test = new SimpleParserTest(); 5224 final __test = new SimpleParserTest();
5221 runJUnitTest(__test, __test.test_parseRelationalExpression_super); 5225 runJUnitTest(__test, __test.test_parseRelationalExpression_super);
5222 }); 5226 });
5227 _ut.test('test_parseRethrowExpression', () {
5228 final __test = new SimpleParserTest();
5229 runJUnitTest(__test, __test.test_parseRethrowExpression);
5230 });
5223 _ut.test('test_parseReturnStatement_noValue', () { 5231 _ut.test('test_parseReturnStatement_noValue', () {
5224 final __test = new SimpleParserTest(); 5232 final __test = new SimpleParserTest();
5225 runJUnitTest(__test, __test.test_parseReturnStatement_noValue); 5233 runJUnitTest(__test, __test.test_parseReturnStatement_noValue);
5226 }); 5234 });
5227 _ut.test('test_parseReturnStatement_value', () { 5235 _ut.test('test_parseReturnStatement_value', () {
5228 final __test = new SimpleParserTest(); 5236 final __test = new SimpleParserTest();
5229 runJUnitTest(__test, __test.test_parseReturnStatement_value); 5237 runJUnitTest(__test, __test.test_parseReturnStatement_value);
5230 }); 5238 });
5231 _ut.test('test_parseReturnType_nonVoid', () { 5239 _ut.test('test_parseReturnType_nonVoid', () {
5232 final __test = new SimpleParserTest(); 5240 final __test = new SimpleParserTest();
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
5317 runJUnitTest(__test, __test.test_parseSwitchStatement_empty); 5325 runJUnitTest(__test, __test.test_parseSwitchStatement_empty);
5318 }); 5326 });
5319 _ut.test('test_parseSwitchStatement_labeledCase', () { 5327 _ut.test('test_parseSwitchStatement_labeledCase', () {
5320 final __test = new SimpleParserTest(); 5328 final __test = new SimpleParserTest();
5321 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledCase); 5329 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledCase);
5322 }); 5330 });
5323 _ut.test('test_parseSwitchStatement_labeledStatementInCase', () { 5331 _ut.test('test_parseSwitchStatement_labeledStatementInCase', () {
5324 final __test = new SimpleParserTest(); 5332 final __test = new SimpleParserTest();
5325 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledStatementIn Case); 5333 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledStatementIn Case);
5326 }); 5334 });
5327 _ut.test('test_parseThrowExpressionWithoutCascade_expression', () { 5335 _ut.test('test_parseThrowExpression', () {
5328 final __test = new SimpleParserTest(); 5336 final __test = new SimpleParserTest();
5329 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade_expr ession); 5337 runJUnitTest(__test, __test.test_parseThrowExpression);
5330 }); 5338 });
5331 _ut.test('test_parseThrowExpressionWithoutCascade_noExpression', () { 5339 _ut.test('test_parseThrowExpressionWithoutCascade', () {
5332 final __test = new SimpleParserTest(); 5340 final __test = new SimpleParserTest();
5333 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade_noEx pression); 5341 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade);
5334 });
5335 _ut.test('test_parseThrowExpression_expression', () {
5336 final __test = new SimpleParserTest();
5337 runJUnitTest(__test, __test.test_parseThrowExpression_expression);
5338 });
5339 _ut.test('test_parseThrowExpression_noExpression', () {
5340 final __test = new SimpleParserTest();
5341 runJUnitTest(__test, __test.test_parseThrowExpression_noExpression);
5342 }); 5342 });
5343 _ut.test('test_parseTryStatement_catch', () { 5343 _ut.test('test_parseTryStatement_catch', () {
5344 final __test = new SimpleParserTest(); 5344 final __test = new SimpleParserTest();
5345 runJUnitTest(__test, __test.test_parseTryStatement_catch); 5345 runJUnitTest(__test, __test.test_parseTryStatement_catch);
5346 }); 5346 });
5347 _ut.test('test_parseTryStatement_catch_finally', () { 5347 _ut.test('test_parseTryStatement_catch_finally', () {
5348 final __test = new SimpleParserTest(); 5348 final __test = new SimpleParserTest();
5349 runJUnitTest(__test, __test.test_parseTryStatement_catch_finally); 5349 runJUnitTest(__test, __test.test_parseTryStatement_catch_finally);
5350 }); 5350 });
5351 _ut.test('test_parseTryStatement_finally', () { 5351 _ut.test('test_parseTryStatement_finally', () {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
5445 runJUnitTest(__test, __test.test_parseTypeParameter_simple); 5445 runJUnitTest(__test, __test.test_parseTypeParameter_simple);
5446 }); 5446 });
5447 _ut.test('test_parseUnaryExpression_decrement_normal', () { 5447 _ut.test('test_parseUnaryExpression_decrement_normal', () {
5448 final __test = new SimpleParserTest(); 5448 final __test = new SimpleParserTest();
5449 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_normal); 5449 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_normal);
5450 }); 5450 });
5451 _ut.test('test_parseUnaryExpression_decrement_super', () { 5451 _ut.test('test_parseUnaryExpression_decrement_super', () {
5452 final __test = new SimpleParserTest(); 5452 final __test = new SimpleParserTest();
5453 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super); 5453 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super);
5454 }); 5454 });
5455 _ut.test('test_parseUnaryExpression_decrement_super_propertyAccess', () {
5456 final __test = new SimpleParserTest();
5457 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super_pr opertyAccess);
5458 });
5455 _ut.test('test_parseUnaryExpression_increment_normal', () { 5459 _ut.test('test_parseUnaryExpression_increment_normal', () {
5456 final __test = new SimpleParserTest(); 5460 final __test = new SimpleParserTest();
5457 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_normal); 5461 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_normal);
5458 }); 5462 });
5463 _ut.test('test_parseUnaryExpression_increment_super_index', () {
5464 final __test = new SimpleParserTest();
5465 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_super_in dex);
5466 });
5467 _ut.test('test_parseUnaryExpression_increment_super_propertyAccess', () {
5468 final __test = new SimpleParserTest();
5469 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_super_pr opertyAccess);
5470 });
5459 _ut.test('test_parseUnaryExpression_minus_normal', () { 5471 _ut.test('test_parseUnaryExpression_minus_normal', () {
5460 final __test = new SimpleParserTest(); 5472 final __test = new SimpleParserTest();
5461 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_normal); 5473 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_normal);
5462 }); 5474 });
5463 _ut.test('test_parseUnaryExpression_minus_super', () { 5475 _ut.test('test_parseUnaryExpression_minus_super', () {
5464 final __test = new SimpleParserTest(); 5476 final __test = new SimpleParserTest();
5465 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_super); 5477 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_super);
5466 }); 5478 });
5467 _ut.test('test_parseUnaryExpression_not_normal', () { 5479 _ut.test('test_parseUnaryExpression_not_normal', () {
5468 final __test = new SimpleParserTest(); 5480 final __test = new SimpleParserTest();
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
5620 final __test = new SimpleParserTest(); 5632 final __test = new SimpleParserTest();
5621 runJUnitTest(__test, __test.test_skipTypeName_parameterized); 5633 runJUnitTest(__test, __test.test_skipTypeName_parameterized);
5622 }); 5634 });
5623 _ut.test('test_skipTypeName_simple', () { 5635 _ut.test('test_skipTypeName_simple', () {
5624 final __test = new SimpleParserTest(); 5636 final __test = new SimpleParserTest();
5625 runJUnitTest(__test, __test.test_skipTypeName_simple); 5637 runJUnitTest(__test, __test.test_skipTypeName_simple);
5626 }); 5638 });
5627 }); 5639 });
5628 } 5640 }
5629 } 5641 }
5630 class AnalysisErrorListener_13 implements AnalysisErrorListener { 5642 class AnalysisErrorListener_15 implements AnalysisErrorListener {
5631 void onError(AnalysisError event) { 5643 void onError(AnalysisError event) {
5632 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event. offset}, ${event.length})"); 5644 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event. offset}, ${event.length})");
5633 } 5645 }
5634 } 5646 }
5635 /** 5647 /**
5636 * The class {@code ComplexParserTest} defines parser tests that test the parsin g of more complex 5648 * The class {@code ComplexParserTest} defines parser tests that test the parsin g of more complex
5637 * code fragments or the interactions between multiple parsing methods. For exam ple, tests to ensure 5649 * code fragments or the interactions between multiple parsing methods. For exam ple, tests to ensure
5638 * that the precedence of operations is being handled correctly should be define d in this class. 5650 * that the precedence of operations is being handled correctly should be define d in this class.
5639 * <p> 5651 * <p>
5640 * Simpler tests should be defined in the class {@link SimpleParserTest}. 5652 * Simpler tests should be defined in the class {@link SimpleParserTest}.
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
6065 } 6077 }
6066 Object visitNode(ASTNode node) { 6078 Object visitNode(ASTNode node) {
6067 validate(node); 6079 validate(node);
6068 return super.visitNode(node); 6080 return super.visitNode(node);
6069 } 6081 }
6070 /** 6082 /**
6071 * Validate that the given AST node is correctly constructed. 6083 * Validate that the given AST node is correctly constructed.
6072 * @param node the AST node being validated 6084 * @param node the AST node being validated
6073 */ 6085 */
6074 void validate(ASTNode node) { 6086 void validate(ASTNode node) {
6075 ASTNode parent20 = node.parent; 6087 ASTNode parent22 = node.parent;
6076 if (node is CompilationUnit) { 6088 if (node is CompilationUnit) {
6077 if (parent20 != null) { 6089 if (parent22 != null) {
6078 _errors.add("Compilation units should not have a parent"); 6090 _errors.add("Compilation units should not have a parent");
6079 } 6091 }
6080 } else { 6092 } else {
6081 if (parent20 == null) { 6093 if (parent22 == null) {
6082 _errors.add("No parent for ${node.runtimeType.toString()}"); 6094 _errors.add("No parent for ${node.runtimeType.toString()}");
6083 } 6095 }
6084 } 6096 }
6085 if (node.beginToken == null) { 6097 if (node.beginToken == null) {
6086 _errors.add("No begin token for ${node.runtimeType.toString()}"); 6098 _errors.add("No begin token for ${node.runtimeType.toString()}");
6087 } 6099 }
6088 if (node.endToken == null) { 6100 if (node.endToken == null) {
6089 _errors.add("No end token for ${node.runtimeType.toString()}"); 6101 _errors.add("No end token for ${node.runtimeType.toString()}");
6090 } 6102 }
6091 int nodeStart = node.offset; 6103 int nodeStart = node.offset;
6092 int nodeLength = node.length; 6104 int nodeLength = node.length;
6093 if (nodeStart < 0 || nodeLength < 0) { 6105 if (nodeStart < 0 || nodeLength < 0) {
6094 _errors.add("No source info for ${node.runtimeType.toString()}"); 6106 _errors.add("No source info for ${node.runtimeType.toString()}");
6095 } 6107 }
6096 if (parent20 != null) { 6108 if (parent22 != null) {
6097 int nodeEnd = nodeStart + nodeLength; 6109 int nodeEnd = nodeStart + nodeLength;
6098 int parentStart = parent20.offset; 6110 int parentStart = parent22.offset;
6099 int parentEnd = parentStart + parent20.length; 6111 int parentEnd = parentStart + parent22.length;
6100 if (nodeStart < parentStart) { 6112 if (nodeStart < parentStart) {
6101 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType. toString()} inside ${parent20.runtimeType.toString()} (${parentStart})"); 6113 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType. toString()} inside ${parent22.runtimeType.toString()} (${parentStart})");
6102 } 6114 }
6103 if (nodeEnd > parentEnd) { 6115 if (nodeEnd > parentEnd) {
6104 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt ring()} inside ${parent20.runtimeType.toString()} (${parentStart})"); 6116 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt ring()} inside ${parent22.runtimeType.toString()} (${parentStart})");
6105 } 6117 }
6106 } 6118 }
6107 } 6119 }
6108 } 6120 }
6109 class ParserTestCase extends EngineTestCase { 6121 class ParserTestCase extends EngineTestCase {
6110 /** 6122 /**
6111 * An empty array of objects used as arguments to zero-argument methods. 6123 * An empty array of objects used as arguments to zero-argument methods.
6112 */ 6124 */
6113 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0); 6125 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0);
6114 /** 6126 /**
6115 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and 6127 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
6116 * type of parameters and will be invoked with the given arguments. 6128 * type of parameters and will be invoked with the given arguments.
6117 * <p> 6129 * <p>
6118 * The given source is scanned and the parser is initialized to start with the first token in the 6130 * The given source is scanned and the parser is initialized to start with the first token in the
6119 * source before the parse method is invoked. 6131 * source before the parse method is invoked.
6120 * @param methodName the name of the parse method that should be invoked to pa rse the source 6132 * @param methodName the name of the parse method that should be invoked to pa rse the source
6121 * @param objects the values of the arguments to the method 6133 * @param objects the values of the arguments to the method
6122 * @param source the source to be parsed by the parse method 6134 * @param source the source to be parsed by the parse method
6123 * @return the result of invoking the method 6135 * @return the result of invoking the method
6124 * @throws Exception if the method could not be invoked or throws an exception 6136 * @throws Exception if the method could not be invoked or throws an exception
6125 * @throws AssertionFailedError if the result is {@code null} or if any errors are produced 6137 * @throws AssertionFailedError if the result is {@code null} or if any errors are produced
6126 */ 6138 */
6127 static Object parse(String methodName, List<Object> objects, String source) => parse4(methodName, objects, source, new List<AnalysisError>(0)); 6139 static Object parse(String methodName, List<Object> objects, String source) => parse3(methodName, objects, source, new List<AnalysisError>(0));
6128 /** 6140 /**
6129 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and 6141 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
6130 * type of parameters and will be invoked with the given arguments. 6142 * type of parameters and will be invoked with the given arguments.
6131 * <p> 6143 * <p>
6132 * The given source is scanned and the parser is initialized to start with the first token in the 6144 * The given source is scanned and the parser is initialized to start with the first token in the
6133 * source before the parse method is invoked. 6145 * source before the parse method is invoked.
6134 * @param methodName the name of the parse method that should be invoked to pa rse the source 6146 * @param methodName the name of the parse method that should be invoked to pa rse the source
6135 * @param objects the values of the arguments to the method 6147 * @param objects the values of the arguments to the method
6136 * @param source the source to be parsed by the parse method 6148 * @param source the source to be parsed by the parse method
6137 * @param errorCodes the error codes of the errors that should be generated 6149 * @param errorCodes the error codes of the errors that should be generated
6138 * @return the result of invoking the method 6150 * @return the result of invoking the method
6139 * @throws Exception if the method could not be invoked or throws an exception 6151 * @throws Exception if the method could not be invoked or throws an exception
6140 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while 6152 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while
6141 * scanning and parsing the source do not match the expected errors 6153 * scanning and parsing the source do not match the expected errors
6142 */ 6154 */
6143 static Object parse4(String methodName, List<Object> objects, String source, L ist<AnalysisError> errors) { 6155 static Object parse3(String methodName, List<Object> objects, String source, L ist<AnalysisError> errors) {
6144 GatheringErrorListener listener = new GatheringErrorListener(); 6156 GatheringErrorListener listener = new GatheringErrorListener();
6145 Object result = invokeParserMethod(methodName, objects, source, listener); 6157 Object result = invokeParserMethod(methodName, objects, source, listener);
6146 listener.assertErrors(errors); 6158 listener.assertErrors(errors);
6147 return result; 6159 return result;
6148 } 6160 }
6149 /** 6161 /**
6150 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and 6162 * Invoke a parse method in {@link Parser}. The method is assumed to have the given number and
6151 * type of parameters and will be invoked with the given arguments. 6163 * type of parameters and will be invoked with the given arguments.
6152 * <p> 6164 * <p>
6153 * The given source is scanned and the parser is initialized to start with the first token in the 6165 * The given source is scanned and the parser is initialized to start with the first token in the
6154 * source before the parse method is invoked. 6166 * source before the parse method is invoked.
6155 * @param methodName the name of the parse method that should be invoked to pa rse the source 6167 * @param methodName the name of the parse method that should be invoked to pa rse the source
6156 * @param objects the values of the arguments to the method 6168 * @param objects the values of the arguments to the method
6157 * @param source the source to be parsed by the parse method 6169 * @param source the source to be parsed by the parse method
6158 * @param errorCodes the error codes of the errors that should be generated 6170 * @param errorCodes the error codes of the errors that should be generated
6159 * @return the result of invoking the method 6171 * @return the result of invoking the method
6160 * @throws Exception if the method could not be invoked or throws an exception 6172 * @throws Exception if the method could not be invoked or throws an exception
6161 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while 6173 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while
6162 * scanning and parsing the source do not match the expected errors 6174 * scanning and parsing the source do not match the expected errors
6163 */ 6175 */
6164 static Object parse5(String methodName, List<Object> objects, String source, L ist<ErrorCode> errorCodes) { 6176 static Object parse4(String methodName, List<Object> objects, String source, L ist<ErrorCode> errorCodes) {
6165 GatheringErrorListener listener = new GatheringErrorListener(); 6177 GatheringErrorListener listener = new GatheringErrorListener();
6166 Object result = invokeParserMethod(methodName, objects, source, listener); 6178 Object result = invokeParserMethod(methodName, objects, source, listener);
6167 listener.assertErrors2(errorCodes); 6179 listener.assertErrors2(errorCodes);
6168 return result; 6180 return result;
6169 } 6181 }
6170 /** 6182 /**
6171 * Invoke a parse method in {@link Parser}. The method is assumed to have no a rguments. 6183 * Invoke a parse method in {@link Parser}. The method is assumed to have no a rguments.
6172 * <p> 6184 * <p>
6173 * The given source is scanned and the parser is initialized to start with the first token in the 6185 * The given source is scanned and the parser is initialized to start with the first token in the
6174 * source before the parse method is invoked. 6186 * source before the parse method is invoked.
6175 * @param methodName the name of the parse method that should be invoked to pa rse the source 6187 * @param methodName the name of the parse method that should be invoked to pa rse the source
6176 * @param source the source to be parsed by the parse method 6188 * @param source the source to be parsed by the parse method
6177 * @param errorCodes the error codes of the errors that should be generated 6189 * @param errorCodes the error codes of the errors that should be generated
6178 * @return the result of invoking the method 6190 * @return the result of invoking the method
6179 * @throws Exception if the method could not be invoked or throws an exception 6191 * @throws Exception if the method could not be invoked or throws an exception
6180 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while 6192 * @throws AssertionFailedError if the result is {@code null} or the errors pr oduced while
6181 * scanning and parsing the source do not match the expected errors 6193 * scanning and parsing the source do not match the expected errors
6182 */ 6194 */
6183 static Object parse6(String methodName, String source, List<ErrorCode> errorCo des) => parse5(methodName, _EMPTY_ARGUMENTS, source, errorCodes); 6195 static Object parse5(String methodName, String source, List<ErrorCode> errorCo des) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
6184 /** 6196 /**
6185 * Parse the given source as a compilation unit. 6197 * Parse the given source as a compilation unit.
6186 * @param source the source to be parsed 6198 * @param source the source to be parsed
6187 * @param errorCodes the error codes of the errors that are expected to be fou nd 6199 * @param errorCodes the error codes of the errors that are expected to be fou nd
6188 * @return the compilation unit that was parsed 6200 * @return the compilation unit that was parsed
6189 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do 6201 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do
6190 * not match those that are expected, or if the result would have been {@code null} 6202 * not match those that are expected, or if the result would have been {@code null}
6191 */ 6203 */
6192 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err orCodes) { 6204 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err orCodes) {
6193 GatheringErrorListener listener = new GatheringErrorListener(); 6205 GatheringErrorListener listener = new GatheringErrorListener();
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
6487 } 6499 }
6488 void test_bitwiseXorExpression_precedence_and_right() { 6500 void test_bitwiseXorExpression_precedence_and_right() {
6489 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); 6501 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []);
6490 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); 6502 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
6491 } 6503 }
6492 void test_bitwiseXorExpression_super() { 6504 void test_bitwiseXorExpression_super() {
6493 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [ ]); 6505 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [ ]);
6494 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); 6506 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6495 } 6507 }
6496 void test_conditionalExpression_missingElse() { 6508 void test_conditionalExpression_missingElse() {
6497 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx pression", "x ? y :", []); 6509 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y :", []);
6498 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression) ; 6510 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression) ;
6499 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); 6511 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic());
6500 } 6512 }
6501 void test_conditionalExpression_missingThen() { 6513 void test_conditionalExpression_missingThen() {
6502 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx pression", "x ? : z", []); 6514 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? : z", []);
6503 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression) ; 6515 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression) ;
6504 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); 6516 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic());
6505 } 6517 }
6506 void test_equalityExpression_missing_LHS() { 6518 void test_equalityExpression_missing_LHS() {
6507 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); 6519 BinaryExpression expression = ParserTestCase.parseExpression("== y", []);
6508 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); 6520 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
6509 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); 6521 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic());
6510 } 6522 }
6511 void test_equalityExpression_missing_LHS_RHS() { 6523 void test_equalityExpression_missing_LHS_RHS() {
6512 BinaryExpression expression = ParserTestCase.parseExpression("==", []); 6524 BinaryExpression expression = ParserTestCase.parseExpression("==", []);
(...skipping 18 matching lines...) Expand all
6531 } 6543 }
6532 void test_equalityExpression_precedence_relational_right() { 6544 void test_equalityExpression_precedence_relational_right() {
6533 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse rErrorCode.MISSING_IDENTIFIER]); 6545 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse rErrorCode.MISSING_IDENTIFIER]);
6534 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); 6546 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand);
6535 } 6547 }
6536 void test_equalityExpression_super() { 6548 void test_equalityExpression_super() {
6537 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", []); 6549 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", []);
6538 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); 6550 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
6539 } 6551 }
6540 void test_expressionList_multiple_end() { 6552 void test_expressionList_multiple_end() {
6541 List<Expression> result = ParserTestCase.parse6("parseExpressionList", ", 2, 3, 4", []); 6553 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2, 3, 4", []);
6542 EngineTestCase.assertSize(4, result); 6554 EngineTestCase.assertSize(4, result);
6543 Expression syntheticExpression = result[0]; 6555 Expression syntheticExpression = result[0];
6544 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 6556 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6545 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); 6557 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
6546 } 6558 }
6547 void test_expressionList_multiple_middle() { 6559 void test_expressionList_multiple_middle() {
6548 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2 , , 4", []); 6560 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , , 4", []);
6549 EngineTestCase.assertSize(4, result); 6561 EngineTestCase.assertSize(4, result);
6550 Expression syntheticExpression = result[2]; 6562 Expression syntheticExpression = result[2];
6551 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 6563 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6552 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); 6564 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
6553 } 6565 }
6554 void test_expressionList_multiple_start() { 6566 void test_expressionList_multiple_start() {
6555 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2 , 3,", []); 6567 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3,", []);
6556 EngineTestCase.assertSize(4, result); 6568 EngineTestCase.assertSize(4, result);
6557 Expression syntheticExpression = result[3]; 6569 Expression syntheticExpression = result[3];
6558 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 6570 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
6559 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); 6571 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic());
6560 } 6572 }
6561 void test_isExpression_noType() { 6573 void test_isExpression_noType() {
6562 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T exte nds Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.MISSING_IDENTI FIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_STATEMENT]); 6574 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Bar<T exte nds Foo> {m(x){if (x is ) return;if (x is !)}}", [ParserErrorCode.MISSING_IDENTI FIER, ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.MISSING_STATEMENT]);
6563 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; 6575 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
6564 MethodDeclaration method = declaration.members[0] as MethodDeclaration; 6576 MethodDeclaration method = declaration.members[0] as MethodDeclaration;
6565 BlockFunctionBody body5 = method.body as BlockFunctionBody; 6577 BlockFunctionBody body5 = method.body as BlockFunctionBody;
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
7037 }); 7049 });
7038 }); 7050 });
7039 } 7051 }
7040 } 7052 }
7041 /** 7053 /**
7042 * The class {@code ErrorParserTest} defines parser tests that test the parsing of code to ensure 7054 * The class {@code ErrorParserTest} defines parser tests that test the parsing of code to ensure
7043 * that errors are correctly reported, and in some cases, not reported. 7055 * that errors are correctly reported, and in some cases, not reported.
7044 */ 7056 */
7045 class ErrorParserTest extends ParserTestCase { 7057 class ErrorParserTest extends ParserTestCase {
7046 void fail_expectedListOrMapLiteral() { 7058 void fail_expectedListOrMapLiteral() {
7047 TypedLiteral literal = ParserTestCase.parse5("parseListOrMapLiteral", <Objec t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); 7059 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
7048 JUnitTestCase.assertTrue(literal.isSynthetic()); 7060 JUnitTestCase.assertTrue(literal.isSynthetic());
7049 } 7061 }
7050 void fail_illegalAssignmentToNonAssignable_superAssigned() { 7062 void fail_illegalAssignmentToNonAssignable_superAssigned() {
7051 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.ILLE GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); 7063 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.ILLE GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
7052 } 7064 }
7053 void fail_invalidCommentReference__new_nonIdentifier() { 7065 void fail_invalidCommentReference__new_nonIdentifier() {
7054 ParserTestCase.parse5("parseCommentReference", <Object> ["new 42", 0], "", [ ParserErrorCode.INVALID_COMMENT_REFERENCE]); 7066 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [ ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7055 } 7067 }
7056 void fail_invalidCommentReference__new_tooMuch() { 7068 void fail_invalidCommentReference__new_tooMuch() {
7057 ParserTestCase.parse5("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); 7069 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7058 } 7070 }
7059 void fail_invalidCommentReference__nonNew_nonIdentifier() { 7071 void fail_invalidCommentReference__nonNew_nonIdentifier() {
7060 ParserTestCase.parse5("parseCommentReference", <Object> ["42", 0], "", [Pars erErrorCode.INVALID_COMMENT_REFERENCE]); 7072 ParserTestCase.parse4("parseCommentReference", <Object> ["42", 0], "", [Pars erErrorCode.INVALID_COMMENT_REFERENCE]);
7061 } 7073 }
7062 void fail_invalidCommentReference__nonNew_tooMuch() { 7074 void fail_invalidCommentReference__nonNew_tooMuch() {
7063 ParserTestCase.parse5("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); 7075 ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
7076 }
7077 void fail_missingExpressionInThrow_withCascade() {
7078 ParserTestCase.parse5("parseThrowExpression", "throw;", [ParserErrorCode.MIS SING_EXPRESSION_IN_THROW]);
7079 }
7080 void fail_missingExpressionInThrow_withoutCascade() {
7081 ParserTestCase.parse5("parseThrowExpressionWithoutCascade", "throw;", [Parse rErrorCode.MISSING_EXPRESSION_IN_THROW]);
7064 } 7082 }
7065 void fail_missingFunctionParameters_local_nonVoid_block() { 7083 void fail_missingFunctionParameters_local_nonVoid_block() {
7066 ParserTestCase.parse6("parseStatement", "int f { return x;}", [ParserErrorCo de.MISSING_FUNCTION_PARAMETERS]); 7084 ParserTestCase.parse5("parseStatement", "int f { return x;}", [ParserErrorCo de.MISSING_FUNCTION_PARAMETERS]);
7067 } 7085 }
7068 void fail_missingFunctionParameters_local_nonVoid_expression() { 7086 void fail_missingFunctionParameters_local_nonVoid_expression() {
7069 ParserTestCase.parse6("parseStatement", "int f => x;", [ParserErrorCode.MISS ING_FUNCTION_PARAMETERS]); 7087 ParserTestCase.parse5("parseStatement", "int f => x;", [ParserErrorCode.MISS ING_FUNCTION_PARAMETERS]);
7070 } 7088 }
7071 void fail_unexpectedToken_invalidPostfixExpression() { 7089 void fail_unexpectedToken_invalidPostfixExpression() {
7072 ParserTestCase.parse6("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE D_TOKEN]); 7090 ParserTestCase.parse5("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE D_TOKEN]);
7073 } 7091 }
7074 void fail_voidVariable_initializer() { 7092 void fail_voidVariable_initializer() {
7075 ParserTestCase.parse6("parseStatement", "void x = 0;", [ParserErrorCode.VOID _VARIABLE]); 7093 ParserTestCase.parse5("parseStatement", "void x = 0;", [ParserErrorCode.VOID _VARIABLE]);
7076 } 7094 }
7077 void fail_voidVariable_noInitializer() { 7095 void fail_voidVariable_noInitializer() {
7078 ParserTestCase.parse6("parseStatement", "void x;", [ParserErrorCode.VOID_VAR IABLE]); 7096 ParserTestCase.parse5("parseStatement", "void x;", [ParserErrorCode.VOID_VAR IABLE]);
7079 } 7097 }
7080 void test_abstractClassMember_constructor() { 7098 void test_abstractClassMember_constructor() {
7081 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 7099 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7082 } 7100 }
7083 void test_abstractClassMember_field() { 7101 void test_abstractClassMember_field() {
7084 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C f;", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 7102 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C f;", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7085 } 7103 }
7086 void test_abstractClassMember_getter() { 7104 void test_abstractClassMember_getter() {
7087 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 7105 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7088 } 7106 }
7089 void test_abstractClassMember_method() { 7107 void test_abstractClassMember_method() {
7090 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract m();", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 7108 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract m();", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7091 } 7109 }
7092 void test_abstractClassMember_setter() { 7110 void test_abstractClassMember_setter() {
7093 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract set m(v) ;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 7111 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract set m(v) ;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
7094 } 7112 }
7095 void test_abstractTopLevelFunction_function() { 7113 void test_abstractTopLevelFunction_function() {
7096 ParserTestCase.parse6("parseCompilationUnit", "abstract f(v) {}", [ParserErr orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); 7114 ParserTestCase.parse5("parseCompilationUnit", "abstract f(v) {}", [ParserErr orCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
7097 } 7115 }
7098 void test_abstractTopLevelFunction_getter() { 7116 void test_abstractTopLevelFunction_getter() {
7099 ParserTestCase.parse6("parseCompilationUnit", "abstract get m {}", [ParserEr rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); 7117 ParserTestCase.parse5("parseCompilationUnit", "abstract get m {}", [ParserEr rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
7100 } 7118 }
7101 void test_abstractTopLevelFunction_setter() { 7119 void test_abstractTopLevelFunction_setter() {
7102 ParserTestCase.parse6("parseCompilationUnit", "abstract set m(v) {}", [Parse rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); 7120 ParserTestCase.parse5("parseCompilationUnit", "abstract set m(v) {}", [Parse rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]);
7103 } 7121 }
7104 void test_abstractTopLevelVariable() { 7122 void test_abstractTopLevelVariable() {
7105 ParserTestCase.parse6("parseCompilationUnit", "abstract C f;", [ParserErrorC ode.ABSTRACT_TOP_LEVEL_VARIABLE]); 7123 ParserTestCase.parse5("parseCompilationUnit", "abstract C f;", [ParserErrorC ode.ABSTRACT_TOP_LEVEL_VARIABLE]);
7106 } 7124 }
7107 void test_abstractTypeDef() { 7125 void test_abstractTypeDef() {
7108 ParserTestCase.parse6("parseCompilationUnit", "abstract typedef F();", [Pars erErrorCode.ABSTRACT_TYPEDEF]); 7126 ParserTestCase.parse5("parseCompilationUnit", "abstract typedef F();", [Pars erErrorCode.ABSTRACT_TYPEDEF]);
7109 } 7127 }
7110 void test_breakOutsideOfLoop_breakInDoStatement() { 7128 void test_breakOutsideOfLoop_breakInDoStatement() {
7111 ParserTestCase.parse6("parseDoStatement", "do {break;} while (x);", []); 7129 ParserTestCase.parse5("parseDoStatement", "do {break;} while (x);", []);
7112 } 7130 }
7113 void test_breakOutsideOfLoop_breakInForStatement() { 7131 void test_breakOutsideOfLoop_breakInForStatement() {
7114 ParserTestCase.parse6("parseForStatement", "for (; x;) {break;}", []); 7132 ParserTestCase.parse5("parseForStatement", "for (; x;) {break;}", []);
7115 } 7133 }
7116 void test_breakOutsideOfLoop_breakInIfStatement() { 7134 void test_breakOutsideOfLoop_breakInIfStatement() {
7117 ParserTestCase.parse6("parseIfStatement", "if (x) {break;}", [ParserErrorCod e.BREAK_OUTSIDE_OF_LOOP]); 7135 ParserTestCase.parse5("parseIfStatement", "if (x) {break;}", [ParserErrorCod e.BREAK_OUTSIDE_OF_LOOP]);
7118 } 7136 }
7119 void test_breakOutsideOfLoop_breakInSwitchStatement() { 7137 void test_breakOutsideOfLoop_breakInSwitchStatement() {
7120 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: break;}", []); 7138 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: break;}", []);
7121 } 7139 }
7122 void test_breakOutsideOfLoop_breakInWhileStatement() { 7140 void test_breakOutsideOfLoop_breakInWhileStatement() {
7123 ParserTestCase.parse6("parseWhileStatement", "while (x) {break;}", []); 7141 ParserTestCase.parse5("parseWhileStatement", "while (x) {break;}", []);
7124 } 7142 }
7125 void test_breakOutsideOfLoop_functionExpression_inALoop() { 7143 void test_breakOutsideOfLoop_functionExpression_inALoop() {
7126 ParserTestCase.parse6("parseStatement", "for(; x;) {() {break;};}", [ParserE rrorCode.BREAK_OUTSIDE_OF_LOOP]); 7144 ParserTestCase.parse5("parseStatement", "for(; x;) {() {break;};}", [ParserE rrorCode.BREAK_OUTSIDE_OF_LOOP]);
7127 } 7145 }
7128 void test_breakOutsideOfLoop_functionExpression_withALoop() { 7146 void test_breakOutsideOfLoop_functionExpression_withALoop() {
7129 ParserTestCase.parse6("parseStatement", "() {for (; x;) {break;}};", []); 7147 ParserTestCase.parse5("parseStatement", "() {for (; x;) {break;}};", []);
7130 } 7148 }
7131 void test_constAndFinal() { 7149 void test_constAndFinal() {
7132 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const final int x ;", [ParserErrorCode.CONST_AND_FINAL]); 7150 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const final int x ;", [ParserErrorCode.CONST_AND_FINAL]);
7133 } 7151 }
7134 void test_constAndVar() { 7152 void test_constAndVar() {
7135 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const var x;", [P arserErrorCode.CONST_AND_VAR]); 7153 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const var x;", [P arserErrorCode.CONST_AND_VAR]);
7136 } 7154 }
7137 void test_constClass() { 7155 void test_constClass() {
7138 ParserTestCase.parse6("parseCompilationUnit", "const class C {}", [ParserErr orCode.CONST_CLASS]); 7156 ParserTestCase.parse5("parseCompilationUnit", "const class C {}", [ParserErr orCode.CONST_CLASS]);
7139 } 7157 }
7140 void test_constMethod() { 7158 void test_constMethod() {
7141 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const int m() {}" , [ParserErrorCode.CONST_METHOD]); 7159 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const int m() {}" , [ParserErrorCode.CONST_METHOD]);
7142 } 7160 }
7143 void test_constTypedef() { 7161 void test_constTypedef() {
7144 ParserTestCase.parse6("parseCompilationUnit", "const typedef F();", [ParserE rrorCode.CONST_TYPEDEF]); 7162 ParserTestCase.parse5("parseCompilationUnit", "const typedef F();", [ParserE rrorCode.CONST_TYPEDEF]);
7145 } 7163 }
7146 void test_continueOutsideOfLoop_continueInDoStatement() { 7164 void test_continueOutsideOfLoop_continueInDoStatement() {
7147 ParserTestCase.parse6("parseDoStatement", "do {continue;} while (x);", []); 7165 ParserTestCase.parse5("parseDoStatement", "do {continue;} while (x);", []);
7148 } 7166 }
7149 void test_continueOutsideOfLoop_continueInForStatement() { 7167 void test_continueOutsideOfLoop_continueInForStatement() {
7150 ParserTestCase.parse6("parseForStatement", "for (; x;) {continue;}", []); 7168 ParserTestCase.parse5("parseForStatement", "for (; x;) {continue;}", []);
7151 } 7169 }
7152 void test_continueOutsideOfLoop_continueInIfStatement() { 7170 void test_continueOutsideOfLoop_continueInIfStatement() {
7153 ParserTestCase.parse6("parseIfStatement", "if (x) {continue;}", [ParserError Code.CONTINUE_OUTSIDE_OF_LOOP]); 7171 ParserTestCase.parse5("parseIfStatement", "if (x) {continue;}", [ParserError Code.CONTINUE_OUTSIDE_OF_LOOP]);
7154 } 7172 }
7155 void test_continueOutsideOfLoop_continueInSwitchStatement() { 7173 void test_continueOutsideOfLoop_continueInSwitchStatement() {
7156 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue a;}", []); 7174 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
7157 } 7175 }
7158 void test_continueOutsideOfLoop_continueInWhileStatement() { 7176 void test_continueOutsideOfLoop_continueInWhileStatement() {
7159 ParserTestCase.parse6("parseWhileStatement", "while (x) {continue;}", []); 7177 ParserTestCase.parse5("parseWhileStatement", "while (x) {continue;}", []);
7160 } 7178 }
7161 void test_continueOutsideOfLoop_functionExpression_inALoop() { 7179 void test_continueOutsideOfLoop_functionExpression_inALoop() {
7162 ParserTestCase.parse6("parseStatement", "for(; x;) {() {continue;};}", [Pars erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); 7180 ParserTestCase.parse5("parseStatement", "for(; x;) {() {continue;};}", [Pars erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
7163 } 7181 }
7164 void test_continueOutsideOfLoop_functionExpression_withALoop() { 7182 void test_continueOutsideOfLoop_functionExpression_withALoop() {
7165 ParserTestCase.parse6("parseStatement", "() {for (; x;) {continue;}};", []); 7183 ParserTestCase.parse5("parseStatement", "() {for (; x;) {continue;}};", []);
7166 } 7184 }
7167 void test_continueWithoutLabelInCase_error() { 7185 void test_continueWithoutLabelInCase_error() {
7168 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue; }", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); 7186 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue; }", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]);
7169 } 7187 }
7170 void test_continueWithoutLabelInCase_noError() { 7188 void test_continueWithoutLabelInCase_noError() {
7171 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue a;}", []); 7189 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
7172 } 7190 }
7173 void test_continueWithoutLabelInCase_noError_switchInLoop() { 7191 void test_continueWithoutLabelInCase_noError_switchInLoop() {
7174 ParserTestCase.parse6("parseWhileStatement", "while (a) { switch (b) {defaul t: continue;}}", []); 7192 ParserTestCase.parse5("parseWhileStatement", "while (a) { switch (b) {defaul t: continue;}}", []);
7175 } 7193 }
7176 void test_directiveAfterDeclaration_classBeforeDirective() { 7194 void test_directiveAfterDeclaration_classBeforeDirective() {
7177 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); 7195 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
7178 JUnitTestCase.assertNotNull(unit); 7196 JUnitTestCase.assertNotNull(unit);
7179 } 7197 }
7180 void test_directiveAfterDeclaration_classBetweenDirectives() { 7198 void test_directiveAfterDeclaration_classBetweenDirectives() {
7181 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION ]); 7199 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION ]);
7182 JUnitTestCase.assertNotNull(unit); 7200 JUnitTestCase.assertNotNull(unit);
7183 } 7201 }
7184 void test_duplicatedModifier_const() { 7202 void test_duplicatedModifier_const() {
7185 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]); 7203 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
7186 } 7204 }
7187 void test_duplicatedModifier_external() { 7205 void test_duplicatedModifier_external() {
7188 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]); 7206 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]);
7189 } 7207 }
7190 void test_duplicatedModifier_factory() { 7208 void test_duplicatedModifier_factory() {
7191 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory factory C () {}", [ParserErrorCode.DUPLICATED_MODIFIER]); 7209 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory factory C () {}", [ParserErrorCode.DUPLICATED_MODIFIER]);
7192 } 7210 }
7193 void test_duplicatedModifier_final() { 7211 void test_duplicatedModifier_final() {
7194 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]); 7212 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
7195 } 7213 }
7196 void test_duplicatedModifier_static() { 7214 void test_duplicatedModifier_static() {
7197 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static static m;" , [ParserErrorCode.DUPLICATED_MODIFIER]); 7215 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static static m;" , [ParserErrorCode.DUPLICATED_MODIFIER]);
7198 } 7216 }
7199 void test_duplicatedModifier_var() { 7217 void test_duplicatedModifier_var() {
7200 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var var m;", [Par serErrorCode.DUPLICATED_MODIFIER]); 7218 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var var m;", [Par serErrorCode.DUPLICATED_MODIFIER]);
7201 } 7219 }
7202 void test_duplicateLabelInSwitchStatement() { 7220 void test_duplicateLabelInSwitchStatement() {
7203 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {l1: case 0: break ; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); 7221 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {l1: case 0: break ; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
7204 } 7222 }
7205 void test_expectedCaseOrDefault() { 7223 void test_expectedCaseOrDefault() {
7206 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {break;}", [Parser ErrorCode.EXPECTED_CASE_OR_DEFAULT]); 7224 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [Parser ErrorCode.EXPECTED_CASE_OR_DEFAULT]);
7207 } 7225 }
7208 void test_expectedStringLiteral() { 7226 void test_expectedStringLiteral() {
7209 StringLiteral expression = ParserTestCase.parse6("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]); 7227 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
7210 JUnitTestCase.assertTrue(expression.isSynthetic()); 7228 JUnitTestCase.assertTrue(expression.isSynthetic());
7211 } 7229 }
7212 void test_expectedToken_commaMissingInArgumentList() { 7230 void test_expectedToken_commaMissingInArgumentList() {
7213 ParserTestCase.parse6("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE CTED_TOKEN]); 7231 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE CTED_TOKEN]);
7214 } 7232 }
7215 void test_expectedToken_semicolonMissingAfterExpression() { 7233 void test_expectedToken_semicolonMissingAfterExpression() {
7216 ParserTestCase.parse6("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN ]); 7234 ParserTestCase.parse5("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN ]);
7217 } 7235 }
7218 void test_expectedToken_whileMissingInDoStatement() { 7236 void test_expectedToken_whileMissingInDoStatement() {
7219 ParserTestCase.parse6("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC TED_TOKEN]); 7237 ParserTestCase.parse5("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC TED_TOKEN]);
7220 } 7238 }
7221 void test_exportDirectiveAfterPartDirective() { 7239 void test_exportDirectiveAfterPartDirective() {
7222 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; export 'b.dart ';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); 7240 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; export 'b.dart ';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
7223 } 7241 }
7224 void test_externalAfterConst() { 7242 void test_externalAfterConst() {
7225 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const external C( );", [ParserErrorCode.EXTERNAL_AFTER_CONST]); 7243 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const external C( );", [ParserErrorCode.EXTERNAL_AFTER_CONST]);
7226 } 7244 }
7227 void test_externalAfterFactory() { 7245 void test_externalAfterFactory() {
7228 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); 7246 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]);
7229 } 7247 }
7230 void test_externalAfterStatic() { 7248 void test_externalAfterStatic() {
7231 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static external i nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); 7249 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static external i nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]);
7232 } 7250 }
7233 void test_externalClass() { 7251 void test_externalClass() {
7234 ParserTestCase.parse6("parseCompilationUnit", "external class C {}", [Parser ErrorCode.EXTERNAL_CLASS]); 7252 ParserTestCase.parse5("parseCompilationUnit", "external class C {}", [Parser ErrorCode.EXTERNAL_CLASS]);
7235 } 7253 }
7236 void test_externalConstructorWithBody_factory() { 7254 void test_externalConstructorWithBody_factory() {
7237 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); 7255 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
7238 } 7256 }
7239 void test_externalConstructorWithBody_named() { 7257 void test_externalConstructorWithBody_named() {
7240 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external C.c() {} ", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); 7258 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external C.c() {} ", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
7241 } 7259 }
7242 void test_externalField_const() { 7260 void test_externalField_const() {
7243 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]); 7261 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7244 } 7262 }
7245 void test_externalField_final() { 7263 void test_externalField_final() {
7246 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]); 7264 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7247 } 7265 }
7248 void test_externalField_static() { 7266 void test_externalField_static() {
7249 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]); 7267 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]);
7250 } 7268 }
7251 void test_externalField_typed() { 7269 void test_externalField_typed() {
7252 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external A f;", [ ParserErrorCode.EXTERNAL_FIELD]); 7270 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external A f;", [ ParserErrorCode.EXTERNAL_FIELD]);
7253 } 7271 }
7254 void test_externalField_untyped() { 7272 void test_externalField_untyped() {
7255 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]); 7273 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]);
7256 } 7274 }
7257 void test_externalGetterWithBody() { 7275 void test_externalGetterWithBody() {
7258 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); 7276 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]);
7259 } 7277 }
7260 void test_externalMethodWithBody() { 7278 void test_externalMethodWithBody() {
7261 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); 7279 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]);
7262 } 7280 }
7263 void test_externalOperatorWithBody() { 7281 void test_externalOperatorWithBody() {
7264 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); 7282 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
7265 } 7283 }
7266 void test_externalSetterWithBody() { 7284 void test_externalSetterWithBody() {
7267 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external set x(in t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); 7285 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external set x(in t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]);
7268 } 7286 }
7269 void test_externalTypedef() { 7287 void test_externalTypedef() {
7270 ParserTestCase.parse6("parseCompilationUnit", "external typedef F();", [Pars erErrorCode.EXTERNAL_TYPEDEF]); 7288 ParserTestCase.parse5("parseCompilationUnit", "external typedef F();", [Pars erErrorCode.EXTERNAL_TYPEDEF]);
7271 } 7289 }
7272 void test_factoryTopLevelDeclaration_class() { 7290 void test_factoryTopLevelDeclaration_class() {
7273 ParserTestCase.parse6("parseCompilationUnit", "factory class C {}", [ParserE rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); 7291 ParserTestCase.parse5("parseCompilationUnit", "factory class C {}", [ParserE rrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
7274 } 7292 }
7275 void test_factoryTopLevelDeclaration_typedef() { 7293 void test_factoryTopLevelDeclaration_typedef() {
7276 ParserTestCase.parse6("parseCompilationUnit", "factory typedef F();", [Parse rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); 7294 ParserTestCase.parse5("parseCompilationUnit", "factory typedef F();", [Parse rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]);
7277 } 7295 }
7278 void test_fieldInitializerOutsideConstructor() { 7296 void test_fieldInitializerOutsideConstructor() {
7279 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); 7297 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
7280 } 7298 }
7281 void test_finalAndVar() { 7299 void test_finalAndVar() {
7282 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final var x;", [P arserErrorCode.FINAL_AND_VAR]); 7300 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final var x;", [P arserErrorCode.FINAL_AND_VAR]);
7283 } 7301 }
7284 void test_finalClass() { 7302 void test_finalClass() {
7285 ParserTestCase.parse6("parseCompilationUnit", "final class C {}", [ParserErr orCode.FINAL_CLASS]); 7303 ParserTestCase.parse5("parseCompilationUnit", "final class C {}", [ParserErr orCode.FINAL_CLASS]);
7286 } 7304 }
7287 void test_finalConstructor() { 7305 void test_finalConstructor() {
7288 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final C() {}", [P arserErrorCode.FINAL_CONSTRUCTOR]); 7306 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final C() {}", [P arserErrorCode.FINAL_CONSTRUCTOR]);
7289 } 7307 }
7290 void test_finalMethod() { 7308 void test_finalMethod() {
7291 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final int m() {}" , [ParserErrorCode.FINAL_METHOD]); 7309 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final int m() {}" , [ParserErrorCode.FINAL_METHOD]);
7292 } 7310 }
7293 void test_finalTypedef() { 7311 void test_finalTypedef() {
7294 ParserTestCase.parse6("parseCompilationUnit", "final typedef F();", [ParserE rrorCode.FINAL_TYPEDEF]); 7312 ParserTestCase.parse5("parseCompilationUnit", "final typedef F();", [ParserE rrorCode.FINAL_TYPEDEF]);
7295 } 7313 }
7296 void test_getterWithParameters() { 7314 void test_getterWithParameters() {
7297 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]); 7315 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
7298 } 7316 }
7299 void test_illegalAssignmentToNonAssignable_superAssigned() { 7317 void test_illegalAssignmentToNonAssignable_superAssigned() {
7300 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.MISS ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); 7318 ParserTestCase.parse5("parseExpression", "super = x;", [ParserErrorCode.MISS ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
7301 } 7319 }
7302 void test_implementsBeforeExtends() { 7320 void test_implementsBeforeExtends() {
7303 ParserTestCase.parse6("parseCompilationUnit", "class A implements B extends C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); 7321 ParserTestCase.parse5("parseCompilationUnit", "class A implements B extends C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]);
7304 } 7322 }
7305 void test_implementsBeforeWith() { 7323 void test_implementsBeforeWith() {
7306 ParserTestCase.parse6("parseCompilationUnit", "class A extends B implements C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); 7324 ParserTestCase.parse5("parseCompilationUnit", "class A extends B implements C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]);
7307 } 7325 }
7308 void test_importDirectiveAfterPartDirective() { 7326 void test_importDirectiveAfterPartDirective() {
7309 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; import 'b.dart ';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); 7327 ParserTestCase.parse5("parseCompilationUnit", "part 'a.dart'; import 'b.dart ';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
7310 } 7328 }
7311 void test_initializedVariableInForEach() { 7329 void test_initializedVariableInForEach() {
7312 ParserTestCase.parse6("parseForStatement", "for (int a = 0 in foo) {}", [Par serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); 7330 ParserTestCase.parse5("parseForStatement", "for (int a = 0 in foo) {}", [Par serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]);
7313 } 7331 }
7314 void test_invalidCodePoint() { 7332 void test_invalidCodePoint() {
7315 ParserTestCase.parse6("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN VALID_CODE_POINT]); 7333 ParserTestCase.parse5("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN VALID_CODE_POINT]);
7316 } 7334 }
7317 void test_invalidHexEscape_invalidDigit() { 7335 void test_invalidHexEscape_invalidDigit() {
7318 ParserTestCase.parse6("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV ALID_HEX_ESCAPE]); 7336 ParserTestCase.parse5("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV ALID_HEX_ESCAPE]);
7319 } 7337 }
7320 void test_invalidHexEscape_tooFewDigits() { 7338 void test_invalidHexEscape_tooFewDigits() {
7321 ParserTestCase.parse6("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL ID_HEX_ESCAPE]); 7339 ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL ID_HEX_ESCAPE]);
7322 } 7340 }
7323 void test_invalidOperatorForSuper() { 7341 void test_invalidOperatorForSuper() {
7324 ParserTestCase.parse6("parseUnaryExpression", "++super", [ParserErrorCode.IN VALID_OPERATOR_FOR_SUPER]); 7342 ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.IN VALID_OPERATOR_FOR_SUPER]);
7325 } 7343 }
7326 void test_invalidUnicodeEscape_incomplete_noDigits() { 7344 void test_invalidUnicodeEscape_incomplete_noDigits() {
7327 ParserTestCase.parse6("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL ID_UNICODE_ESCAPE]); 7345 ParserTestCase.parse5("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL ID_UNICODE_ESCAPE]);
7328 } 7346 }
7329 void test_invalidUnicodeEscape_incomplete_someDigits() { 7347 void test_invalidUnicodeEscape_incomplete_someDigits() {
7330 ParserTestCase.parse6("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]); 7348 ParserTestCase.parse5("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
7331 } 7349 }
7332 void test_invalidUnicodeEscape_invalidDigit() { 7350 void test_invalidUnicodeEscape_invalidDigit() {
7333 ParserTestCase.parse6("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]); 7351 ParserTestCase.parse5("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
7334 } 7352 }
7335 void test_invalidUnicodeEscape_tooFewDigits_fixed() { 7353 void test_invalidUnicodeEscape_tooFewDigits_fixed() {
7336 ParserTestCase.parse6("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]); 7354 ParserTestCase.parse5("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
7337 } 7355 }
7338 void test_invalidUnicodeEscape_tooFewDigits_variable() { 7356 void test_invalidUnicodeEscape_tooFewDigits_variable() {
7339 ParserTestCase.parse6("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]); 7357 ParserTestCase.parse5("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
7340 } 7358 }
7341 void test_invalidUnicodeEscape_tooManyDigits_variable() { 7359 void test_invalidUnicodeEscape_tooManyDigits_variable() {
7342 ParserTestCase.parse6("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); 7360 ParserTestCase.parse5("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]);
7343 } 7361 }
7344 void test_libraryDirectiveNotFirst() { 7362 void test_libraryDirectiveNotFirst() {
7345 ParserTestCase.parse6("parseCompilationUnit", "import 'x.dart'; library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); 7363 ParserTestCase.parse5("parseCompilationUnit", "import 'x.dart'; library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
7346 } 7364 }
7347 void test_libraryDirectiveNotFirst_afterPart() { 7365 void test_libraryDirectiveNotFirst_afterPart() {
7348 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part ' a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); 7366 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part ' a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
7349 JUnitTestCase.assertNotNull(unit); 7367 JUnitTestCase.assertNotNull(unit);
7350 } 7368 }
7351 void test_missingAssignableSelector_identifiersAssigned() { 7369 void test_missingAssignableSelector_identifiersAssigned() {
7352 ParserTestCase.parse6("parseExpression", "x.y = y;", []); 7370 ParserTestCase.parse5("parseExpression", "x.y = y;", []);
7353 } 7371 }
7354 void test_missingAssignableSelector_primarySelectorPostfix() { 7372 void test_missingAssignableSelector_primarySelectorPostfix() {
7355 ParserTestCase.parse6("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI NG_ASSIGNABLE_SELECTOR]); 7373 ParserTestCase.parse5("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI NG_ASSIGNABLE_SELECTOR]);
7356 } 7374 }
7357 void test_missingAssignableSelector_selector() { 7375 void test_missingAssignableSelector_selector() {
7358 ParserTestCase.parse6("parseExpression", "x(y)(z).a++", []); 7376 ParserTestCase.parse5("parseExpression", "x(y)(z).a++", []);
7359 } 7377 }
7360 void test_missingAssignableSelector_superPrimaryExpression() { 7378 void test_missingAssignableSelector_superPrimaryExpression() {
7361 SuperExpression expression = ParserTestCase.parse6("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); 7379 SuperExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
7362 JUnitTestCase.assertNotNull(expression.keyword); 7380 JUnitTestCase.assertNotNull(expression.keyword);
7363 } 7381 }
7364 void test_missingAssignableSelector_superPropertyAccessAssigned() { 7382 void test_missingAssignableSelector_superPropertyAccessAssigned() {
7365 ParserTestCase.parse6("parseExpression", "super.x = x;", []); 7383 ParserTestCase.parse5("parseExpression", "super.x = x;", []);
7366 } 7384 }
7367 void test_missingCatchOrFinally() { 7385 void test_missingCatchOrFinally() {
7368 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}" , [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); 7386 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}" , [ParserErrorCode.MISSING_CATCH_OR_FINALLY]);
7369 JUnitTestCase.assertNotNull(statement); 7387 JUnitTestCase.assertNotNull(statement);
7370 } 7388 }
7371 void test_missingClassBody() { 7389 void test_missingClassBody() {
7372 ParserTestCase.parse6("parseCompilationUnit", "class A class B {}", [ParserE rrorCode.MISSING_CLASS_BODY]); 7390 ParserTestCase.parse5("parseCompilationUnit", "class A class B {}", [ParserE rrorCode.MISSING_CLASS_BODY]);
7373 } 7391 }
7374 void test_missingConstFinalVarOrType() { 7392 void test_missingConstFinalVarOrType() {
7375 ParserTestCase.parse5("parseFinalConstVarOrType", <Object> [false], "a;", [P arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); 7393 ParserTestCase.parse4("parseFinalConstVarOrType", <Object> [false], "a;", [P arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
7376 } 7394 }
7377 void test_missingFunctionBody_emptyNotAllowed() { 7395 void test_missingFunctionBody_emptyNotAllowed() {
7378 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], ";", [Pa rserErrorCode.MISSING_FUNCTION_BODY]); 7396 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], ";", [Pa rserErrorCode.MISSING_FUNCTION_BODY]);
7379 } 7397 }
7380 void test_missingFunctionBody_invalid() { 7398 void test_missingFunctionBody_invalid() {
7381 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); 7399 ParserTestCase.parse4("parseFunctionBody", <Object> [false, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BODY]);
7382 } 7400 }
7383 void test_missingFunctionParameters_local_void_block() { 7401 void test_missingFunctionParameters_local_void_block() {
7384 ParserTestCase.parse6("parseStatement", "void f { return x;}", [ParserErrorC ode.MISSING_FUNCTION_PARAMETERS]); 7402 ParserTestCase.parse5("parseStatement", "void f { return x;}", [ParserErrorC ode.MISSING_FUNCTION_PARAMETERS]);
7385 } 7403 }
7386 void test_missingFunctionParameters_local_void_expression() { 7404 void test_missingFunctionParameters_local_void_expression() {
7387 ParserTestCase.parse6("parseStatement", "void f => x;", [ParserErrorCode.MIS SING_FUNCTION_PARAMETERS]); 7405 ParserTestCase.parse5("parseStatement", "void f => x;", [ParserErrorCode.MIS SING_FUNCTION_PARAMETERS]);
7388 } 7406 }
7389 void test_missingFunctionParameters_topLevel_nonVoid_block() { 7407 void test_missingFunctionParameters_topLevel_nonVoid_block() {
7390 ParserTestCase.parse6("parseCompilationUnit", "int f { return x;}", [ParserE rrorCode.MISSING_FUNCTION_PARAMETERS]); 7408 ParserTestCase.parse5("parseCompilationUnit", "int f { return x;}", [ParserE rrorCode.MISSING_FUNCTION_PARAMETERS]);
7391 } 7409 }
7392 void test_missingFunctionParameters_topLevel_nonVoid_expression() { 7410 void test_missingFunctionParameters_topLevel_nonVoid_expression() {
7393 ParserTestCase.parse6("parseCompilationUnit", "int f => x;", [ParserErrorCod e.MISSING_FUNCTION_PARAMETERS]); 7411 ParserTestCase.parse5("parseCompilationUnit", "int f => x;", [ParserErrorCod e.MISSING_FUNCTION_PARAMETERS]);
7394 } 7412 }
7395 void test_missingFunctionParameters_topLevel_void_block() { 7413 void test_missingFunctionParameters_topLevel_void_block() {
7396 ParserTestCase.parse6("parseCompilationUnit", "void f { return x;}", [Parser ErrorCode.MISSING_FUNCTION_PARAMETERS]); 7414 ParserTestCase.parse5("parseCompilationUnit", "void f { return x;}", [Parser ErrorCode.MISSING_FUNCTION_PARAMETERS]);
7397 } 7415 }
7398 void test_missingFunctionParameters_topLevel_void_expression() { 7416 void test_missingFunctionParameters_topLevel_void_expression() {
7399 ParserTestCase.parse6("parseCompilationUnit", "void f => x;", [ParserErrorCo de.MISSING_FUNCTION_PARAMETERS]); 7417 ParserTestCase.parse5("parseCompilationUnit", "void f => x;", [ParserErrorCo de.MISSING_FUNCTION_PARAMETERS]);
7400 } 7418 }
7401 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { 7419 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
7402 ParserTestCase.parse6("parseFunctionDeclarationStatement", "A<T> () {}", [Pa rserErrorCode.MISSING_IDENTIFIER]); 7420 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa rserErrorCode.MISSING_IDENTIFIER]);
7403 } 7421 }
7404 void test_missingIdentifier_number() { 7422 void test_missingIdentifier_number() {
7405 SimpleIdentifier expression = ParserTestCase.parse6("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]); 7423 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
7406 JUnitTestCase.assertTrue(expression.isSynthetic()); 7424 JUnitTestCase.assertTrue(expression.isSynthetic());
7407 } 7425 }
7408 void test_missingNameInLibraryDirective() { 7426 void test_missingNameInLibraryDirective() {
7409 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); 7427 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
7410 JUnitTestCase.assertNotNull(unit); 7428 JUnitTestCase.assertNotNull(unit);
7411 } 7429 }
7412 void test_missingNameInPartOfDirective() { 7430 void test_missingNameInPartOfDirective() {
7413 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); 7431 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]);
7414 JUnitTestCase.assertNotNull(unit); 7432 JUnitTestCase.assertNotNull(unit);
7415 } 7433 }
7416 void test_missingTerminatorForParameterGroup_named() { 7434 void test_missingTerminatorForParameterGroup_named() {
7417 ParserTestCase.parse6("parseFormalParameterList", "(a, {b: 0)", [ParserError Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); 7435 ParserTestCase.parse5("parseFormalParameterList", "(a, {b: 0)", [ParserError Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
7418 } 7436 }
7419 void test_missingTerminatorForParameterGroup_optional() { 7437 void test_missingTerminatorForParameterGroup_optional() {
7420 ParserTestCase.parse6("parseFormalParameterList", "(a, [b = 0)", [ParserErro rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); 7438 ParserTestCase.parse5("parseFormalParameterList", "(a, [b = 0)", [ParserErro rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
7421 } 7439 }
7422 void test_missingTypedefParameters_nonVoid() { 7440 void test_missingTypedefParameters_nonVoid() {
7423 ParserTestCase.parse6("parseCompilationUnit", "typedef int F;", [ParserError Code.MISSING_TYPEDEF_PARAMETERS]); 7441 ParserTestCase.parse5("parseCompilationUnit", "typedef int F;", [ParserError Code.MISSING_TYPEDEF_PARAMETERS]);
7424 } 7442 }
7425 void test_missingTypedefParameters_typeParameters() { 7443 void test_missingTypedefParameters_typeParameters() {
7426 ParserTestCase.parse6("parseCompilationUnit", "typedef F<E>;", [ParserErrorC ode.MISSING_TYPEDEF_PARAMETERS]); 7444 ParserTestCase.parse5("parseCompilationUnit", "typedef F<E>;", [ParserErrorC ode.MISSING_TYPEDEF_PARAMETERS]);
7427 } 7445 }
7428 void test_missingTypedefParameters_void() { 7446 void test_missingTypedefParameters_void() {
7429 ParserTestCase.parse6("parseCompilationUnit", "typedef void F;", [ParserErro rCode.MISSING_TYPEDEF_PARAMETERS]); 7447 ParserTestCase.parse5("parseCompilationUnit", "typedef void F;", [ParserErro rCode.MISSING_TYPEDEF_PARAMETERS]);
7430 } 7448 }
7431 void test_missingVariableInForEach() { 7449 void test_missingVariableInForEach() {
7432 ParserTestCase.parse6("parseForStatement", "for (a < b in foo) {}", [ParserE rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); 7450 ParserTestCase.parse5("parseForStatement", "for (a < b in foo) {}", [ParserE rrorCode.MISSING_VARIABLE_IN_FOR_EACH]);
7433 } 7451 }
7434 void test_mixedParameterGroups_namedPositional() { 7452 void test_mixedParameterGroups_namedPositional() {
7435 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, [c])", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]); 7453 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, [c])", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
7436 } 7454 }
7437 void test_mixedParameterGroups_positionalNamed() { 7455 void test_mixedParameterGroups_positionalNamed() {
7438 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], {c})", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]); 7456 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], {c})", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
7439 } 7457 }
7440 void test_multipleLibraryDirectives() { 7458 void test_multipleLibraryDirectives() {
7441 ParserTestCase.parse6("parseCompilationUnit", "library l; library m;", [Pars erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); 7459 ParserTestCase.parse5("parseCompilationUnit", "library l; library m;", [Pars erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]);
7442 } 7460 }
7443 void test_multipleNamedParameterGroups() { 7461 void test_multipleNamedParameterGroups() {
7444 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, {c})", [ParserEr rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); 7462 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, {c})", [ParserEr rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]);
7445 } 7463 }
7446 void test_multiplePartOfDirectives() { 7464 void test_multiplePartOfDirectives() {
7447 ParserTestCase.parse6("parseCompilationUnit", "part of l; part of m;", [Pars erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); 7465 ParserTestCase.parse5("parseCompilationUnit", "part of l; part of m;", [Pars erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]);
7448 } 7466 }
7449 void test_multiplePositionalParameterGroups() { 7467 void test_multiplePositionalParameterGroups() {
7450 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], [c])", [ParserEr rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); 7468 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], [c])", [ParserEr rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]);
7451 } 7469 }
7452 void test_multipleVariablesInForEach() { 7470 void test_multipleVariablesInForEach() {
7453 ParserTestCase.parse6("parseForStatement", "for (int a, b in foo) {}", [Pars erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); 7471 ParserTestCase.parse5("parseForStatement", "for (int a, b in foo) {}", [Pars erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]);
7454 } 7472 }
7455 void test_namedParameterOutsideGroup() { 7473 void test_namedParameterOutsideGroup() {
7456 ParserTestCase.parse6("parseFormalParameterList", "(a, b : 0)", [ParserError Code.NAMED_PARAMETER_OUTSIDE_GROUP]); 7474 ParserTestCase.parse5("parseFormalParameterList", "(a, b : 0)", [ParserError Code.NAMED_PARAMETER_OUTSIDE_GROUP]);
7457 } 7475 }
7458 void test_nonConstructorFactory_field() { 7476 void test_nonConstructorFactory_field() {
7459 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); 7477 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
7460 } 7478 }
7461 void test_nonConstructorFactory_method() { 7479 void test_nonConstructorFactory_method() {
7462 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int m() { }", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); 7480 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int m() { }", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
7463 } 7481 }
7464 void test_nonIdentifierLibraryName_library() { 7482 void test_nonIdentifierLibraryName_library() {
7465 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); 7483 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
7466 JUnitTestCase.assertNotNull(unit); 7484 JUnitTestCase.assertNotNull(unit);
7467 } 7485 }
7468 void test_nonIdentifierLibraryName_partOf() { 7486 void test_nonIdentifierLibraryName_partOf() {
7469 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); 7487 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "part o f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
7470 JUnitTestCase.assertNotNull(unit); 7488 JUnitTestCase.assertNotNull(unit);
7471 } 7489 }
7472 void test_nonPartOfDirectiveInPart_after() { 7490 void test_nonPartOfDirectiveInPart_after() {
7473 ParserTestCase.parse6("parseCompilationUnit", "part of l; part 'f.dart';", [ ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); 7491 ParserTestCase.parse5("parseCompilationUnit", "part of l; part 'f.dart';", [ ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
7474 } 7492 }
7475 void test_nonPartOfDirectiveInPart_before() { 7493 void test_nonPartOfDirectiveInPart_before() {
7476 ParserTestCase.parse6("parseCompilationUnit", "part 'f.dart'; part of m;", [ ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); 7494 ParserTestCase.parse5("parseCompilationUnit", "part 'f.dart'; part of m;", [ ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]);
7477 } 7495 }
7478 void test_nonUserDefinableOperator() { 7496 void test_nonUserDefinableOperator() {
7479 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "operator +=(int x ) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); 7497 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "operator +=(int x ) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]);
7480 } 7498 }
7481 void test_positionalAfterNamedArgument() { 7499 void test_positionalAfterNamedArgument() {
7482 ParserTestCase.parse6("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS ITIONAL_AFTER_NAMED_ARGUMENT]); 7500 ParserTestCase.parse5("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS ITIONAL_AFTER_NAMED_ARGUMENT]);
7483 } 7501 }
7484 void test_positionalParameterOutsideGroup() { 7502 void test_positionalParameterOutsideGroup() {
7485 ParserTestCase.parse6("parseFormalParameterList", "(a, b = 0)", [ParserError Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); 7503 ParserTestCase.parse5("parseFormalParameterList", "(a, b = 0)", [ParserError Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
7486 } 7504 }
7487 void test_staticAfterConst() { 7505 void test_staticAfterConst() {
7488 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]); 7506 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]);
7489 } 7507 }
7490 void test_staticAfterFinal() { 7508 void test_staticAfterFinal() {
7491 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]); 7509 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]);
7492 } 7510 }
7493 void test_staticAfterVar() { 7511 void test_staticAfterVar() {
7494 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var static f;", [ ParserErrorCode.STATIC_AFTER_VAR]); 7512 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var static f;", [ ParserErrorCode.STATIC_AFTER_VAR]);
7495 } 7513 }
7496 void test_staticConstructor() { 7514 void test_staticConstructor() {
7497 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]); 7515 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]);
7498 } 7516 }
7499 void test_staticOperator_noReturnType() { 7517 void test_staticOperator_noReturnType() {
7500 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static operator + (int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); 7518 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static operator + (int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
7501 } 7519 }
7502 void test_staticOperator_returnType() { 7520 void test_staticOperator_returnType() {
7503 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static int operat or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); 7521 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static int operat or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
7504 } 7522 }
7505 void test_staticTopLevelDeclaration_class() { 7523 void test_staticTopLevelDeclaration_class() {
7506 ParserTestCase.parse6("parseCompilationUnit", "static class C {}", [ParserEr rorCode.STATIC_TOP_LEVEL_DECLARATION]); 7524 ParserTestCase.parse5("parseCompilationUnit", "static class C {}", [ParserEr rorCode.STATIC_TOP_LEVEL_DECLARATION]);
7507 } 7525 }
7508 void test_staticTopLevelDeclaration_typedef() { 7526 void test_staticTopLevelDeclaration_typedef() {
7509 ParserTestCase.parse6("parseCompilationUnit", "static typedef F();", [Parser ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); 7527 ParserTestCase.parse5("parseCompilationUnit", "static typedef F();", [Parser ErrorCode.STATIC_TOP_LEVEL_DECLARATION]);
7510 } 7528 }
7511 void test_staticTopLevelDeclaration_variable() { 7529 void test_staticTopLevelDeclaration_variable() {
7512 ParserTestCase.parse6("parseCompilationUnit", "static var x;", [ParserErrorC ode.STATIC_TOP_LEVEL_DECLARATION]); 7530 ParserTestCase.parse5("parseCompilationUnit", "static var x;", [ParserErrorC ode.STATIC_TOP_LEVEL_DECLARATION]);
7513 } 7531 }
7514 void test_unexpectedTerminatorForParameterGroup_named() { 7532 void test_unexpectedTerminatorForParameterGroup_named() {
7515 ParserTestCase.parse6("parseFormalParameterList", "(a, b})", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); 7533 ParserTestCase.parse5("parseFormalParameterList", "(a, b})", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
7516 } 7534 }
7517 void test_unexpectedTerminatorForParameterGroup_optional() { 7535 void test_unexpectedTerminatorForParameterGroup_optional() {
7518 ParserTestCase.parse6("parseFormalParameterList", "(a, b])", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); 7536 ParserTestCase.parse5("parseFormalParameterList", "(a, b])", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
7519 } 7537 }
7520 void test_unexpectedToken_semicolonBetweenClassMembers() { 7538 void test_unexpectedToken_semicolonBetweenClassMembers() {
7521 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]) ; 7539 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]) ;
7522 } 7540 }
7523 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { 7541 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() {
7524 ParserTestCase.parse6("parseCompilationUnit", "int x; ; int y;", [ParserErro rCode.UNEXPECTED_TOKEN]); 7542 ParserTestCase.parse5("parseCompilationUnit", "int x; ; int y;", [ParserErro rCode.UNEXPECTED_TOKEN]);
7525 } 7543 }
7526 void test_useOfUnaryPlusOperator() { 7544 void test_useOfUnaryPlusOperator() {
7527 ParserTestCase.parse6("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_ UNARY_PLUS_OPERATOR]); 7545 ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_ UNARY_PLUS_OPERATOR]);
7528 } 7546 }
7529 void test_varClass() { 7547 void test_varClass() {
7530 ParserTestCase.parse6("parseCompilationUnit", "var class C {}", [ParserError Code.VAR_CLASS]); 7548 ParserTestCase.parse5("parseCompilationUnit", "var class C {}", [ParserError Code.VAR_CLASS]);
7531 } 7549 }
7532 void test_varConstructor() { 7550 void test_varConstructor() {
7533 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var C() {}", [Par serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); 7551 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var C() {}", [Par serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
7534 } 7552 }
7535 void test_varReturnType() { 7553 void test_varReturnType() {
7536 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var m() {}", [Par serErrorCode.VAR_RETURN_TYPE]); 7554 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par serErrorCode.VAR_RETURN_TYPE]);
7537 } 7555 }
7538 void test_varTypedef() { 7556 void test_varTypedef() {
7539 ParserTestCase.parse6("parseCompilationUnit", "var typedef F();", [ParserErr orCode.VAR_TYPEDEF]); 7557 ParserTestCase.parse5("parseCompilationUnit", "var typedef F();", [ParserErr orCode.VAR_TYPEDEF]);
7540 } 7558 }
7541 void test_voidField_initializer() { 7559 void test_voidField_initializer() {
7542 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x = 0;", [Pa rserErrorCode.VOID_VARIABLE]); 7560 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x = 0;", [Pa rserErrorCode.VOID_VARIABLE]);
7543 } 7561 }
7544 void test_voidField_noInitializer() { 7562 void test_voidField_noInitializer() {
7545 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x;", [Parser ErrorCode.VOID_VARIABLE]); 7563 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x;", [Parser ErrorCode.VOID_VARIABLE]);
7546 } 7564 }
7547 void test_voidParameter() { 7565 void test_voidParameter() {
7548 ParserTestCase.parse6("parseNormalFormalParameter", "void a)", [ParserErrorC ode.VOID_PARAMETER]); 7566 ParserTestCase.parse5("parseNormalFormalParameter", "void a)", [ParserErrorC ode.VOID_PARAMETER]);
7549 } 7567 }
7550 void test_withBeforeExtends() { 7568 void test_withBeforeExtends() {
7551 ParserTestCase.parse6("parseCompilationUnit", "class A with B extends C {}", [ParserErrorCode.WITH_BEFORE_EXTENDS]); 7569 ParserTestCase.parse5("parseCompilationUnit", "class A with B extends C {}", [ParserErrorCode.WITH_BEFORE_EXTENDS]);
7552 } 7570 }
7553 void test_withWithoutExtends() { 7571 void test_withWithoutExtends() {
7554 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); 7572 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
7555 } 7573 }
7556 void test_wrongSeparatorForNamedParameter() { 7574 void test_wrongSeparatorForNamedParameter() {
7557 ParserTestCase.parse6("parseFormalParameterList", "(a, {b = 0})", [ParserErr orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); 7575 ParserTestCase.parse5("parseFormalParameterList", "(a, {b = 0})", [ParserErr orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
7558 } 7576 }
7559 void test_wrongSeparatorForPositionalParameter() { 7577 void test_wrongSeparatorForPositionalParameter() {
7560 ParserTestCase.parse6("parseFormalParameterList", "(a, [b : 0])", [ParserErr orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); 7578 ParserTestCase.parse5("parseFormalParameterList", "(a, [b : 0])", [ParserErr orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]);
7561 } 7579 }
7562 void test_wrongTerminatorForParameterGroup_named() { 7580 void test_wrongTerminatorForParameterGroup_named() {
7563 ParserTestCase.parse6("parseFormalParameterList", "(a, {b, c])", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); 7581 ParserTestCase.parse5("parseFormalParameterList", "(a, {b, c])", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
7564 } 7582 }
7565 void test_wrongTerminatorForParameterGroup_optional() { 7583 void test_wrongTerminatorForParameterGroup_optional() {
7566 ParserTestCase.parse6("parseFormalParameterList", "(a, [b, c})", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); 7584 ParserTestCase.parse5("parseFormalParameterList", "(a, [b, c})", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
7567 } 7585 }
7568 static dartSuite() { 7586 static dartSuite() {
7569 _ut.group('ErrorParserTest', () { 7587 _ut.group('ErrorParserTest', () {
7570 _ut.test('test_abstractClassMember_constructor', () { 7588 _ut.test('test_abstractClassMember_constructor', () {
7571 final __test = new ErrorParserTest(); 7589 final __test = new ErrorParserTest();
7572 runJUnitTest(__test, __test.test_abstractClassMember_constructor); 7590 runJUnitTest(__test, __test.test_abstractClassMember_constructor);
7573 }); 7591 });
7574 _ut.test('test_abstractClassMember_field', () { 7592 _ut.test('test_abstractClassMember_field', () {
7575 final __test = new ErrorParserTest(); 7593 final __test = new ErrorParserTest();
7576 runJUnitTest(__test, __test.test_abstractClassMember_field); 7594 runJUnitTest(__test, __test.test_abstractClassMember_field);
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
8261 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseCommentReference(arg0, arg1)), 8279 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.parseCommentReference(arg0, arg1)),
8262 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.parseCommentReferences(arg0)), 8280 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.parseCommentReferences(arg0)),
8263 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()), 8281 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa rseCompilationUnit2()),
8264 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseCompilationUnitMember(arg0)), 8282 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseCompilationUnitMember(arg0)),
8265 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar get.parseConditionalExpression()), 8283 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar get.parseConditionalExpression()),
8266 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstExpression()), 8284 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstExpression()),
8267 '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)), 8285 '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)),
8268 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target.parseConstructorFieldInitializer()), 8286 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target) => target.parseConstructorFieldInitializer()),
8269 'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstructorName()), 8287 'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.pa rseConstructorName()),
8270 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. parseContinueStatement()), 8288 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target. parseContinueStatement()),
8271 'parseDeclaredIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseDeclaredIdentifier(arg0)),
8272 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseDirective(arg0)), 8289 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseDirective(arg0)),
8273 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et.parseDocumentationComment()), 8290 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ et.parseDocumentationComment()),
8274 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target.parseD oStatement()), 8291 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target.parseD oStatement()),
8275 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target.par seEmptyStatement()), 8292 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target.par seEmptyStatement()),
8276 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target .parseEqualityExpression()), 8293 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target .parseEqualityExpression()),
8277 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseExportDirective(arg0)), 8294 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.parseExportDirective(arg0)),
8278 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx pression2()), 8295 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx pression2()),
8279 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par seExpressionList()), 8296 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par seExpressionList()),
8280 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target.parseExpressionWithoutCascade()), 8297 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) => target.parseExpressionWithoutCascade()),
8281 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars eExtendsClause()), 8298 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars eExtendsClause()),
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
8313 'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => targe t.parseNonLabeledStatement()), 8330 'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => targe t.parseNonLabeledStatement()),
8314 'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => tar get.parseNormalFormalParameter()), 8331 'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => tar get.parseNormalFormalParameter()),
8315 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) = > target.parseOperator(arg0, arg1, arg2)), 8332 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) = > target.parseOperator(arg0, arg1, arg2)),
8316 'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target .parseOptionalReturnType()), 8333 'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target .parseOptionalReturnType()),
8317 'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.parsePartDirective(arg0)), 8334 'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.parsePartDirective(arg0)),
8318 'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePostfixExpression()), 8335 'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePostfixExpression()),
8319 'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target .parsePrefixedIdentifier()), 8336 'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target .parsePrefixedIdentifier()),
8320 'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePrimaryExpression()), 8337 'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target. parsePrimaryExpression()),
8321 'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser tar get) => target.parseRedirectingConstructorInvocation()), 8338 'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser tar get) => target.parseRedirectingConstructorInvocation()),
8322 'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseRelationalExpression()), 8339 'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => targ et.parseRelationalExpression()),
8340 'parseRethrowExpression_0': new MethodTrampoline(0, (Parser target) => target. parseRethrowExpression()),
8323 'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseReturnStatement()), 8341 'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseReturnStatement()),
8324 'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseRe turnType()), 8342 'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseRe turnType()),
8325 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseSetter(arg0, arg1, arg2, arg3)), 8343 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg 3) => target.parseSetter(arg0, arg1, arg2, arg3)),
8326 'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseShiftExpression()), 8344 'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseShiftExpression()),
8327 'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.p arseSimpleIdentifier()), 8345 'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.p arseSimpleIdentifier()),
8328 'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseSta tement2()), 8346 'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseSta tement2()),
8329 'parseStatements_0': new MethodTrampoline(0, (Parser target) => target.parseSt atements2()), 8347 'parseStatements_0': new MethodTrampoline(0, (Parser target) => target.parseSt atements2()),
8330 'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStringInterpolation(arg0)), 8348 'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseStringInterpolation(arg0)),
8331 'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eStringLiteral()), 8349 'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars eStringLiteral()),
8332 'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) = > target.parseSuperConstructorInvocation()), 8350 'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) = > target.parseSuperConstructorInvocation()),
8333 'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseSwitchStatement()), 8351 'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target.pa rseSwitchStatement()),
8334 'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseThrowExpression()), 8352 'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseThrowExpression()),
8335 'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target ) => target.parseThrowExpressionWithoutCascade()), 8353 'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target ) => target.parseThrowExpressionWithoutCascade()),
8336 'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target.parse TryStatement()), 8354 'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target.parse TryStatement()),
8337 'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseTypeAlias(arg0)), 8355 'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa rseTypeAlias(arg0)),
8338 'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.p arseTypeArgumentList()), 8356 'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.p arseTypeArgumentList()),
8339 'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseType Name()), 8357 'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseType Name()),
8340 'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.pars eTypeParameter()), 8358 'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.pars eTypeParameter()),
8341 'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target. parseTypeParameterList()), 8359 'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target. parseTypeParameterList()),
8342 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseUnaryExpression()), 8360 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa rseUnaryExpression()),
8343 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe t.parseVariableDeclaration()), 8361 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe t.parseVariableDeclaration()),
8344 'parseVariableDeclarationList_0': new MethodTrampoline(0, (Parser target) => t arget.parseVariableDeclarationList()), 8362 'parseVariableDeclarationList_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.parseVariableDeclarationList(arg0)),
8345 'parseVariableDeclarationList_2': new MethodTrampoline(2, (Parser target, arg0 , arg1) => target.parseVariableDeclarationList2(arg0, arg1)), 8363 'parseVariableDeclarationList_3': new MethodTrampoline(3, (Parser target, arg0 , arg1, arg2) => target.parseVariableDeclarationList2(arg0, arg1, arg2)),
8346 'parseVariableDeclarationStatement_0': new MethodTrampoline(0, (Parser target) => target.parseVariableDeclarationStatement()), 8364 'parseVariableDeclarationStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.parseVariableDeclarationStatement(arg0)),
8347 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par seWhileStatement()), 8365 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par seWhileStatement()),
8348 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi thClause()), 8366 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi thClause()),
8349 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()), 8367 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()),
8350 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0)) , 8368 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0)) ,
8351 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.reportError(arg0, arg1, arg2)), 8369 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) => target.reportError(arg0, arg1, arg2)),
8352 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target .reportError4(arg0, arg1)), 8370 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target .reportError4(arg0, arg1)),
8353 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFinalConstVarOrType(arg0)), 8371 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFinalConstVarOrType(arg0)),
8354 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFormalParameterList(arg0)), 8372 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => target.skipFormalParameterList(arg0)),
8355 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipPastMatchingToken(arg0)), 8373 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta rget.skipPastMatchingToken(arg0)),
8356 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.skipPrefixedIdentifier(arg0)), 8374 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t arget.skipPrefixedIdentifier(arg0)),
(...skipping 15 matching lines...) Expand all
8372 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), 8390 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)),
8373 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), 8391 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)),
8374 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),}; 8392 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),};
8375 8393
8376 8394
8377 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) { 8395 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) {
8378 parser.currentToken = tokenStream; 8396 parser.currentToken = tokenStream;
8379 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} ']; 8397 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} '];
8380 return method.invoke(parser, objects); 8398 return method.invoke(parser, objects);
8381 } 8399 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698