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

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

Issue 184893003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser_test; 8 library engine.parser_test;
9 9
10 import 'package:analyzer/src/generated/java_core.dart'; 10 import 'package:analyzer/src/generated/java_core.dart';
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 void test_isSwitchMember_default_unlabeled() { 290 void test_isSwitchMember_default_unlabeled() {
291 JUnitTestCase.assertTrue(isSwitchMember("default")); 291 JUnitTestCase.assertTrue(isSwitchMember("default"));
292 } 292 }
293 293
294 void test_isSwitchMember_false() { 294 void test_isSwitchMember_false() {
295 JUnitTestCase.assertFalse(isSwitchMember("break;")); 295 JUnitTestCase.assertFalse(isSwitchMember("break;"));
296 } 296 }
297 297
298 void test_parseAdditiveExpression_normal() { 298 void test_parseAdditiveExpression_normal() {
299 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "x + y", []); 299 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression ", "x + y", []);
300 JUnitTestCase.assertNotNull(expression.leftOperand); 300 JUnitTestCase.assertNotNull(expression.leftOperand);
301 JUnitTestCase.assertNotNull(expression.operator); 301 JUnitTestCase.assertNotNull(expression.operator);
302 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); 302 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
303 JUnitTestCase.assertNotNull(expression.rightOperand); 303 JUnitTestCase.assertNotNull(expression.rightOperand);
304 } 304 }
305 305
306 void test_parseAdditiveExpression_super() { 306 void test_parseAdditiveExpression_super() {
307 BinaryExpression expression = ParserTestCase.parse5("parseAdditiveExpression ", "super + y", []); 307 BinaryExpression expression = ParserTestCase.parse4("parseAdditiveExpression ", "super + y", []);
308 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 308 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
309 JUnitTestCase.assertNotNull(expression.operator); 309 JUnitTestCase.assertNotNull(expression.operator);
310 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); 310 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type);
311 JUnitTestCase.assertNotNull(expression.rightOperand); 311 JUnitTestCase.assertNotNull(expression.rightOperand);
312 } 312 }
313 313
314 void test_parseAnnotation_n1() { 314 void test_parseAnnotation_n1() {
315 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A", []); 315 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A", []);
316 JUnitTestCase.assertNotNull(annotation.atSign); 316 JUnitTestCase.assertNotNull(annotation.atSign);
317 JUnitTestCase.assertNotNull(annotation.name); 317 JUnitTestCase.assertNotNull(annotation.name);
318 JUnitTestCase.assertNull(annotation.period); 318 JUnitTestCase.assertNull(annotation.period);
319 JUnitTestCase.assertNull(annotation.constructorName); 319 JUnitTestCase.assertNull(annotation.constructorName);
320 JUnitTestCase.assertNull(annotation.arguments); 320 JUnitTestCase.assertNull(annotation.arguments);
321 } 321 }
322 322
323 void test_parseAnnotation_n1_a() { 323 void test_parseAnnotation_n1_a() {
324 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A(x,y)", []); 324 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A(x,y)", []);
325 JUnitTestCase.assertNotNull(annotation.atSign); 325 JUnitTestCase.assertNotNull(annotation.atSign);
326 JUnitTestCase.assertNotNull(annotation.name); 326 JUnitTestCase.assertNotNull(annotation.name);
327 JUnitTestCase.assertNull(annotation.period); 327 JUnitTestCase.assertNull(annotation.period);
328 JUnitTestCase.assertNull(annotation.constructorName); 328 JUnitTestCase.assertNull(annotation.constructorName);
329 JUnitTestCase.assertNotNull(annotation.arguments); 329 JUnitTestCase.assertNotNull(annotation.arguments);
330 } 330 }
331 331
332 void test_parseAnnotation_n2() { 332 void test_parseAnnotation_n2() {
333 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B", []) ; 333 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B", []) ;
334 JUnitTestCase.assertNotNull(annotation.atSign); 334 JUnitTestCase.assertNotNull(annotation.atSign);
335 JUnitTestCase.assertNotNull(annotation.name); 335 JUnitTestCase.assertNotNull(annotation.name);
336 JUnitTestCase.assertNull(annotation.period); 336 JUnitTestCase.assertNull(annotation.period);
337 JUnitTestCase.assertNull(annotation.constructorName); 337 JUnitTestCase.assertNull(annotation.constructorName);
338 JUnitTestCase.assertNull(annotation.arguments); 338 JUnitTestCase.assertNull(annotation.arguments);
339 } 339 }
340 340
341 void test_parseAnnotation_n2_a() { 341 void test_parseAnnotation_n2_a() {
342 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B(x,y)" , []); 342 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B(x,y)" , []);
343 JUnitTestCase.assertNotNull(annotation.atSign); 343 JUnitTestCase.assertNotNull(annotation.atSign);
344 JUnitTestCase.assertNotNull(annotation.name); 344 JUnitTestCase.assertNotNull(annotation.name);
345 JUnitTestCase.assertNull(annotation.period); 345 JUnitTestCase.assertNull(annotation.period);
346 JUnitTestCase.assertNull(annotation.constructorName); 346 JUnitTestCase.assertNull(annotation.constructorName);
347 JUnitTestCase.assertNotNull(annotation.arguments); 347 JUnitTestCase.assertNotNull(annotation.arguments);
348 } 348 }
349 349
350 void test_parseAnnotation_n3() { 350 void test_parseAnnotation_n3() {
351 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C", [ ]); 351 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C", [ ]);
352 JUnitTestCase.assertNotNull(annotation.atSign); 352 JUnitTestCase.assertNotNull(annotation.atSign);
353 JUnitTestCase.assertNotNull(annotation.name); 353 JUnitTestCase.assertNotNull(annotation.name);
354 JUnitTestCase.assertNotNull(annotation.period); 354 JUnitTestCase.assertNotNull(annotation.period);
355 JUnitTestCase.assertNotNull(annotation.constructorName); 355 JUnitTestCase.assertNotNull(annotation.constructorName);
356 JUnitTestCase.assertNull(annotation.arguments); 356 JUnitTestCase.assertNull(annotation.arguments);
357 } 357 }
358 358
359 void test_parseAnnotation_n3_a() { 359 void test_parseAnnotation_n3_a() {
360 Annotation annotation = ParserTestCase.parse5("parseAnnotation", "@A.B.C(x,y )", []); 360 Annotation annotation = ParserTestCase.parse4("parseAnnotation", "@A.B.C(x,y )", []);
361 JUnitTestCase.assertNotNull(annotation.atSign); 361 JUnitTestCase.assertNotNull(annotation.atSign);
362 JUnitTestCase.assertNotNull(annotation.name); 362 JUnitTestCase.assertNotNull(annotation.name);
363 JUnitTestCase.assertNotNull(annotation.period); 363 JUnitTestCase.assertNotNull(annotation.period);
364 JUnitTestCase.assertNotNull(annotation.constructorName); 364 JUnitTestCase.assertNotNull(annotation.constructorName);
365 JUnitTestCase.assertNotNull(annotation.arguments); 365 JUnitTestCase.assertNotNull(annotation.arguments);
366 } 366 }
367 367
368 void test_parseArgument_named() { 368 void test_parseArgument_named() {
369 NamedExpression expression = ParserTestCase.parse5("parseArgument", "n: x", []); 369 NamedExpression expression = ParserTestCase.parse4("parseArgument", "n: x", []);
370 Label name = expression.name; 370 Label name = expression.name;
371 JUnitTestCase.assertNotNull(name); 371 JUnitTestCase.assertNotNull(name);
372 JUnitTestCase.assertNotNull(name.label); 372 JUnitTestCase.assertNotNull(name.label);
373 JUnitTestCase.assertNotNull(name.colon); 373 JUnitTestCase.assertNotNull(name.colon);
374 JUnitTestCase.assertNotNull(expression.expression); 374 JUnitTestCase.assertNotNull(expression.expression);
375 } 375 }
376 376
377 void test_parseArgument_unnamed() { 377 void test_parseArgument_unnamed() {
378 String lexeme = "x"; 378 String lexeme = "x";
379 SimpleIdentifier identifier = ParserTestCase.parse5("parseArgument", lexeme, []); 379 SimpleIdentifier identifier = ParserTestCase.parse4("parseArgument", lexeme, []);
380 JUnitTestCase.assertEquals(lexeme, identifier.name); 380 JUnitTestCase.assertEquals(lexeme, identifier.name);
381 } 381 }
382 382
383 void test_parseArgumentDefinitionTest() { 383 void test_parseArgumentDefinitionTest() {
384 ArgumentDefinitionTest test = ParserTestCase.parse5("parseArgumentDefinition Test", "?x", [ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST]); 384 ArgumentDefinitionTest test = ParserTestCase.parse4("parseArgumentDefinition Test", "?x", [ParserErrorCode.DEPRECATED_ARGUMENT_DEFINITION_TEST]);
385 JUnitTestCase.assertNotNull(test.question); 385 JUnitTestCase.assertNotNull(test.question);
386 JUnitTestCase.assertNotNull(test.identifier); 386 JUnitTestCase.assertNotNull(test.identifier);
387 } 387 }
388 388
389 void test_parseArgumentList_empty() { 389 void test_parseArgumentList_empty() {
390 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "()", []); 390 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "()", []);
391 NodeList<Expression> arguments = argumentList.arguments; 391 NodeList<Expression> arguments = argumentList.arguments;
392 EngineTestCase.assertSize(0, arguments); 392 EngineTestCase.assertSize(0, arguments);
393 } 393 }
394 394
395 void test_parseArgumentList_mixed() { 395 void test_parseArgumentList_mixed() {
396 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(w, x, y: y, z: z)", []); 396 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(w, x, y: y, z: z)", []);
397 NodeList<Expression> arguments = argumentList.arguments; 397 NodeList<Expression> arguments = argumentList.arguments;
398 EngineTestCase.assertSize(4, arguments); 398 EngineTestCase.assertSize(4, arguments);
399 } 399 }
400 400
401 void test_parseArgumentList_noNamed() { 401 void test_parseArgumentList_noNamed() {
402 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x, y, z)", []); 402 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x, y, z)", []);
403 NodeList<Expression> arguments = argumentList.arguments; 403 NodeList<Expression> arguments = argumentList.arguments;
404 EngineTestCase.assertSize(3, arguments); 404 EngineTestCase.assertSize(3, arguments);
405 } 405 }
406 406
407 void test_parseArgumentList_onlyNamed() { 407 void test_parseArgumentList_onlyNamed() {
408 ArgumentList argumentList = ParserTestCase.parse5("parseArgumentList", "(x: x, y: y)", []); 408 ArgumentList argumentList = ParserTestCase.parse4("parseArgumentList", "(x: x, y: y)", []);
409 NodeList<Expression> arguments = argumentList.arguments; 409 NodeList<Expression> arguments = argumentList.arguments;
410 EngineTestCase.assertSize(2, arguments); 410 EngineTestCase.assertSize(2, arguments);
411 } 411 }
412 412
413 void test_parseAssertStatement() { 413 void test_parseAssertStatement() {
414 AssertStatement statement = ParserTestCase.parse5("parseAssertStatement", "a ssert (x);", []); 414 AssertStatement statement = ParserTestCase.parse4("parseAssertStatement", "a ssert (x);", []);
415 JUnitTestCase.assertNotNull(statement.keyword); 415 JUnitTestCase.assertNotNull(statement.keyword);
416 JUnitTestCase.assertNotNull(statement.leftParenthesis); 416 JUnitTestCase.assertNotNull(statement.leftParenthesis);
417 JUnitTestCase.assertNotNull(statement.condition); 417 JUnitTestCase.assertNotNull(statement.condition);
418 JUnitTestCase.assertNotNull(statement.rightParenthesis); 418 JUnitTestCase.assertNotNull(statement.rightParenthesis);
419 JUnitTestCase.assertNotNull(statement.semicolon); 419 JUnitTestCase.assertNotNull(statement.semicolon);
420 } 420 }
421 421
422 void test_parseAssignableExpression_expression_args_dot() { 422 void test_parseAssignableExpression_expression_args_dot() {
423 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x)(y).z"); 423 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress ion", <Object> [false], "(x)(y).z");
424 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE xpressionInvocation; 424 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE xpressionInvocation;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 JUnitTestCase.assertNotNull(selector.index); 503 JUnitTestCase.assertNotNull(selector.index);
504 JUnitTestCase.assertNotNull(selector.rightBracket); 504 JUnitTestCase.assertNotNull(selector.rightBracket);
505 } 505 }
506 506
507 void test_parseAssignableSelector_none() { 507 void test_parseAssignableSelector_none() {
508 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier(null), true], ";"); 508 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector", <Object> [new SimpleIdentifier(null), true], ";");
509 JUnitTestCase.assertNotNull(selector); 509 JUnitTestCase.assertNotNull(selector);
510 } 510 }
511 511
512 void test_parseBitwiseAndExpression_normal() { 512 void test_parseBitwiseAndExpression_normal() {
513 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "x & y", []); 513 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpressi on", "x & y", []);
514 JUnitTestCase.assertNotNull(expression.leftOperand); 514 JUnitTestCase.assertNotNull(expression.leftOperand);
515 JUnitTestCase.assertNotNull(expression.operator); 515 JUnitTestCase.assertNotNull(expression.operator);
516 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); 516 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
517 JUnitTestCase.assertNotNull(expression.rightOperand); 517 JUnitTestCase.assertNotNull(expression.rightOperand);
518 } 518 }
519 519
520 void test_parseBitwiseAndExpression_super() { 520 void test_parseBitwiseAndExpression_super() {
521 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseAndExpressi on", "super & y", []); 521 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseAndExpressi on", "super & y", []);
522 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 522 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
523 JUnitTestCase.assertNotNull(expression.operator); 523 JUnitTestCase.assertNotNull(expression.operator);
524 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); 524 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type);
525 JUnitTestCase.assertNotNull(expression.rightOperand); 525 JUnitTestCase.assertNotNull(expression.rightOperand);
526 } 526 }
527 527
528 void test_parseBitwiseOrExpression_normal() { 528 void test_parseBitwiseOrExpression_normal() {
529 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "x | y", []); 529 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpressio n", "x | y", []);
530 JUnitTestCase.assertNotNull(expression.leftOperand); 530 JUnitTestCase.assertNotNull(expression.leftOperand);
531 JUnitTestCase.assertNotNull(expression.operator); 531 JUnitTestCase.assertNotNull(expression.operator);
532 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); 532 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
533 JUnitTestCase.assertNotNull(expression.rightOperand); 533 JUnitTestCase.assertNotNull(expression.rightOperand);
534 } 534 }
535 535
536 void test_parseBitwiseOrExpression_super() { 536 void test_parseBitwiseOrExpression_super() {
537 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseOrExpressio n", "super | y", []); 537 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseOrExpressio n", "super | y", []);
538 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 538 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
539 JUnitTestCase.assertNotNull(expression.operator); 539 JUnitTestCase.assertNotNull(expression.operator);
540 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); 540 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type);
541 JUnitTestCase.assertNotNull(expression.rightOperand); 541 JUnitTestCase.assertNotNull(expression.rightOperand);
542 } 542 }
543 543
544 void test_parseBitwiseXorExpression_normal() { 544 void test_parseBitwiseXorExpression_normal() {
545 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "x ^ y", []); 545 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpressi on", "x ^ y", []);
546 JUnitTestCase.assertNotNull(expression.leftOperand); 546 JUnitTestCase.assertNotNull(expression.leftOperand);
547 JUnitTestCase.assertNotNull(expression.operator); 547 JUnitTestCase.assertNotNull(expression.operator);
548 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); 548 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
549 JUnitTestCase.assertNotNull(expression.rightOperand); 549 JUnitTestCase.assertNotNull(expression.rightOperand);
550 } 550 }
551 551
552 void test_parseBitwiseXorExpression_super() { 552 void test_parseBitwiseXorExpression_super() {
553 BinaryExpression expression = ParserTestCase.parse5("parseBitwiseXorExpressi on", "super ^ y", []); 553 BinaryExpression expression = ParserTestCase.parse4("parseBitwiseXorExpressi on", "super ^ y", []);
554 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 554 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
555 JUnitTestCase.assertNotNull(expression.operator); 555 JUnitTestCase.assertNotNull(expression.operator);
556 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); 556 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type);
557 JUnitTestCase.assertNotNull(expression.rightOperand); 557 JUnitTestCase.assertNotNull(expression.rightOperand);
558 } 558 }
559 559
560 void test_parseBlock_empty() { 560 void test_parseBlock_empty() {
561 Block block = ParserTestCase.parse5("parseBlock", "{}", []); 561 Block block = ParserTestCase.parse4("parseBlock", "{}", []);
562 JUnitTestCase.assertNotNull(block.leftBracket); 562 JUnitTestCase.assertNotNull(block.leftBracket);
563 EngineTestCase.assertSize(0, block.statements); 563 EngineTestCase.assertSize(0, block.statements);
564 JUnitTestCase.assertNotNull(block.rightBracket); 564 JUnitTestCase.assertNotNull(block.rightBracket);
565 } 565 }
566 566
567 void test_parseBlock_nonEmpty() { 567 void test_parseBlock_nonEmpty() {
568 Block block = ParserTestCase.parse5("parseBlock", "{;}", []); 568 Block block = ParserTestCase.parse4("parseBlock", "{;}", []);
569 JUnitTestCase.assertNotNull(block.leftBracket); 569 JUnitTestCase.assertNotNull(block.leftBracket);
570 EngineTestCase.assertSize(1, block.statements); 570 EngineTestCase.assertSize(1, block.statements);
571 JUnitTestCase.assertNotNull(block.rightBracket); 571 JUnitTestCase.assertNotNull(block.rightBracket);
572 } 572 }
573 573
574 void test_parseBreakStatement_label() { 574 void test_parseBreakStatement_label() {
575 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak foo;", []); 575 BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "bre ak foo;", []);
576 JUnitTestCase.assertNotNull(statement.keyword); 576 JUnitTestCase.assertNotNull(statement.keyword);
577 JUnitTestCase.assertNotNull(statement.label); 577 JUnitTestCase.assertNotNull(statement.label);
578 JUnitTestCase.assertNotNull(statement.semicolon); 578 JUnitTestCase.assertNotNull(statement.semicolon);
579 } 579 }
580 580
581 void test_parseBreakStatement_noLabel() { 581 void test_parseBreakStatement_noLabel() {
582 BreakStatement statement = ParserTestCase.parse5("parseBreakStatement", "bre ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); 582 BreakStatement statement = ParserTestCase.parse4("parseBreakStatement", "bre ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]);
583 JUnitTestCase.assertNotNull(statement.keyword); 583 JUnitTestCase.assertNotNull(statement.keyword);
584 JUnitTestCase.assertNull(statement.label); 584 JUnitTestCase.assertNull(statement.label);
585 JUnitTestCase.assertNotNull(statement.semicolon); 585 JUnitTestCase.assertNotNull(statement.semicolon);
586 } 586 }
587 587
588 void test_parseCascadeSection_i() { 588 void test_parseCascadeSection_i() {
589 IndexExpression section = ParserTestCase.parse5("parseCascadeSection", "..[i ]", []); 589 IndexExpression section = ParserTestCase.parse4("parseCascadeSection", "..[i ]", []);
590 JUnitTestCase.assertNull(section.target); 590 JUnitTestCase.assertNull(section.target);
591 JUnitTestCase.assertNotNull(section.leftBracket); 591 JUnitTestCase.assertNotNull(section.leftBracket);
592 JUnitTestCase.assertNotNull(section.index); 592 JUnitTestCase.assertNotNull(section.index);
593 JUnitTestCase.assertNotNull(section.rightBracket); 593 JUnitTestCase.assertNotNull(section.rightBracket);
594 } 594 }
595 595
596 void test_parseCascadeSection_ia() { 596 void test_parseCascadeSection_ia() {
597 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..[i](b)", []); 597 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe ction", "..[i](b)", []);
598 EngineTestCase.assertInstanceOf(IndexExpression, section.function); 598 EngineTestCase.assertInstanceOf(IndexExpression, section.function);
599 JUnitTestCase.assertNotNull(section.argumentList); 599 JUnitTestCase.assertNotNull(section.argumentList);
600 } 600 }
601 601
602 void test_parseCascadeSection_ii() { 602 void test_parseCascadeSection_ii() {
603 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a (b).c(d)", []); 603 MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a (b).c(d)", []);
604 EngineTestCase.assertInstanceOf(MethodInvocation, section.target); 604 EngineTestCase.assertInstanceOf(MethodInvocation, section.target);
605 JUnitTestCase.assertNotNull(section.period); 605 JUnitTestCase.assertNotNull(section.period);
606 JUnitTestCase.assertNotNull(section.methodName); 606 JUnitTestCase.assertNotNull(section.methodName);
607 JUnitTestCase.assertNotNull(section.argumentList); 607 JUnitTestCase.assertNotNull(section.argumentList);
608 EngineTestCase.assertSize(1, section.argumentList.arguments); 608 EngineTestCase.assertSize(1, section.argumentList.arguments);
609 } 609 }
610 610
611 void test_parseCascadeSection_p() { 611 void test_parseCascadeSection_p() {
612 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a", []); 612 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a", []);
613 JUnitTestCase.assertNull(section.target); 613 JUnitTestCase.assertNull(section.target);
614 JUnitTestCase.assertNotNull(section.operator); 614 JUnitTestCase.assertNotNull(section.operator);
615 JUnitTestCase.assertNotNull(section.propertyName); 615 JUnitTestCase.assertNotNull(section.propertyName);
616 } 616 }
617 617
618 void test_parseCascadeSection_p_assign() { 618 void test_parseCascadeSection_p_assign() {
619 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3", []); 619 AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3", []);
620 JUnitTestCase.assertNotNull(section.leftHandSide); 620 JUnitTestCase.assertNotNull(section.leftHandSide);
621 JUnitTestCase.assertNotNull(section.operator); 621 JUnitTestCase.assertNotNull(section.operator);
622 Expression rhs = section.rightHandSide; 622 Expression rhs = section.rightHandSide;
623 JUnitTestCase.assertNotNull(rhs); 623 JUnitTestCase.assertNotNull(rhs);
624 } 624 }
625 625
626 void test_parseCascadeSection_p_assign_withCascade() { 626 void test_parseCascadeSection_p_assign_withCascade() {
627 AssignmentExpression section = ParserTestCase.parse5("parseCascadeSection", "..a = 3..m()", []); 627 AssignmentExpression section = ParserTestCase.parse4("parseCascadeSection", "..a = 3..m()", []);
628 JUnitTestCase.assertNotNull(section.leftHandSide); 628 JUnitTestCase.assertNotNull(section.leftHandSide);
629 JUnitTestCase.assertNotNull(section.operator); 629 JUnitTestCase.assertNotNull(section.operator);
630 Expression rhs = section.rightHandSide; 630 Expression rhs = section.rightHandSide;
631 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs); 631 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs);
632 } 632 }
633 633
634 void test_parseCascadeSection_p_builtIn() { 634 void test_parseCascadeSection_p_builtIn() {
635 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..as" , []); 635 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..as" , []);
636 JUnitTestCase.assertNull(section.target); 636 JUnitTestCase.assertNull(section.target);
637 JUnitTestCase.assertNotNull(section.operator); 637 JUnitTestCase.assertNotNull(section.operator);
638 JUnitTestCase.assertNotNull(section.propertyName); 638 JUnitTestCase.assertNotNull(section.propertyName);
639 } 639 }
640 640
641 void test_parseCascadeSection_pa() { 641 void test_parseCascadeSection_pa() {
642 MethodInvocation section = ParserTestCase.parse5("parseCascadeSection", "..a (b)", []); 642 MethodInvocation section = ParserTestCase.parse4("parseCascadeSection", "..a (b)", []);
643 JUnitTestCase.assertNull(section.target); 643 JUnitTestCase.assertNull(section.target);
644 JUnitTestCase.assertNotNull(section.period); 644 JUnitTestCase.assertNotNull(section.period);
645 JUnitTestCase.assertNotNull(section.methodName); 645 JUnitTestCase.assertNotNull(section.methodName);
646 JUnitTestCase.assertNotNull(section.argumentList); 646 JUnitTestCase.assertNotNull(section.argumentList);
647 EngineTestCase.assertSize(1, section.argumentList.arguments); 647 EngineTestCase.assertSize(1, section.argumentList.arguments);
648 } 648 }
649 649
650 void test_parseCascadeSection_paa() { 650 void test_parseCascadeSection_paa() {
651 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c)", []); 651 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe ction", "..a(b)(c)", []);
652 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); 652 EngineTestCase.assertInstanceOf(MethodInvocation, section.function);
653 JUnitTestCase.assertNotNull(section.argumentList); 653 JUnitTestCase.assertNotNull(section.argumentList);
654 EngineTestCase.assertSize(1, section.argumentList.arguments); 654 EngineTestCase.assertSize(1, section.argumentList.arguments);
655 } 655 }
656 656
657 void test_parseCascadeSection_paapaa() { 657 void test_parseCascadeSection_paapaa() {
658 FunctionExpressionInvocation section = ParserTestCase.parse5("parseCascadeSe ction", "..a(b)(c).d(e)(f)", []); 658 FunctionExpressionInvocation section = ParserTestCase.parse4("parseCascadeSe ction", "..a(b)(c).d(e)(f)", []);
659 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); 659 EngineTestCase.assertInstanceOf(MethodInvocation, section.function);
660 JUnitTestCase.assertNotNull(section.argumentList); 660 JUnitTestCase.assertNotNull(section.argumentList);
661 EngineTestCase.assertSize(1, section.argumentList.arguments); 661 EngineTestCase.assertSize(1, section.argumentList.arguments);
662 } 662 }
663 663
664 void test_parseCascadeSection_pap() { 664 void test_parseCascadeSection_pap() {
665 PropertyAccess section = ParserTestCase.parse5("parseCascadeSection", "..a(b ).c", []); 665 PropertyAccess section = ParserTestCase.parse4("parseCascadeSection", "..a(b ).c", []);
666 JUnitTestCase.assertNotNull(section.target); 666 JUnitTestCase.assertNotNull(section.target);
667 JUnitTestCase.assertNotNull(section.operator); 667 JUnitTestCase.assertNotNull(section.operator);
668 JUnitTestCase.assertNotNull(section.propertyName); 668 JUnitTestCase.assertNotNull(section.propertyName);
669 } 669 }
670 670
671 void test_parseClassDeclaration_abstract() { 671 void test_parseClassDeclaration_abstract() {
672 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [ 672 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration", <Object> [
673 emptyCommentAndMetadata(), 673 emptyCommentAndMetadata(),
674 TokenFactory.token(Keyword.ABSTRACT)], "class A {}"); 674 TokenFactory.token(Keyword.ABSTRACT)], "class A {}");
675 JUnitTestCase.assertNull(declaration.documentationComment); 675 JUnitTestCase.assertNull(declaration.documentationComment);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 JUnitTestCase.assertEquals("A", classTypeAlias.name.name); 1197 JUnitTestCase.assertEquals("A", classTypeAlias.name.name);
1198 JUnitTestCase.assertNotNull(classTypeAlias.equals); 1198 JUnitTestCase.assertNotNull(classTypeAlias.equals);
1199 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword); 1199 JUnitTestCase.assertNull(classTypeAlias.abstractKeyword);
1200 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name); 1200 JUnitTestCase.assertNotNullMsg("B", classTypeAlias.superclass.name.name);
1201 JUnitTestCase.assertNotNull(classTypeAlias.withClause); 1201 JUnitTestCase.assertNotNull(classTypeAlias.withClause);
1202 JUnitTestCase.assertNotNull(classTypeAlias.implementsClause); 1202 JUnitTestCase.assertNotNull(classTypeAlias.implementsClause);
1203 JUnitTestCase.assertNotNull(classTypeAlias.semicolon); 1203 JUnitTestCase.assertNotNull(classTypeAlias.semicolon);
1204 } 1204 }
1205 1205
1206 void test_parseCombinators_h() { 1206 void test_parseCombinators_h() {
1207 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a;", []); 1207 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi de a;", []);
1208 EngineTestCase.assertSize(1, combinators); 1208 EngineTestCase.assertSize(1, combinators);
1209 HideCombinator combinator = combinators[0] as HideCombinator; 1209 HideCombinator combinator = combinators[0] as HideCombinator;
1210 JUnitTestCase.assertNotNull(combinator); 1210 JUnitTestCase.assertNotNull(combinator);
1211 JUnitTestCase.assertNotNull(combinator.keyword); 1211 JUnitTestCase.assertNotNull(combinator.keyword);
1212 EngineTestCase.assertSize(1, combinator.hiddenNames); 1212 EngineTestCase.assertSize(1, combinator.hiddenNames);
1213 } 1213 }
1214 1214
1215 void test_parseCombinators_hs() { 1215 void test_parseCombinators_hs() {
1216 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b;", []); 1216 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi de a show b;", []);
1217 EngineTestCase.assertSize(2, combinators); 1217 EngineTestCase.assertSize(2, combinators);
1218 HideCombinator hideCombinator = combinators[0] as HideCombinator; 1218 HideCombinator hideCombinator = combinators[0] as HideCombinator;
1219 JUnitTestCase.assertNotNull(hideCombinator); 1219 JUnitTestCase.assertNotNull(hideCombinator);
1220 JUnitTestCase.assertNotNull(hideCombinator.keyword); 1220 JUnitTestCase.assertNotNull(hideCombinator.keyword);
1221 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); 1221 EngineTestCase.assertSize(1, hideCombinator.hiddenNames);
1222 ShowCombinator showCombinator = combinators[1] as ShowCombinator; 1222 ShowCombinator showCombinator = combinators[1] as ShowCombinator;
1223 JUnitTestCase.assertNotNull(showCombinator); 1223 JUnitTestCase.assertNotNull(showCombinator);
1224 JUnitTestCase.assertNotNull(showCombinator.keyword); 1224 JUnitTestCase.assertNotNull(showCombinator.keyword);
1225 EngineTestCase.assertSize(1, showCombinator.shownNames); 1225 EngineTestCase.assertSize(1, showCombinator.shownNames);
1226 } 1226 }
1227 1227
1228 void test_parseCombinators_hshs() { 1228 void test_parseCombinators_hshs() {
1229 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "hi de a show b hide c show d;", []); 1229 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "hi de a show b hide c show d;", []);
1230 EngineTestCase.assertSize(4, combinators); 1230 EngineTestCase.assertSize(4, combinators);
1231 } 1231 }
1232 1232
1233 void test_parseCombinators_s() { 1233 void test_parseCombinators_s() {
1234 List<Combinator> combinators = ParserTestCase.parse5("parseCombinators", "sh ow a;", []); 1234 List<Combinator> combinators = ParserTestCase.parse4("parseCombinators", "sh ow a;", []);
1235 EngineTestCase.assertSize(1, combinators); 1235 EngineTestCase.assertSize(1, combinators);
1236 ShowCombinator combinator = combinators[0] as ShowCombinator; 1236 ShowCombinator combinator = combinators[0] as ShowCombinator;
1237 JUnitTestCase.assertNotNull(combinator); 1237 JUnitTestCase.assertNotNull(combinator);
1238 JUnitTestCase.assertNotNull(combinator.keyword); 1238 JUnitTestCase.assertNotNull(combinator.keyword);
1239 EngineTestCase.assertSize(1, combinator.shownNames); 1239 EngineTestCase.assertSize(1, combinator.shownNames);
1240 } 1240 }
1241 1241
1242 void test_parseCommentAndMetadata_c() { 1242 void test_parseCommentAndMetadata_c() {
1243 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ void", []); 1243 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "/** 1 */ void", []);
1244 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1244 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1245 EngineTestCase.assertSize(0, commentAndMetadata.metadata); 1245 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1246 } 1246 }
1247 1247
1248 void test_parseCommentAndMetadata_cmc() { 1248 void test_parseCommentAndMetadata_cmc() {
1249 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ void", []); 1249 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ void", []);
1250 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1250 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1251 EngineTestCase.assertSize(1, commentAndMetadata.metadata); 1251 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
1252 } 1252 }
1253 1253
1254 void test_parseCommentAndMetadata_cmcm() { 1254 void test_parseCommentAndMetadata_cmcm() {
1255 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); 1255 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "/** 1 */ @A /** 2 */ @B void", []);
1256 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1256 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1257 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 1257 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1258 } 1258 }
1259 1259
1260 void test_parseCommentAndMetadata_cmm() { 1260 void test_parseCommentAndMetadata_cmm() {
1261 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "/** 1 */ @A @B void", []); 1261 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "/** 1 */ @A @B void", []);
1262 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1262 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1263 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 1263 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1264 } 1264 }
1265 1265
1266 void test_parseCommentAndMetadata_m() { 1266 void test_parseCommentAndMetadata_m() {
1267 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A void", []); 1267 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "@A void", []);
1268 JUnitTestCase.assertNull(commentAndMetadata.comment); 1268 JUnitTestCase.assertNull(commentAndMetadata.comment);
1269 EngineTestCase.assertSize(1, commentAndMetadata.metadata); 1269 EngineTestCase.assertSize(1, commentAndMetadata.metadata);
1270 } 1270 }
1271 1271
1272 void test_parseCommentAndMetadata_mcm() { 1272 void test_parseCommentAndMetadata_mcm() {
1273 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B void", []); 1273 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "@A /** 1 */ @B void", []);
1274 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1274 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1275 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 1275 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1276 } 1276 }
1277 1277
1278 void test_parseCommentAndMetadata_mcmc() { 1278 void test_parseCommentAndMetadata_mcmc() {
1279 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); 1279 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "@A /** 1 */ @B /** 2 */ void", []);
1280 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1280 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1281 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 1281 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1282 } 1282 }
1283 1283
1284 void test_parseCommentAndMetadata_mm() { 1284 void test_parseCommentAndMetadata_mm() {
1285 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "@A @B(x) void", []); 1285 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "@A @B(x) void", []);
1286 JUnitTestCase.assertNull(commentAndMetadata.comment); 1286 JUnitTestCase.assertNull(commentAndMetadata.comment);
1287 EngineTestCase.assertSize(2, commentAndMetadata.metadata); 1287 EngineTestCase.assertSize(2, commentAndMetadata.metadata);
1288 } 1288 }
1289 1289
1290 void test_parseCommentAndMetadata_none() { 1290 void test_parseCommentAndMetadata_none() {
1291 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", "void", []); 1291 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", "void", []);
1292 JUnitTestCase.assertNull(commentAndMetadata.comment); 1292 JUnitTestCase.assertNull(commentAndMetadata.comment);
1293 EngineTestCase.assertSize(0, commentAndMetadata.metadata); 1293 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1294 } 1294 }
1295 1295
1296 void test_parseCommentAndMetadata_singleLine() { 1296 void test_parseCommentAndMetadata_singleLine() {
1297 CommentAndMetadata commentAndMetadata = ParserTestCase.parse5("parseCommentA ndMetadata", EngineTestCase.createSource(["/// 1", "/// 2", "void"]), []); 1297 CommentAndMetadata commentAndMetadata = ParserTestCase.parse4("parseCommentA ndMetadata", EngineTestCase.createSource(["/// 1", "/// 2", "void"]), []);
1298 JUnitTestCase.assertNotNull(commentAndMetadata.comment); 1298 JUnitTestCase.assertNotNull(commentAndMetadata.comment);
1299 EngineTestCase.assertSize(0, commentAndMetadata.metadata); 1299 EngineTestCase.assertSize(0, commentAndMetadata.metadata);
1300 } 1300 }
1301 1301
1302 void test_parseCommentReference_new_prefixed() { 1302 void test_parseCommentReference_new_prefixed() {
1303 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a.b", 7], ""); 1303 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["new a.b", 7], "");
1304 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier); 1304 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref ixedIdentifier, reference.identifier);
1305 SimpleIdentifier prefix = prefixedIdentifier.prefix; 1305 SimpleIdentifier prefix = prefixedIdentifier.prefix;
1306 JUnitTestCase.assertNotNull(prefix.token); 1306 JUnitTestCase.assertNotNull(prefix.token);
1307 JUnitTestCase.assertEquals("a", prefix.name); 1307 JUnitTestCase.assertEquals("a", prefix.name);
(...skipping 28 matching lines...) Expand all
1336 } 1336 }
1337 1337
1338 void test_parseCommentReference_simple() { 1338 void test_parseCommentReference_simple() {
1339 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["a", 5], ""); 1339 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["a", 5], "");
1340 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier); 1340 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier);
1341 JUnitTestCase.assertNotNull(identifier.token); 1341 JUnitTestCase.assertNotNull(identifier.token);
1342 JUnitTestCase.assertEquals("a", identifier.name); 1342 JUnitTestCase.assertEquals("a", identifier.name);
1343 JUnitTestCase.assertEquals(5, identifier.offset); 1343 JUnitTestCase.assertEquals(5, identifier.offset);
1344 } 1344 }
1345 1345
1346 void test_parseCommentReference_synthetic() {
1347 CommentReference reference = ParserTestCase.parse("parseCommentReference", < Object> ["", 5], "");
1348 SimpleIdentifier identifier = EngineTestCase.assertInstanceOf(SimpleIdentifi er, reference.identifier);
1349 JUnitTestCase.assertNotNull(identifier);
1350 JUnitTestCase.assertTrue(identifier.isSynthetic);
1351 JUnitTestCase.assertNotNull(identifier.token);
1352 JUnitTestCase.assertEquals("", identifier.name);
1353 JUnitTestCase.assertEquals(5, identifier.offset);
1354 }
1355
1346 void test_parseCommentReferences_multiLine() { 1356 void test_parseCommentReferences_multiLine() {
1347 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)]; 1357 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** xxx [a] yyy [b] zzz */", 3)];
1348 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], ""); 1358 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1349 EngineTestCase.assertSize(2, references); 1359 EngineTestCase.assertSize(2, references);
1350 CommentReference reference = references[0]; 1360 CommentReference reference = references[0];
1351 JUnitTestCase.assertNotNull(reference); 1361 JUnitTestCase.assertNotNull(reference);
1352 JUnitTestCase.assertNotNull(reference.identifier); 1362 JUnitTestCase.assertNotNull(reference.identifier);
1353 JUnitTestCase.assertEquals(12, reference.offset); 1363 JUnitTestCase.assertEquals(12, reference.offset);
1354 reference = references[1]; 1364 reference = references[1];
1355 JUnitTestCase.assertNotNull(reference); 1365 JUnitTestCase.assertNotNull(reference);
1356 JUnitTestCase.assertNotNull(reference.identifier); 1366 JUnitTestCase.assertNotNull(reference.identifier);
1357 JUnitTestCase.assertEquals(20, reference.offset); 1367 JUnitTestCase.assertEquals(20, reference.offset);
1358 } 1368 }
1359 1369
1370 void test_parseCommentReferences_notClosed_noIdentifier() {
1371 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [ some text", 5)];
1372 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1373 EngineTestCase.assertSize(1, references);
1374 CommentReference reference = references[0];
1375 JUnitTestCase.assertNotNull(reference);
1376 JUnitTestCase.assertNotNull(reference.identifier);
1377 JUnitTestCase.assertTrue(reference.identifier.isSynthetic);
1378 JUnitTestCase.assertEquals("", reference.identifier.name);
1379 }
1380
1381 void test_parseCommentReferences_notClosed_withIdentifier() {
1382 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [namePrefix some text", 5)];
1383 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1384 EngineTestCase.assertSize(1, references);
1385 CommentReference reference = references[0];
1386 JUnitTestCase.assertNotNull(reference);
1387 JUnitTestCase.assertNotNull(reference.identifier);
1388 JUnitTestCase.assertFalse(reference.identifier.isSynthetic);
1389 JUnitTestCase.assertEquals("namePrefix", reference.identifier.name);
1390 }
1391
1360 void test_parseCommentReferences_singleLine() { 1392 void test_parseCommentReferences_singleLine() {
1361 List<Token> tokens = <Token> [ 1393 List<Token> tokens = <Token> [
1362 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// xxx [a] yyy [b] zzz" , 3), 1394 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// xxx [a] yyy [b] zzz" , 3),
1363 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// x [c]", 28)]; 1395 new StringToken(TokenType.SINGLE_LINE_COMMENT, "/// x [c]", 28)];
1364 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], ""); 1396 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1365 EngineTestCase.assertSize(3, references); 1397 EngineTestCase.assertSize(3, references);
1366 CommentReference reference = references[0]; 1398 CommentReference reference = references[0];
1367 JUnitTestCase.assertNotNull(reference); 1399 JUnitTestCase.assertNotNull(reference);
1368 JUnitTestCase.assertNotNull(reference.identifier); 1400 JUnitTestCase.assertNotNull(reference.identifier);
1369 JUnitTestCase.assertEquals(12, reference.offset); 1401 JUnitTestCase.assertEquals(12, reference.offset);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)]; 1453 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT, "/** [a][c] [b] zzz */", 3)];
1422 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], ""); 1454 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere nces", <Object> [tokens], "");
1423 EngineTestCase.assertSize(1, references); 1455 EngineTestCase.assertSize(1, references);
1424 CommentReference reference = references[0]; 1456 CommentReference reference = references[0];
1425 JUnitTestCase.assertNotNull(reference); 1457 JUnitTestCase.assertNotNull(reference);
1426 JUnitTestCase.assertNotNull(reference.identifier); 1458 JUnitTestCase.assertNotNull(reference.identifier);
1427 JUnitTestCase.assertEquals(15, reference.offset); 1459 JUnitTestCase.assertEquals(15, reference.offset);
1428 } 1460 }
1429 1461
1430 void test_parseCompilationUnit_abstractAsPrefix_parameterized() { 1462 void test_parseCompilationUnit_abstractAsPrefix_parameterized() {
1431 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "abstra ct<dynamic> _abstract = new abstract.A();", []); 1463 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "abstra ct<dynamic> _abstract = new abstract.A();", []);
1432 JUnitTestCase.assertNull(unit.scriptTag); 1464 JUnitTestCase.assertNull(unit.scriptTag);
1433 EngineTestCase.assertSize(0, unit.directives); 1465 EngineTestCase.assertSize(0, unit.directives);
1434 EngineTestCase.assertSize(1, unit.declarations); 1466 EngineTestCase.assertSize(1, unit.declarations);
1435 } 1467 }
1436 1468
1437 void test_parseCompilationUnit_builtIn_asFunctionName() { 1469 void test_parseCompilationUnit_builtIn_asFunctionName() {
1438 ParserTestCase.parse5("parseCompilationUnit", "abstract(x) => 0;", []); 1470 ParserTestCase.parse4("parseCompilationUnit", "abstract(x) => 0;", []);
1439 ParserTestCase.parse5("parseCompilationUnit", "as(x) => 0;", []); 1471 ParserTestCase.parse4("parseCompilationUnit", "as(x) => 0;", []);
1440 ParserTestCase.parse5("parseCompilationUnit", "dynamic(x) => 0;", []); 1472 ParserTestCase.parse4("parseCompilationUnit", "dynamic(x) => 0;", []);
1441 ParserTestCase.parse5("parseCompilationUnit", "export(x) => 0;", []); 1473 ParserTestCase.parse4("parseCompilationUnit", "export(x) => 0;", []);
1442 ParserTestCase.parse5("parseCompilationUnit", "external(x) => 0;", []); 1474 ParserTestCase.parse4("parseCompilationUnit", "external(x) => 0;", []);
1443 ParserTestCase.parse5("parseCompilationUnit", "factory(x) => 0;", []); 1475 ParserTestCase.parse4("parseCompilationUnit", "factory(x) => 0;", []);
1444 ParserTestCase.parse5("parseCompilationUnit", "get(x) => 0;", []); 1476 ParserTestCase.parse4("parseCompilationUnit", "get(x) => 0;", []);
1445 ParserTestCase.parse5("parseCompilationUnit", "implements(x) => 0;", []); 1477 ParserTestCase.parse4("parseCompilationUnit", "implements(x) => 0;", []);
1446 ParserTestCase.parse5("parseCompilationUnit", "import(x) => 0;", []); 1478 ParserTestCase.parse4("parseCompilationUnit", "import(x) => 0;", []);
1447 ParserTestCase.parse5("parseCompilationUnit", "library(x) => 0;", []); 1479 ParserTestCase.parse4("parseCompilationUnit", "library(x) => 0;", []);
1448 ParserTestCase.parse5("parseCompilationUnit", "operator(x) => 0;", []); 1480 ParserTestCase.parse4("parseCompilationUnit", "operator(x) => 0;", []);
1449 ParserTestCase.parse5("parseCompilationUnit", "part(x) => 0;", []); 1481 ParserTestCase.parse4("parseCompilationUnit", "part(x) => 0;", []);
1450 ParserTestCase.parse5("parseCompilationUnit", "set(x) => 0;", []); 1482 ParserTestCase.parse4("parseCompilationUnit", "set(x) => 0;", []);
1451 ParserTestCase.parse5("parseCompilationUnit", "static(x) => 0;", []); 1483 ParserTestCase.parse4("parseCompilationUnit", "static(x) => 0;", []);
1452 ParserTestCase.parse5("parseCompilationUnit", "typedef(x) => 0;", []); 1484 ParserTestCase.parse4("parseCompilationUnit", "typedef(x) => 0;", []);
1453 } 1485 }
1454 1486
1455 void test_parseCompilationUnit_directives_multiple() { 1487 void test_parseCompilationUnit_directives_multiple() {
1456 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;\npart 'a.dart';", []); 1488 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar y l;\npart 'a.dart';", []);
1457 JUnitTestCase.assertNull(unit.scriptTag); 1489 JUnitTestCase.assertNull(unit.scriptTag);
1458 EngineTestCase.assertSize(2, unit.directives); 1490 EngineTestCase.assertSize(2, unit.directives);
1459 EngineTestCase.assertSize(0, unit.declarations); 1491 EngineTestCase.assertSize(0, unit.declarations);
1460 } 1492 }
1461 1493
1462 void test_parseCompilationUnit_directives_single() { 1494 void test_parseCompilationUnit_directives_single() {
1463 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "librar y l;", []); 1495 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "librar y l;", []);
1464 JUnitTestCase.assertNull(unit.scriptTag); 1496 JUnitTestCase.assertNull(unit.scriptTag);
1465 EngineTestCase.assertSize(1, unit.directives); 1497 EngineTestCase.assertSize(1, unit.directives);
1466 EngineTestCase.assertSize(0, unit.declarations); 1498 EngineTestCase.assertSize(0, unit.declarations);
1467 } 1499 }
1468 1500
1469 void test_parseCompilationUnit_empty() { 1501 void test_parseCompilationUnit_empty() {
1470 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "", []) ; 1502 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "", []) ;
1471 JUnitTestCase.assertNull(unit.scriptTag); 1503 JUnitTestCase.assertNull(unit.scriptTag);
1472 EngineTestCase.assertSize(0, unit.directives); 1504 EngineTestCase.assertSize(0, unit.directives);
1473 EngineTestCase.assertSize(0, unit.declarations); 1505 EngineTestCase.assertSize(0, unit.declarations);
1474 } 1506 }
1475 1507
1476 void test_parseCompilationUnit_exportAsPrefix() { 1508 void test_parseCompilationUnit_exportAsPrefix() {
1477 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export .A _export = new export.A();", []); 1509 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export .A _export = new export.A();", []);
1478 JUnitTestCase.assertNull(unit.scriptTag); 1510 JUnitTestCase.assertNull(unit.scriptTag);
1479 EngineTestCase.assertSize(0, unit.directives); 1511 EngineTestCase.assertSize(0, unit.directives);
1480 EngineTestCase.assertSize(1, unit.declarations); 1512 EngineTestCase.assertSize(1, unit.declarations);
1481 } 1513 }
1482 1514
1483 void test_parseCompilationUnit_exportAsPrefix_parameterized() { 1515 void test_parseCompilationUnit_exportAsPrefix_parameterized() {
1484 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "export <dynamic> _export = new export.A();", []); 1516 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "export <dynamic> _export = new export.A();", []);
1485 JUnitTestCase.assertNull(unit.scriptTag); 1517 JUnitTestCase.assertNull(unit.scriptTag);
1486 EngineTestCase.assertSize(0, unit.directives); 1518 EngineTestCase.assertSize(0, unit.directives);
1487 EngineTestCase.assertSize(1, unit.declarations); 1519 EngineTestCase.assertSize(1, unit.declarations);
1488 } 1520 }
1489 1521
1490 void test_parseCompilationUnit_operatorAsPrefix_parameterized() { 1522 void test_parseCompilationUnit_operatorAsPrefix_parameterized() {
1491 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "operat or<dynamic> _operator = new operator.A();", []); 1523 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "operat or<dynamic> _operator = new operator.A();", []);
1492 JUnitTestCase.assertNull(unit.scriptTag); 1524 JUnitTestCase.assertNull(unit.scriptTag);
1493 EngineTestCase.assertSize(0, unit.directives); 1525 EngineTestCase.assertSize(0, unit.directives);
1494 EngineTestCase.assertSize(1, unit.declarations); 1526 EngineTestCase.assertSize(1, unit.declarations);
1495 } 1527 }
1496 1528
1497 void test_parseCompilationUnit_script() { 1529 void test_parseCompilationUnit_script() {
1498 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "#! /bi n/dart", []); 1530 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "#! /bi n/dart", []);
1499 JUnitTestCase.assertNotNull(unit.scriptTag); 1531 JUnitTestCase.assertNotNull(unit.scriptTag);
1500 EngineTestCase.assertSize(0, unit.directives); 1532 EngineTestCase.assertSize(0, unit.directives);
1501 EngineTestCase.assertSize(0, unit.declarations); 1533 EngineTestCase.assertSize(0, unit.declarations);
1502 } 1534 }
1503 1535
1504 void test_parseCompilationUnit_skipFunctionBody_withInterpolation() { 1536 void test_parseCompilationUnit_skipFunctionBody_withInterpolation() {
1505 ParserTestCase._parseFunctionBodies = false; 1537 ParserTestCase._parseFunctionBodies = false;
1506 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "f() { '\${n}'; }", []); 1538 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "f() { '\${n}'; }", []);
1507 JUnitTestCase.assertNull(unit.scriptTag); 1539 JUnitTestCase.assertNull(unit.scriptTag);
1508 EngineTestCase.assertSize(1, unit.declarations); 1540 EngineTestCase.assertSize(1, unit.declarations);
1509 } 1541 }
1510 1542
1511 void test_parseCompilationUnit_topLevelDeclaration() { 1543 void test_parseCompilationUnit_topLevelDeclaration() {
1512 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "class A {}", []); 1544 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "class A {}", []);
1513 JUnitTestCase.assertNull(unit.scriptTag); 1545 JUnitTestCase.assertNull(unit.scriptTag);
1514 EngineTestCase.assertSize(0, unit.directives); 1546 EngineTestCase.assertSize(0, unit.directives);
1515 EngineTestCase.assertSize(1, unit.declarations); 1547 EngineTestCase.assertSize(1, unit.declarations);
1516 } 1548 }
1517 1549
1518 void test_parseCompilationUnit_typedefAsPrefix() { 1550 void test_parseCompilationUnit_typedefAsPrefix() {
1519 CompilationUnit unit = ParserTestCase.parse5("parseCompilationUnit", "typede f.A _typedef = new typedef.A();", []); 1551 CompilationUnit unit = ParserTestCase.parse4("parseCompilationUnit", "typede f.A _typedef = new typedef.A();", []);
1520 JUnitTestCase.assertNull(unit.scriptTag); 1552 JUnitTestCase.assertNull(unit.scriptTag);
1521 EngineTestCase.assertSize(0, unit.directives); 1553 EngineTestCase.assertSize(0, unit.directives);
1522 EngineTestCase.assertSize(1, unit.declarations); 1554 EngineTestCase.assertSize(1, unit.declarations);
1523 } 1555 }
1524 1556
1525 void test_parseCompilationUnitMember_abstractAsPrefix() { 1557 void test_parseCompilationUnitMember_abstractAsPrefix() {
1526 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n ew abstract.A();"); 1558 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n ew abstract.A();");
1527 JUnitTestCase.assertNotNull(declaration.semicolon); 1559 JUnitTestCase.assertNotNull(declaration.semicolon);
1528 JUnitTestCase.assertNotNull(declaration.variables); 1560 JUnitTestCase.assertNotNull(declaration.variables);
1529 } 1561 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 JUnitTestCase.assertNotNull(declaration.variables); 1738 JUnitTestCase.assertNotNull(declaration.variables);
1707 } 1739 }
1708 1740
1709 void test_parseCompilationUnitMember_variableSet() { 1741 void test_parseCompilationUnitMember_variableSet() {
1710 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "String set = null;"); 1742 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila tionUnitMember", <Object> [emptyCommentAndMetadata()], "String set = null;");
1711 JUnitTestCase.assertNotNull(declaration.semicolon); 1743 JUnitTestCase.assertNotNull(declaration.semicolon);
1712 JUnitTestCase.assertNotNull(declaration.variables); 1744 JUnitTestCase.assertNotNull(declaration.variables);
1713 } 1745 }
1714 1746
1715 void test_parseConditionalExpression() { 1747 void test_parseConditionalExpression() {
1716 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y : z", []); 1748 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx pression", "x ? y : z", []);
1717 JUnitTestCase.assertNotNull(expression.condition); 1749 JUnitTestCase.assertNotNull(expression.condition);
1718 JUnitTestCase.assertNotNull(expression.question); 1750 JUnitTestCase.assertNotNull(expression.question);
1719 JUnitTestCase.assertNotNull(expression.thenExpression); 1751 JUnitTestCase.assertNotNull(expression.thenExpression);
1720 JUnitTestCase.assertNotNull(expression.colon); 1752 JUnitTestCase.assertNotNull(expression.colon);
1721 JUnitTestCase.assertNotNull(expression.elseExpression); 1753 JUnitTestCase.assertNotNull(expression.elseExpression);
1722 } 1754 }
1723 1755
1724 void test_parseConstExpression_instanceCreation() { 1756 void test_parseConstExpression_instanceCreation() {
1725 InstanceCreationExpression expression = ParserTestCase.parse5("parseConstExp ression", "const A()", []); 1757 InstanceCreationExpression expression = ParserTestCase.parse4("parseConstExp ression", "const A()", []);
1726 JUnitTestCase.assertNotNull(expression.keyword); 1758 JUnitTestCase.assertNotNull(expression.keyword);
1727 ConstructorName name = expression.constructorName; 1759 ConstructorName name = expression.constructorName;
1728 JUnitTestCase.assertNotNull(name); 1760 JUnitTestCase.assertNotNull(name);
1729 JUnitTestCase.assertNotNull(name.type); 1761 JUnitTestCase.assertNotNull(name.type);
1730 JUnitTestCase.assertNull(name.period); 1762 JUnitTestCase.assertNull(name.period);
1731 JUnitTestCase.assertNull(name.name); 1763 JUnitTestCase.assertNull(name.name);
1732 JUnitTestCase.assertNotNull(expression.argumentList); 1764 JUnitTestCase.assertNotNull(expression.argumentList);
1733 } 1765 }
1734 1766
1735 void test_parseConstExpression_listLiteral_typed() { 1767 void test_parseConstExpression_listLiteral_typed() {
1736 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const < A> []", []); 1768 ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const < A> []", []);
1737 JUnitTestCase.assertNotNull(literal.constKeyword); 1769 JUnitTestCase.assertNotNull(literal.constKeyword);
1738 JUnitTestCase.assertNotNull(literal.typeArguments); 1770 JUnitTestCase.assertNotNull(literal.typeArguments);
1739 JUnitTestCase.assertNotNull(literal.leftBracket); 1771 JUnitTestCase.assertNotNull(literal.leftBracket);
1740 EngineTestCase.assertSize(0, literal.elements); 1772 EngineTestCase.assertSize(0, literal.elements);
1741 JUnitTestCase.assertNotNull(literal.rightBracket); 1773 JUnitTestCase.assertNotNull(literal.rightBracket);
1742 } 1774 }
1743 1775
1744 void test_parseConstExpression_listLiteral_untyped() { 1776 void test_parseConstExpression_listLiteral_untyped() {
1745 ListLiteral literal = ParserTestCase.parse5("parseConstExpression", "const [ ]", []); 1777 ListLiteral literal = ParserTestCase.parse4("parseConstExpression", "const [ ]", []);
1746 JUnitTestCase.assertNotNull(literal.constKeyword); 1778 JUnitTestCase.assertNotNull(literal.constKeyword);
1747 JUnitTestCase.assertNull(literal.typeArguments); 1779 JUnitTestCase.assertNull(literal.typeArguments);
1748 JUnitTestCase.assertNotNull(literal.leftBracket); 1780 JUnitTestCase.assertNotNull(literal.leftBracket);
1749 EngineTestCase.assertSize(0, literal.elements); 1781 EngineTestCase.assertSize(0, literal.elements);
1750 JUnitTestCase.assertNotNull(literal.rightBracket); 1782 JUnitTestCase.assertNotNull(literal.rightBracket);
1751 } 1783 }
1752 1784
1753 void test_parseConstExpression_mapLiteral_typed() { 1785 void test_parseConstExpression_mapLiteral_typed() {
1754 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const <A , B> {}", []); 1786 MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const <A , B> {}", []);
1755 JUnitTestCase.assertNotNull(literal.leftBracket); 1787 JUnitTestCase.assertNotNull(literal.leftBracket);
1756 EngineTestCase.assertSize(0, literal.entries); 1788 EngineTestCase.assertSize(0, literal.entries);
1757 JUnitTestCase.assertNotNull(literal.rightBracket); 1789 JUnitTestCase.assertNotNull(literal.rightBracket);
1758 JUnitTestCase.assertNotNull(literal.typeArguments); 1790 JUnitTestCase.assertNotNull(literal.typeArguments);
1759 } 1791 }
1760 1792
1761 void test_parseConstExpression_mapLiteral_untyped() { 1793 void test_parseConstExpression_mapLiteral_untyped() {
1762 MapLiteral literal = ParserTestCase.parse5("parseConstExpression", "const {} ", []); 1794 MapLiteral literal = ParserTestCase.parse4("parseConstExpression", "const {} ", []);
1763 JUnitTestCase.assertNotNull(literal.leftBracket); 1795 JUnitTestCase.assertNotNull(literal.leftBracket);
1764 EngineTestCase.assertSize(0, literal.entries); 1796 EngineTestCase.assertSize(0, literal.entries);
1765 JUnitTestCase.assertNotNull(literal.rightBracket); 1797 JUnitTestCase.assertNotNull(literal.rightBracket);
1766 JUnitTestCase.assertNull(literal.typeArguments); 1798 JUnitTestCase.assertNull(literal.typeArguments);
1767 } 1799 }
1768 1800
1769 void test_parseConstructor() { 1801 void test_parseConstructor() {
1770 } 1802 }
1771 1803
1772 void test_parseConstructorFieldInitializer_qualified() { 1804 void test_parseConstructorFieldInitializer_qualified() {
1773 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "this.a = b", []); 1805 ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstru ctorFieldInitializer", "this.a = b", []);
1774 JUnitTestCase.assertNotNull(invocation.equals); 1806 JUnitTestCase.assertNotNull(invocation.equals);
1775 JUnitTestCase.assertNotNull(invocation.expression); 1807 JUnitTestCase.assertNotNull(invocation.expression);
1776 JUnitTestCase.assertNotNull(invocation.fieldName); 1808 JUnitTestCase.assertNotNull(invocation.fieldName);
1777 JUnitTestCase.assertNotNull(invocation.keyword); 1809 JUnitTestCase.assertNotNull(invocation.keyword);
1778 JUnitTestCase.assertNotNull(invocation.period); 1810 JUnitTestCase.assertNotNull(invocation.period);
1779 } 1811 }
1780 1812
1781 void test_parseConstructorFieldInitializer_unqualified() { 1813 void test_parseConstructorFieldInitializer_unqualified() {
1782 ConstructorFieldInitializer invocation = ParserTestCase.parse5("parseConstru ctorFieldInitializer", "a = b", []); 1814 ConstructorFieldInitializer invocation = ParserTestCase.parse4("parseConstru ctorFieldInitializer", "a = b", []);
1783 JUnitTestCase.assertNotNull(invocation.equals); 1815 JUnitTestCase.assertNotNull(invocation.equals);
1784 JUnitTestCase.assertNotNull(invocation.expression); 1816 JUnitTestCase.assertNotNull(invocation.expression);
1785 JUnitTestCase.assertNotNull(invocation.fieldName); 1817 JUnitTestCase.assertNotNull(invocation.fieldName);
1786 JUnitTestCase.assertNull(invocation.keyword); 1818 JUnitTestCase.assertNull(invocation.keyword);
1787 JUnitTestCase.assertNull(invocation.period); 1819 JUnitTestCase.assertNull(invocation.period);
1788 } 1820 }
1789 1821
1790 void test_parseConstructorName_named_noPrefix() { 1822 void test_parseConstructorName_named_noPrefix() {
1791 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A.n;", []); 1823 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A.n;", []);
1792 JUnitTestCase.assertNotNull(name.type); 1824 JUnitTestCase.assertNotNull(name.type);
1793 JUnitTestCase.assertNull(name.period); 1825 JUnitTestCase.assertNull(name.period);
1794 JUnitTestCase.assertNull(name.name); 1826 JUnitTestCase.assertNull(name.name);
1795 } 1827 }
1796 1828
1797 void test_parseConstructorName_named_prefixed() { 1829 void test_parseConstructorName_named_prefixed() {
1798 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A.n; ", []); 1830 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A.n; ", []);
1799 JUnitTestCase.assertNotNull(name.type); 1831 JUnitTestCase.assertNotNull(name.type);
1800 JUnitTestCase.assertNotNull(name.period); 1832 JUnitTestCase.assertNotNull(name.period);
1801 JUnitTestCase.assertNotNull(name.name); 1833 JUnitTestCase.assertNotNull(name.name);
1802 } 1834 }
1803 1835
1804 void test_parseConstructorName_unnamed_noPrefix() { 1836 void test_parseConstructorName_unnamed_noPrefix() {
1805 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "A;", [ ]); 1837 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "A;", [ ]);
1806 JUnitTestCase.assertNotNull(name.type); 1838 JUnitTestCase.assertNotNull(name.type);
1807 JUnitTestCase.assertNull(name.period); 1839 JUnitTestCase.assertNull(name.period);
1808 JUnitTestCase.assertNull(name.name); 1840 JUnitTestCase.assertNull(name.name);
1809 } 1841 }
1810 1842
1811 void test_parseConstructorName_unnamed_prefixed() { 1843 void test_parseConstructorName_unnamed_prefixed() {
1812 ConstructorName name = ParserTestCase.parse5("parseConstructorName", "p.A;", []); 1844 ConstructorName name = ParserTestCase.parse4("parseConstructorName", "p.A;", []);
1813 JUnitTestCase.assertNotNull(name.type); 1845 JUnitTestCase.assertNotNull(name.type);
1814 JUnitTestCase.assertNull(name.period); 1846 JUnitTestCase.assertNull(name.period);
1815 JUnitTestCase.assertNull(name.name); 1847 JUnitTestCase.assertNull(name.name);
1816 } 1848 }
1817 1849
1818 void test_parseContinueStatement_label() { 1850 void test_parseContinueStatement_label() {
1819 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); 1851 ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement" , "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1820 JUnitTestCase.assertNotNull(statement.keyword); 1852 JUnitTestCase.assertNotNull(statement.keyword);
1821 JUnitTestCase.assertNotNull(statement.label); 1853 JUnitTestCase.assertNotNull(statement.label);
1822 JUnitTestCase.assertNotNull(statement.semicolon); 1854 JUnitTestCase.assertNotNull(statement.semicolon);
1823 } 1855 }
1824 1856
1825 void test_parseContinueStatement_noLabel() { 1857 void test_parseContinueStatement_noLabel() {
1826 ContinueStatement statement = ParserTestCase.parse5("parseContinueStatement" , "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); 1858 ContinueStatement statement = ParserTestCase.parse4("parseContinueStatement" , "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]);
1827 JUnitTestCase.assertNotNull(statement.keyword); 1859 JUnitTestCase.assertNotNull(statement.keyword);
1828 JUnitTestCase.assertNull(statement.label); 1860 JUnitTestCase.assertNull(statement.label);
1829 JUnitTestCase.assertNotNull(statement.semicolon); 1861 JUnitTestCase.assertNotNull(statement.semicolon);
1830 } 1862 }
1831 1863
1832 void test_parseDirective_export() { 1864 void test_parseDirective_export() {
1833 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';"); 1865 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "export 'lib/lib.dart';");
1834 JUnitTestCase.assertNotNull(directive.keyword); 1866 JUnitTestCase.assertNotNull(directive.keyword);
1835 JUnitTestCase.assertNotNull(directive.uri); 1867 JUnitTestCase.assertNotNull(directive.uri);
1836 EngineTestCase.assertSize(0, directive.combinators); 1868 EngineTestCase.assertSize(0, directive.combinators);
(...skipping 26 matching lines...) Expand all
1863 1895
1864 void test_parseDirective_partOf() { 1896 void test_parseDirective_partOf() {
1865 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;"); 1897 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object> [emptyCommentAndMetadata()], "part of l;");
1866 JUnitTestCase.assertNotNull(directive.partToken); 1898 JUnitTestCase.assertNotNull(directive.partToken);
1867 JUnitTestCase.assertNotNull(directive.ofToken); 1899 JUnitTestCase.assertNotNull(directive.ofToken);
1868 JUnitTestCase.assertNotNull(directive.libraryName); 1900 JUnitTestCase.assertNotNull(directive.libraryName);
1869 JUnitTestCase.assertNotNull(directive.semicolon); 1901 JUnitTestCase.assertNotNull(directive.semicolon);
1870 } 1902 }
1871 1903
1872 void test_parseDocumentationComment_block() { 1904 void test_parseDocumentationComment_block() {
1873 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** */ class", []); 1905 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** */ class", []);
1874 JUnitTestCase.assertFalse(comment.isBlock); 1906 JUnitTestCase.assertFalse(comment.isBlock);
1875 JUnitTestCase.assertTrue(comment.isDocumentation); 1907 JUnitTestCase.assertTrue(comment.isDocumentation);
1876 JUnitTestCase.assertFalse(comment.isEndOfLine); 1908 JUnitTestCase.assertFalse(comment.isEndOfLine);
1877 } 1909 }
1878 1910
1879 void test_parseDocumentationComment_block_withReference() { 1911 void test_parseDocumentationComment_block_withReference() {
1880 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/** [a ] */ class", []); 1912 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/** [a ] */ class", []);
1881 JUnitTestCase.assertFalse(comment.isBlock); 1913 JUnitTestCase.assertFalse(comment.isBlock);
1882 JUnitTestCase.assertTrue(comment.isDocumentation); 1914 JUnitTestCase.assertTrue(comment.isDocumentation);
1883 JUnitTestCase.assertFalse(comment.isEndOfLine); 1915 JUnitTestCase.assertFalse(comment.isEndOfLine);
1884 NodeList<CommentReference> references = comment.references; 1916 NodeList<CommentReference> references = comment.references;
1885 EngineTestCase.assertSize(1, references); 1917 EngineTestCase.assertSize(1, references);
1886 CommentReference reference = references[0]; 1918 CommentReference reference = references[0];
1887 JUnitTestCase.assertNotNull(reference); 1919 JUnitTestCase.assertNotNull(reference);
1888 JUnitTestCase.assertEquals(5, reference.offset); 1920 JUnitTestCase.assertEquals(5, reference.offset);
1889 } 1921 }
1890 1922
1891 void test_parseDocumentationComment_endOfLine() { 1923 void test_parseDocumentationComment_endOfLine() {
1892 Comment comment = ParserTestCase.parse5("parseDocumentationComment", "/// \n /// \n class", []); 1924 Comment comment = ParserTestCase.parse4("parseDocumentationComment", "/// \n /// \n class", []);
1893 JUnitTestCase.assertFalse(comment.isBlock); 1925 JUnitTestCase.assertFalse(comment.isBlock);
1894 JUnitTestCase.assertTrue(comment.isDocumentation); 1926 JUnitTestCase.assertTrue(comment.isDocumentation);
1895 JUnitTestCase.assertFalse(comment.isEndOfLine); 1927 JUnitTestCase.assertFalse(comment.isEndOfLine);
1896 } 1928 }
1897 1929
1898 void test_parseDoStatement() { 1930 void test_parseDoStatement() {
1899 DoStatement statement = ParserTestCase.parse5("parseDoStatement", "do {} whi le (x);", []); 1931 DoStatement statement = ParserTestCase.parse4("parseDoStatement", "do {} whi le (x);", []);
1900 JUnitTestCase.assertNotNull(statement.doKeyword); 1932 JUnitTestCase.assertNotNull(statement.doKeyword);
1901 JUnitTestCase.assertNotNull(statement.body); 1933 JUnitTestCase.assertNotNull(statement.body);
1902 JUnitTestCase.assertNotNull(statement.whileKeyword); 1934 JUnitTestCase.assertNotNull(statement.whileKeyword);
1903 JUnitTestCase.assertNotNull(statement.leftParenthesis); 1935 JUnitTestCase.assertNotNull(statement.leftParenthesis);
1904 JUnitTestCase.assertNotNull(statement.condition); 1936 JUnitTestCase.assertNotNull(statement.condition);
1905 JUnitTestCase.assertNotNull(statement.rightParenthesis); 1937 JUnitTestCase.assertNotNull(statement.rightParenthesis);
1906 JUnitTestCase.assertNotNull(statement.semicolon); 1938 JUnitTestCase.assertNotNull(statement.semicolon);
1907 } 1939 }
1908 1940
1909 void test_parseEmptyStatement() { 1941 void test_parseEmptyStatement() {
1910 EmptyStatement statement = ParserTestCase.parse5("parseEmptyStatement", ";", []); 1942 EmptyStatement statement = ParserTestCase.parse4("parseEmptyStatement", ";", []);
1911 JUnitTestCase.assertNotNull(statement.semicolon); 1943 JUnitTestCase.assertNotNull(statement.semicolon);
1912 } 1944 }
1913 1945
1914 void test_parseEqualityExpression_normal() { 1946 void test_parseEqualityExpression_normal() {
1915 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "x == y", []); 1947 BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression ", "x == y", []);
1916 JUnitTestCase.assertNotNull(expression.leftOperand); 1948 JUnitTestCase.assertNotNull(expression.leftOperand);
1917 JUnitTestCase.assertNotNull(expression.operator); 1949 JUnitTestCase.assertNotNull(expression.operator);
1918 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1950 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1919 JUnitTestCase.assertNotNull(expression.rightOperand); 1951 JUnitTestCase.assertNotNull(expression.rightOperand);
1920 } 1952 }
1921 1953
1922 void test_parseEqualityExpression_super() { 1954 void test_parseEqualityExpression_super() {
1923 BinaryExpression expression = ParserTestCase.parse5("parseEqualityExpression ", "super == y", []); 1955 BinaryExpression expression = ParserTestCase.parse4("parseEqualityExpression ", "super == y", []);
1924 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 1956 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
1925 JUnitTestCase.assertNotNull(expression.operator); 1957 JUnitTestCase.assertNotNull(expression.operator);
1926 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 1958 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1927 JUnitTestCase.assertNotNull(expression.rightOperand); 1959 JUnitTestCase.assertNotNull(expression.rightOperand);
1928 } 1960 }
1929 1961
1930 void test_parseExportDirective_hide() { 1962 void test_parseExportDirective_hide() {
1931 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); 1963 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;");
1932 JUnitTestCase.assertNotNull(directive.keyword); 1964 JUnitTestCase.assertNotNull(directive.keyword);
1933 JUnitTestCase.assertNotNull(directive.uri); 1965 JUnitTestCase.assertNotNull(directive.uri);
(...skipping 28 matching lines...) Expand all
1962 void test_parseExportDirective_show_hide() { 1994 void test_parseExportDirective_show_hide() {
1963 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); 1995 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;");
1964 JUnitTestCase.assertNotNull(directive.keyword); 1996 JUnitTestCase.assertNotNull(directive.keyword);
1965 JUnitTestCase.assertNotNull(directive.uri); 1997 JUnitTestCase.assertNotNull(directive.uri);
1966 EngineTestCase.assertSize(2, directive.combinators); 1998 EngineTestCase.assertSize(2, directive.combinators);
1967 JUnitTestCase.assertNotNull(directive.semicolon); 1999 JUnitTestCase.assertNotNull(directive.semicolon);
1968 } 2000 }
1969 2001
1970 void test_parseExpression_assign() { 2002 void test_parseExpression_assign() {
1971 // TODO(brianwilkerson) Implement more tests for this method. 2003 // TODO(brianwilkerson) Implement more tests for this method.
1972 AssignmentExpression expression = ParserTestCase.parse5("parseExpression", " x = y", []); 2004 AssignmentExpression expression = ParserTestCase.parse4("parseExpression", " x = y", []);
1973 JUnitTestCase.assertNotNull(expression.leftHandSide); 2005 JUnitTestCase.assertNotNull(expression.leftHandSide);
1974 JUnitTestCase.assertNotNull(expression.operator); 2006 JUnitTestCase.assertNotNull(expression.operator);
1975 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); 2007 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
1976 JUnitTestCase.assertNotNull(expression.rightHandSide); 2008 JUnitTestCase.assertNotNull(expression.rightHandSide);
1977 } 2009 }
1978 2010
1979 void test_parseExpression_comparison() { 2011 void test_parseExpression_comparison() {
1980 BinaryExpression expression = ParserTestCase.parse5("parseExpression", "--a. b == c", []); 2012 BinaryExpression expression = ParserTestCase.parse4("parseExpression", "--a. b == c", []);
1981 JUnitTestCase.assertNotNull(expression.leftOperand); 2013 JUnitTestCase.assertNotNull(expression.leftOperand);
1982 JUnitTestCase.assertNotNull(expression.operator); 2014 JUnitTestCase.assertNotNull(expression.operator);
1983 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 2015 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
1984 JUnitTestCase.assertNotNull(expression.rightOperand); 2016 JUnitTestCase.assertNotNull(expression.rightOperand);
1985 } 2017 }
1986 2018
1987 void test_parseExpression_invokeFunctionExpression() { 2019 void test_parseExpression_invokeFunctionExpression() {
1988 FunctionExpressionInvocation invocation = ParserTestCase.parse5("parseExpres sion", "(a) {return a + a;} (3)", []); 2020 FunctionExpressionInvocation invocation = ParserTestCase.parse4("parseExpres sion", "(a) {return a + a;} (3)", []);
1989 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); 2021 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
1990 FunctionExpression expression = invocation.function as FunctionExpression; 2022 FunctionExpression expression = invocation.function as FunctionExpression;
1991 JUnitTestCase.assertNotNull(expression.parameters); 2023 JUnitTestCase.assertNotNull(expression.parameters);
1992 JUnitTestCase.assertNotNull(expression.body); 2024 JUnitTestCase.assertNotNull(expression.body);
1993 ArgumentList list = invocation.argumentList; 2025 ArgumentList list = invocation.argumentList;
1994 JUnitTestCase.assertNotNull(list); 2026 JUnitTestCase.assertNotNull(list);
1995 EngineTestCase.assertSize(1, list.arguments); 2027 EngineTestCase.assertSize(1, list.arguments);
1996 } 2028 }
1997 2029
1998 void test_parseExpression_superMethodInvocation() { 2030 void test_parseExpression_superMethodInvocation() {
1999 MethodInvocation invocation = ParserTestCase.parse5("parseExpression", "supe r.m()", []); 2031 MethodInvocation invocation = ParserTestCase.parse4("parseExpression", "supe r.m()", []);
2000 JUnitTestCase.assertNotNull(invocation.target); 2032 JUnitTestCase.assertNotNull(invocation.target);
2001 JUnitTestCase.assertNotNull(invocation.methodName); 2033 JUnitTestCase.assertNotNull(invocation.methodName);
2002 JUnitTestCase.assertNotNull(invocation.argumentList); 2034 JUnitTestCase.assertNotNull(invocation.argumentList);
2003 } 2035 }
2004 2036
2005 void test_parseExpressionList_multiple() { 2037 void test_parseExpressionList_multiple() {
2006 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3", []); 2038 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2 , 3", []);
2007 EngineTestCase.assertSize(3, result); 2039 EngineTestCase.assertSize(3, result);
2008 } 2040 }
2009 2041
2010 void test_parseExpressionList_single() { 2042 void test_parseExpressionList_single() {
2011 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1", []); 2043 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1", []);
2012 EngineTestCase.assertSize(1, result); 2044 EngineTestCase.assertSize(1, result);
2013 } 2045 }
2014 2046
2015 void test_parseExpressionWithoutCascade_assign() { 2047 void test_parseExpressionWithoutCascade_assign() {
2016 // TODO(brianwilkerson) Implement more tests for this method. 2048 // TODO(brianwilkerson) Implement more tests for this method.
2017 AssignmentExpression expression = ParserTestCase.parse5("parseExpressionWith outCascade", "x = y", []); 2049 AssignmentExpression expression = ParserTestCase.parse4("parseExpressionWith outCascade", "x = y", []);
2018 JUnitTestCase.assertNotNull(expression.leftHandSide); 2050 JUnitTestCase.assertNotNull(expression.leftHandSide);
2019 JUnitTestCase.assertNotNull(expression.operator); 2051 JUnitTestCase.assertNotNull(expression.operator);
2020 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); 2052 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type);
2021 JUnitTestCase.assertNotNull(expression.rightHandSide); 2053 JUnitTestCase.assertNotNull(expression.rightHandSide);
2022 } 2054 }
2023 2055
2024 void test_parseExpressionWithoutCascade_comparison() { 2056 void test_parseExpressionWithoutCascade_comparison() {
2025 BinaryExpression expression = ParserTestCase.parse5("parseExpressionWithoutC ascade", "--a.b == c", []); 2057 BinaryExpression expression = ParserTestCase.parse4("parseExpressionWithoutC ascade", "--a.b == c", []);
2026 JUnitTestCase.assertNotNull(expression.leftOperand); 2058 JUnitTestCase.assertNotNull(expression.leftOperand);
2027 JUnitTestCase.assertNotNull(expression.operator); 2059 JUnitTestCase.assertNotNull(expression.operator);
2028 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); 2060 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type);
2029 JUnitTestCase.assertNotNull(expression.rightOperand); 2061 JUnitTestCase.assertNotNull(expression.rightOperand);
2030 } 2062 }
2031 2063
2032 void test_parseExpressionWithoutCascade_superMethodInvocation() { 2064 void test_parseExpressionWithoutCascade_superMethodInvocation() {
2033 MethodInvocation invocation = ParserTestCase.parse5("parseExpressionWithoutC ascade", "super.m()", []); 2065 MethodInvocation invocation = ParserTestCase.parse4("parseExpressionWithoutC ascade", "super.m()", []);
2034 JUnitTestCase.assertNotNull(invocation.target); 2066 JUnitTestCase.assertNotNull(invocation.target);
2035 JUnitTestCase.assertNotNull(invocation.methodName); 2067 JUnitTestCase.assertNotNull(invocation.methodName);
2036 JUnitTestCase.assertNotNull(invocation.argumentList); 2068 JUnitTestCase.assertNotNull(invocation.argumentList);
2037 } 2069 }
2038 2070
2039 void test_parseExtendsClause() { 2071 void test_parseExtendsClause() {
2040 ExtendsClause clause = ParserTestCase.parse5("parseExtendsClause", "extends B", []); 2072 ExtendsClause clause = ParserTestCase.parse4("parseExtendsClause", "extends B", []);
2041 JUnitTestCase.assertNotNull(clause.keyword); 2073 JUnitTestCase.assertNotNull(clause.keyword);
2042 JUnitTestCase.assertNotNull(clause.superclass); 2074 JUnitTestCase.assertNotNull(clause.superclass);
2043 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); 2075 EngineTestCase.assertInstanceOf(TypeName, clause.superclass);
2044 } 2076 }
2045 2077
2046 void test_parseFinalConstVarOrType_const_noType() { 2078 void test_parseFinalConstVarOrType_const_noType() {
2047 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const"); 2079 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType" , <Object> [false], "const");
2048 Token keyword = result.keyword; 2080 Token keyword = result.keyword;
2049 JUnitTestCase.assertNotNull(keyword); 2081 JUnitTestCase.assertNotNull(keyword);
2050 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type); 2082 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword.type);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 JUnitTestCase.assertNotNull(simpleParameter.identifier); 2252 JUnitTestCase.assertNotNull(simpleParameter.identifier);
2221 JUnitTestCase.assertNotNull(simpleParameter.keyword); 2253 JUnitTestCase.assertNotNull(simpleParameter.keyword);
2222 JUnitTestCase.assertNull(simpleParameter.type); 2254 JUnitTestCase.assertNull(simpleParameter.type);
2223 JUnitTestCase.assertEquals(kind, simpleParameter.kind); 2255 JUnitTestCase.assertEquals(kind, simpleParameter.kind);
2224 JUnitTestCase.assertNotNull(parameter.separator); 2256 JUnitTestCase.assertNotNull(parameter.separator);
2225 JUnitTestCase.assertNotNull(parameter.defaultValue); 2257 JUnitTestCase.assertNotNull(parameter.defaultValue);
2226 JUnitTestCase.assertEquals(kind, parameter.kind); 2258 JUnitTestCase.assertEquals(kind, parameter.kind);
2227 } 2259 }
2228 2260
2229 void test_parseFormalParameterList_empty() { 2261 void test_parseFormalParameterList_empty() {
2230 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "()", []); 2262 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "()", []);
2231 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2263 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2232 JUnitTestCase.assertNull(parameterList.leftDelimiter); 2264 JUnitTestCase.assertNull(parameterList.leftDelimiter);
2233 EngineTestCase.assertSize(0, parameterList.parameters); 2265 EngineTestCase.assertSize(0, parameterList.parameters);
2234 JUnitTestCase.assertNull(parameterList.rightDelimiter); 2266 JUnitTestCase.assertNull(parameterList.rightDelimiter);
2235 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2267 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2236 } 2268 }
2237 2269
2238 void test_parseFormalParameterList_named_multiple() { 2270 void test_parseFormalParameterList_named_multiple() {
2239 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a : 1, B b, C c : 3})", []); 2271 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "({A a : 1, B b, C c : 3})", []);
2240 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2272 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2241 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2273 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2242 EngineTestCase.assertSize(3, parameterList.parameters); 2274 EngineTestCase.assertSize(3, parameterList.parameters);
2243 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2275 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2244 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2276 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2245 } 2277 }
2246 2278
2247 void test_parseFormalParameterList_named_single() { 2279 void test_parseFormalParameterList_named_single() {
2248 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "({A a})", []); 2280 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "({A a})", []);
2249 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2281 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2250 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2282 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2251 EngineTestCase.assertSize(1, parameterList.parameters); 2283 EngineTestCase.assertSize(1, parameterList.parameters);
2252 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2284 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2253 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2285 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2254 } 2286 }
2255 2287
2256 void test_parseFormalParameterList_normal_multiple() { 2288 void test_parseFormalParameterList_normal_multiple() {
2257 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, B b, C c)", []); 2289 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "(A a, B b, C c)", []);
2258 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2290 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2259 JUnitTestCase.assertNull(parameterList.leftDelimiter); 2291 JUnitTestCase.assertNull(parameterList.leftDelimiter);
2260 EngineTestCase.assertSize(3, parameterList.parameters); 2292 EngineTestCase.assertSize(3, parameterList.parameters);
2261 JUnitTestCase.assertNull(parameterList.rightDelimiter); 2293 JUnitTestCase.assertNull(parameterList.rightDelimiter);
2262 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2294 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2263 } 2295 }
2264 2296
2265 void test_parseFormalParameterList_normal_named() { 2297 void test_parseFormalParameterList_normal_named() {
2266 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, {B b})", []); 2298 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "(A a, {B b})", []);
2267 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2299 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2268 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2300 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2269 EngineTestCase.assertSize(2, parameterList.parameters); 2301 EngineTestCase.assertSize(2, parameterList.parameters);
2270 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2302 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2271 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2303 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2272 } 2304 }
2273 2305
2274 void test_parseFormalParameterList_normal_positional() { 2306 void test_parseFormalParameterList_normal_positional() {
2275 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a, [B b])", []); 2307 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "(A a, [B b])", []);
2276 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2308 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2277 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2309 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2278 EngineTestCase.assertSize(2, parameterList.parameters); 2310 EngineTestCase.assertSize(2, parameterList.parameters);
2279 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2311 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2280 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2312 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2281 } 2313 }
2282 2314
2283 void test_parseFormalParameterList_normal_single() { 2315 void test_parseFormalParameterList_normal_single() {
2284 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "(A a)", []); 2316 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "(A a)", []);
2285 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2317 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2286 JUnitTestCase.assertNull(parameterList.leftDelimiter); 2318 JUnitTestCase.assertNull(parameterList.leftDelimiter);
2287 EngineTestCase.assertSize(1, parameterList.parameters); 2319 EngineTestCase.assertSize(1, parameterList.parameters);
2288 JUnitTestCase.assertNull(parameterList.rightDelimiter); 2320 JUnitTestCase.assertNull(parameterList.rightDelimiter);
2289 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2321 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2290 } 2322 }
2291 2323
2292 void test_parseFormalParameterList_positional_multiple() { 2324 void test_parseFormalParameterList_positional_multiple() {
2293 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null, B b, C c = null])", []); 2325 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "([A a = null, B b, C c = null])", []);
2294 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2326 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2295 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2327 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2296 EngineTestCase.assertSize(3, parameterList.parameters); 2328 EngineTestCase.assertSize(3, parameterList.parameters);
2297 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2329 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2298 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2330 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2299 } 2331 }
2300 2332
2301 void test_parseFormalParameterList_positional_single() { 2333 void test_parseFormalParameterList_positional_single() {
2302 FormalParameterList parameterList = ParserTestCase.parse5("parseFormalParame terList", "([A a = null])", []); 2334 FormalParameterList parameterList = ParserTestCase.parse4("parseFormalParame terList", "([A a = null])", []);
2303 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); 2335 JUnitTestCase.assertNotNull(parameterList.leftParenthesis);
2304 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); 2336 JUnitTestCase.assertNotNull(parameterList.leftDelimiter);
2305 EngineTestCase.assertSize(1, parameterList.parameters); 2337 EngineTestCase.assertSize(1, parameterList.parameters);
2306 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); 2338 JUnitTestCase.assertNotNull(parameterList.rightDelimiter);
2307 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); 2339 JUnitTestCase.assertNotNull(parameterList.rightParenthesis);
2308 } 2340 }
2309 2341
2310 void test_parseForStatement_each_identifier() { 2342 void test_parseForStatement_each_identifier() {
2311 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (element in list) {}", []); 2343 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (element in list) {}", []);
2312 JUnitTestCase.assertNotNull(statement.forKeyword); 2344 JUnitTestCase.assertNotNull(statement.forKeyword);
2313 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2345 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2314 JUnitTestCase.assertNull(statement.loopVariable); 2346 JUnitTestCase.assertNull(statement.loopVariable);
2315 JUnitTestCase.assertNotNull(statement.identifier); 2347 JUnitTestCase.assertNotNull(statement.identifier);
2316 JUnitTestCase.assertNotNull(statement.inKeyword); 2348 JUnitTestCase.assertNotNull(statement.inKeyword);
2317 JUnitTestCase.assertNotNull(statement.iterator); 2349 JUnitTestCase.assertNotNull(statement.iterator);
2318 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2350 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2319 JUnitTestCase.assertNotNull(statement.body); 2351 JUnitTestCase.assertNotNull(statement.body);
2320 } 2352 }
2321 2353
2322 void test_parseForStatement_each_noType_metadata() { 2354 void test_parseForStatement_each_noType_metadata() {
2323 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var element in list) {}", []); 2355 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var element in list) {}", []);
2324 JUnitTestCase.assertNotNull(statement.forKeyword); 2356 JUnitTestCase.assertNotNull(statement.forKeyword);
2325 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2357 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2326 JUnitTestCase.assertNotNull(statement.loopVariable); 2358 JUnitTestCase.assertNotNull(statement.loopVariable);
2327 EngineTestCase.assertSize(1, statement.loopVariable.metadata); 2359 EngineTestCase.assertSize(1, statement.loopVariable.metadata);
2328 JUnitTestCase.assertNull(statement.identifier); 2360 JUnitTestCase.assertNull(statement.identifier);
2329 JUnitTestCase.assertNotNull(statement.inKeyword); 2361 JUnitTestCase.assertNotNull(statement.inKeyword);
2330 JUnitTestCase.assertNotNull(statement.iterator); 2362 JUnitTestCase.assertNotNull(statement.iterator);
2331 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2363 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2332 JUnitTestCase.assertNotNull(statement.body); 2364 JUnitTestCase.assertNotNull(statement.body);
2333 } 2365 }
2334 2366
2335 void test_parseForStatement_each_type() { 2367 void test_parseForStatement_each_type() {
2336 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (A element in list) {}", []); 2368 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (A element in list) {}", []);
2337 JUnitTestCase.assertNotNull(statement.forKeyword); 2369 JUnitTestCase.assertNotNull(statement.forKeyword);
2338 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2370 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2339 JUnitTestCase.assertNotNull(statement.loopVariable); 2371 JUnitTestCase.assertNotNull(statement.loopVariable);
2340 JUnitTestCase.assertNull(statement.identifier); 2372 JUnitTestCase.assertNull(statement.identifier);
2341 JUnitTestCase.assertNotNull(statement.inKeyword); 2373 JUnitTestCase.assertNotNull(statement.inKeyword);
2342 JUnitTestCase.assertNotNull(statement.iterator); 2374 JUnitTestCase.assertNotNull(statement.iterator);
2343 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2375 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2344 JUnitTestCase.assertNotNull(statement.body); 2376 JUnitTestCase.assertNotNull(statement.body);
2345 } 2377 }
2346 2378
2347 void test_parseForStatement_each_var() { 2379 void test_parseForStatement_each_var() {
2348 ForEachStatement statement = ParserTestCase.parse5("parseForStatement", "for (var element in list) {}", []); 2380 ForEachStatement statement = ParserTestCase.parse4("parseForStatement", "for (var element in list) {}", []);
2349 JUnitTestCase.assertNotNull(statement.forKeyword); 2381 JUnitTestCase.assertNotNull(statement.forKeyword);
2350 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2382 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2351 JUnitTestCase.assertNotNull(statement.loopVariable); 2383 JUnitTestCase.assertNotNull(statement.loopVariable);
2352 JUnitTestCase.assertNull(statement.identifier); 2384 JUnitTestCase.assertNull(statement.identifier);
2353 JUnitTestCase.assertNotNull(statement.inKeyword); 2385 JUnitTestCase.assertNotNull(statement.inKeyword);
2354 JUnitTestCase.assertNotNull(statement.iterator); 2386 JUnitTestCase.assertNotNull(statement.iterator);
2355 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2387 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2356 JUnitTestCase.assertNotNull(statement.body); 2388 JUnitTestCase.assertNotNull(statement.body);
2357 } 2389 }
2358 2390
2359 void test_parseForStatement_loop_c() { 2391 void test_parseForStatement_loop_c() {
2360 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count;) {}", []); 2392 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count;) {}", []);
2361 JUnitTestCase.assertNotNull(statement.forKeyword); 2393 JUnitTestCase.assertNotNull(statement.forKeyword);
2362 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2394 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2363 JUnitTestCase.assertNull(statement.variables); 2395 JUnitTestCase.assertNull(statement.variables);
2364 JUnitTestCase.assertNull(statement.initialization); 2396 JUnitTestCase.assertNull(statement.initialization);
2365 JUnitTestCase.assertNotNull(statement.leftSeparator); 2397 JUnitTestCase.assertNotNull(statement.leftSeparator);
2366 JUnitTestCase.assertNotNull(statement.condition); 2398 JUnitTestCase.assertNotNull(statement.condition);
2367 JUnitTestCase.assertNotNull(statement.rightSeparator); 2399 JUnitTestCase.assertNotNull(statement.rightSeparator);
2368 EngineTestCase.assertSize(0, statement.updaters); 2400 EngineTestCase.assertSize(0, statement.updaters);
2369 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2401 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2370 JUnitTestCase.assertNotNull(statement.body); 2402 JUnitTestCase.assertNotNull(statement.body);
2371 } 2403 }
2372 2404
2373 void test_parseForStatement_loop_cu() { 2405 void test_parseForStatement_loop_cu() {
2374 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (; i < count; i++) {}", []); 2406 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (; i < count; i++) {}", []);
2375 JUnitTestCase.assertNotNull(statement.forKeyword); 2407 JUnitTestCase.assertNotNull(statement.forKeyword);
2376 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2408 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2377 JUnitTestCase.assertNull(statement.variables); 2409 JUnitTestCase.assertNull(statement.variables);
2378 JUnitTestCase.assertNull(statement.initialization); 2410 JUnitTestCase.assertNull(statement.initialization);
2379 JUnitTestCase.assertNotNull(statement.leftSeparator); 2411 JUnitTestCase.assertNotNull(statement.leftSeparator);
2380 JUnitTestCase.assertNotNull(statement.condition); 2412 JUnitTestCase.assertNotNull(statement.condition);
2381 JUnitTestCase.assertNotNull(statement.rightSeparator); 2413 JUnitTestCase.assertNotNull(statement.rightSeparator);
2382 EngineTestCase.assertSize(1, statement.updaters); 2414 EngineTestCase.assertSize(1, statement.updaters);
2383 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2415 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2384 JUnitTestCase.assertNotNull(statement.body); 2416 JUnitTestCase.assertNotNull(statement.body);
2385 } 2417 }
2386 2418
2387 void test_parseForStatement_loop_ecu() { 2419 void test_parseForStatement_loop_ecu() {
2388 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (i- -; i < count; i++) {}", []); 2420 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (i- -; i < count; i++) {}", []);
2389 JUnitTestCase.assertNotNull(statement.forKeyword); 2421 JUnitTestCase.assertNotNull(statement.forKeyword);
2390 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2422 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2391 JUnitTestCase.assertNull(statement.variables); 2423 JUnitTestCase.assertNull(statement.variables);
2392 JUnitTestCase.assertNotNull(statement.initialization); 2424 JUnitTestCase.assertNotNull(statement.initialization);
2393 JUnitTestCase.assertNotNull(statement.leftSeparator); 2425 JUnitTestCase.assertNotNull(statement.leftSeparator);
2394 JUnitTestCase.assertNotNull(statement.condition); 2426 JUnitTestCase.assertNotNull(statement.condition);
2395 JUnitTestCase.assertNotNull(statement.rightSeparator); 2427 JUnitTestCase.assertNotNull(statement.rightSeparator);
2396 EngineTestCase.assertSize(1, statement.updaters); 2428 EngineTestCase.assertSize(1, statement.updaters);
2397 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2429 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2398 JUnitTestCase.assertNotNull(statement.body); 2430 JUnitTestCase.assertNotNull(statement.body);
2399 } 2431 }
2400 2432
2401 void test_parseForStatement_loop_i() { 2433 void test_parseForStatement_loop_i() {
2402 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;;) {}", []); 2434 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va r i = 0;;) {}", []);
2403 JUnitTestCase.assertNotNull(statement.forKeyword); 2435 JUnitTestCase.assertNotNull(statement.forKeyword);
2404 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2436 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2405 VariableDeclarationList variables = statement.variables; 2437 VariableDeclarationList variables = statement.variables;
2406 JUnitTestCase.assertNotNull(variables); 2438 JUnitTestCase.assertNotNull(variables);
2407 EngineTestCase.assertSize(0, variables.metadata); 2439 EngineTestCase.assertSize(0, variables.metadata);
2408 EngineTestCase.assertSize(1, variables.variables); 2440 EngineTestCase.assertSize(1, variables.variables);
2409 JUnitTestCase.assertNull(statement.initialization); 2441 JUnitTestCase.assertNull(statement.initialization);
2410 JUnitTestCase.assertNotNull(statement.leftSeparator); 2442 JUnitTestCase.assertNotNull(statement.leftSeparator);
2411 JUnitTestCase.assertNull(statement.condition); 2443 JUnitTestCase.assertNull(statement.condition);
2412 JUnitTestCase.assertNotNull(statement.rightSeparator); 2444 JUnitTestCase.assertNotNull(statement.rightSeparator);
2413 EngineTestCase.assertSize(0, statement.updaters); 2445 EngineTestCase.assertSize(0, statement.updaters);
2414 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2446 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2415 JUnitTestCase.assertNotNull(statement.body); 2447 JUnitTestCase.assertNotNull(statement.body);
2416 } 2448 }
2417 2449
2418 void test_parseForStatement_loop_i_withMetadata() { 2450 void test_parseForStatement_loop_i_withMetadata() {
2419 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (@A var i = 0;;) {}", []); 2451 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (@A var i = 0;;) {}", []);
2420 JUnitTestCase.assertNotNull(statement.forKeyword); 2452 JUnitTestCase.assertNotNull(statement.forKeyword);
2421 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2453 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2422 VariableDeclarationList variables = statement.variables; 2454 VariableDeclarationList variables = statement.variables;
2423 JUnitTestCase.assertNotNull(variables); 2455 JUnitTestCase.assertNotNull(variables);
2424 EngineTestCase.assertSize(1, variables.metadata); 2456 EngineTestCase.assertSize(1, variables.metadata);
2425 EngineTestCase.assertSize(1, variables.variables); 2457 EngineTestCase.assertSize(1, variables.variables);
2426 JUnitTestCase.assertNull(statement.initialization); 2458 JUnitTestCase.assertNull(statement.initialization);
2427 JUnitTestCase.assertNotNull(statement.leftSeparator); 2459 JUnitTestCase.assertNotNull(statement.leftSeparator);
2428 JUnitTestCase.assertNull(statement.condition); 2460 JUnitTestCase.assertNull(statement.condition);
2429 JUnitTestCase.assertNotNull(statement.rightSeparator); 2461 JUnitTestCase.assertNotNull(statement.rightSeparator);
2430 EngineTestCase.assertSize(0, statement.updaters); 2462 EngineTestCase.assertSize(0, statement.updaters);
2431 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2463 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2432 JUnitTestCase.assertNotNull(statement.body); 2464 JUnitTestCase.assertNotNull(statement.body);
2433 } 2465 }
2434 2466
2435 void test_parseForStatement_loop_ic() { 2467 void test_parseForStatement_loop_ic() {
2436 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count;) {}", []); 2468 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va r i = 0; i < count;) {}", []);
2437 JUnitTestCase.assertNotNull(statement.forKeyword); 2469 JUnitTestCase.assertNotNull(statement.forKeyword);
2438 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2470 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2439 VariableDeclarationList variables = statement.variables; 2471 VariableDeclarationList variables = statement.variables;
2440 JUnitTestCase.assertNotNull(variables); 2472 JUnitTestCase.assertNotNull(variables);
2441 EngineTestCase.assertSize(1, variables.variables); 2473 EngineTestCase.assertSize(1, variables.variables);
2442 JUnitTestCase.assertNull(statement.initialization); 2474 JUnitTestCase.assertNull(statement.initialization);
2443 JUnitTestCase.assertNotNull(statement.leftSeparator); 2475 JUnitTestCase.assertNotNull(statement.leftSeparator);
2444 JUnitTestCase.assertNotNull(statement.condition); 2476 JUnitTestCase.assertNotNull(statement.condition);
2445 JUnitTestCase.assertNotNull(statement.rightSeparator); 2477 JUnitTestCase.assertNotNull(statement.rightSeparator);
2446 EngineTestCase.assertSize(0, statement.updaters); 2478 EngineTestCase.assertSize(0, statement.updaters);
2447 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2479 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2448 JUnitTestCase.assertNotNull(statement.body); 2480 JUnitTestCase.assertNotNull(statement.body);
2449 } 2481 }
2450 2482
2451 void test_parseForStatement_loop_icu() { 2483 void test_parseForStatement_loop_icu() {
2452 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0; i < count; i++) {}", []); 2484 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va r i = 0; i < count; i++) {}", []);
2453 JUnitTestCase.assertNotNull(statement.forKeyword); 2485 JUnitTestCase.assertNotNull(statement.forKeyword);
2454 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2486 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2455 VariableDeclarationList variables = statement.variables; 2487 VariableDeclarationList variables = statement.variables;
2456 JUnitTestCase.assertNotNull(variables); 2488 JUnitTestCase.assertNotNull(variables);
2457 EngineTestCase.assertSize(1, variables.variables); 2489 EngineTestCase.assertSize(1, variables.variables);
2458 JUnitTestCase.assertNull(statement.initialization); 2490 JUnitTestCase.assertNull(statement.initialization);
2459 JUnitTestCase.assertNotNull(statement.leftSeparator); 2491 JUnitTestCase.assertNotNull(statement.leftSeparator);
2460 JUnitTestCase.assertNotNull(statement.condition); 2492 JUnitTestCase.assertNotNull(statement.condition);
2461 JUnitTestCase.assertNotNull(statement.rightSeparator); 2493 JUnitTestCase.assertNotNull(statement.rightSeparator);
2462 EngineTestCase.assertSize(1, statement.updaters); 2494 EngineTestCase.assertSize(1, statement.updaters);
2463 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2495 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2464 JUnitTestCase.assertNotNull(statement.body); 2496 JUnitTestCase.assertNotNull(statement.body);
2465 } 2497 }
2466 2498
2467 void test_parseForStatement_loop_iicuu() { 2499 void test_parseForStatement_loop_iicuu() {
2468 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (in t i = 0, j = count; i < j; i++, j--) {}", []); 2500 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (in t i = 0, j = count; i < j; i++, j--) {}", []);
2469 JUnitTestCase.assertNotNull(statement.forKeyword); 2501 JUnitTestCase.assertNotNull(statement.forKeyword);
2470 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2502 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2471 VariableDeclarationList variables = statement.variables; 2503 VariableDeclarationList variables = statement.variables;
2472 JUnitTestCase.assertNotNull(variables); 2504 JUnitTestCase.assertNotNull(variables);
2473 EngineTestCase.assertSize(2, variables.variables); 2505 EngineTestCase.assertSize(2, variables.variables);
2474 JUnitTestCase.assertNull(statement.initialization); 2506 JUnitTestCase.assertNull(statement.initialization);
2475 JUnitTestCase.assertNotNull(statement.leftSeparator); 2507 JUnitTestCase.assertNotNull(statement.leftSeparator);
2476 JUnitTestCase.assertNotNull(statement.condition); 2508 JUnitTestCase.assertNotNull(statement.condition);
2477 JUnitTestCase.assertNotNull(statement.rightSeparator); 2509 JUnitTestCase.assertNotNull(statement.rightSeparator);
2478 EngineTestCase.assertSize(2, statement.updaters); 2510 EngineTestCase.assertSize(2, statement.updaters);
2479 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2511 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2480 JUnitTestCase.assertNotNull(statement.body); 2512 JUnitTestCase.assertNotNull(statement.body);
2481 } 2513 }
2482 2514
2483 void test_parseForStatement_loop_iu() { 2515 void test_parseForStatement_loop_iu() {
2484 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (va r i = 0;; i++) {}", []); 2516 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (va r i = 0;; i++) {}", []);
2485 JUnitTestCase.assertNotNull(statement.forKeyword); 2517 JUnitTestCase.assertNotNull(statement.forKeyword);
2486 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2518 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2487 VariableDeclarationList variables = statement.variables; 2519 VariableDeclarationList variables = statement.variables;
2488 JUnitTestCase.assertNotNull(variables); 2520 JUnitTestCase.assertNotNull(variables);
2489 EngineTestCase.assertSize(1, variables.variables); 2521 EngineTestCase.assertSize(1, variables.variables);
2490 JUnitTestCase.assertNull(statement.initialization); 2522 JUnitTestCase.assertNull(statement.initialization);
2491 JUnitTestCase.assertNotNull(statement.leftSeparator); 2523 JUnitTestCase.assertNotNull(statement.leftSeparator);
2492 JUnitTestCase.assertNull(statement.condition); 2524 JUnitTestCase.assertNull(statement.condition);
2493 JUnitTestCase.assertNotNull(statement.rightSeparator); 2525 JUnitTestCase.assertNotNull(statement.rightSeparator);
2494 EngineTestCase.assertSize(1, statement.updaters); 2526 EngineTestCase.assertSize(1, statement.updaters);
2495 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2527 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2496 JUnitTestCase.assertNotNull(statement.body); 2528 JUnitTestCase.assertNotNull(statement.body);
2497 } 2529 }
2498 2530
2499 void test_parseForStatement_loop_u() { 2531 void test_parseForStatement_loop_u() {
2500 ForStatement statement = ParserTestCase.parse5("parseForStatement", "for (;; i++) {}", []); 2532 ForStatement statement = ParserTestCase.parse4("parseForStatement", "for (;; i++) {}", []);
2501 JUnitTestCase.assertNotNull(statement.forKeyword); 2533 JUnitTestCase.assertNotNull(statement.forKeyword);
2502 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2534 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2503 JUnitTestCase.assertNull(statement.variables); 2535 JUnitTestCase.assertNull(statement.variables);
2504 JUnitTestCase.assertNull(statement.initialization); 2536 JUnitTestCase.assertNull(statement.initialization);
2505 JUnitTestCase.assertNotNull(statement.leftSeparator); 2537 JUnitTestCase.assertNotNull(statement.leftSeparator);
2506 JUnitTestCase.assertNull(statement.condition); 2538 JUnitTestCase.assertNull(statement.condition);
2507 JUnitTestCase.assertNotNull(statement.rightSeparator); 2539 JUnitTestCase.assertNotNull(statement.rightSeparator);
2508 EngineTestCase.assertSize(1, statement.updaters); 2540 EngineTestCase.assertSize(1, statement.updaters);
2509 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2541 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2510 JUnitTestCase.assertNotNull(statement.body); 2542 JUnitTestCase.assertNotNull(statement.body);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
2588 JUnitTestCase.assertEquals(returnType, declaration.returnType); 2620 JUnitTestCase.assertEquals(returnType, declaration.returnType);
2589 JUnitTestCase.assertNotNull(declaration.name); 2621 JUnitTestCase.assertNotNull(declaration.name);
2590 FunctionExpression expression = declaration.functionExpression; 2622 FunctionExpression expression = declaration.functionExpression;
2591 JUnitTestCase.assertNotNull(expression); 2623 JUnitTestCase.assertNotNull(expression);
2592 JUnitTestCase.assertNotNull(expression.body); 2624 JUnitTestCase.assertNotNull(expression.body);
2593 JUnitTestCase.assertNotNull(expression.parameters); 2625 JUnitTestCase.assertNotNull(expression.parameters);
2594 JUnitTestCase.assertNotNull(declaration.propertyKeyword); 2626 JUnitTestCase.assertNotNull(declaration.propertyKeyword);
2595 } 2627 }
2596 2628
2597 void test_parseFunctionDeclarationStatement() { 2629 void test_parseFunctionDeclarationStatement() {
2598 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseFunctio nDeclarationStatement", "void f(int p) => p * 2;", []); 2630 FunctionDeclarationStatement statement = ParserTestCase.parse4("parseFunctio nDeclarationStatement", "void f(int p) => p * 2;", []);
2599 JUnitTestCase.assertNotNull(statement.functionDeclaration); 2631 JUnitTestCase.assertNotNull(statement.functionDeclaration);
2600 } 2632 }
2601 2633
2602 void test_parseFunctionExpression_body_inExpression() { 2634 void test_parseFunctionExpression_body_inExpression() {
2603 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "(int i) => i++", []); 2635 FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpressi on", "(int i) => i++", []);
2604 JUnitTestCase.assertNotNull(expression.body); 2636 JUnitTestCase.assertNotNull(expression.body);
2605 JUnitTestCase.assertNotNull(expression.parameters); 2637 JUnitTestCase.assertNotNull(expression.parameters);
2606 JUnitTestCase.assertNull((expression.body as ExpressionFunctionBody).semicol on); 2638 JUnitTestCase.assertNull((expression.body as ExpressionFunctionBody).semicol on);
2607 } 2639 }
2608 2640
2609 void test_parseFunctionExpression_minimal() { 2641 void test_parseFunctionExpression_minimal() {
2610 FunctionExpression expression = ParserTestCase.parse5("parseFunctionExpressi on", "() {}", []); 2642 FunctionExpression expression = ParserTestCase.parse4("parseFunctionExpressi on", "() {}", []);
2611 JUnitTestCase.assertNotNull(expression.body); 2643 JUnitTestCase.assertNotNull(expression.body);
2612 JUnitTestCase.assertNotNull(expression.parameters); 2644 JUnitTestCase.assertNotNull(expression.parameters);
2613 } 2645 }
2614 2646
2615 void test_parseGetter_nonStatic() { 2647 void test_parseGetter_nonStatic() {
2616 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 2648 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
2617 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); 2649 TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
2618 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "get a;"); 2650 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "get a;");
2619 JUnitTestCase.assertNotNull(method.body); 2651 JUnitTestCase.assertNotNull(method.body);
2620 JUnitTestCase.assertEquals(comment, method.documentationComment); 2652 JUnitTestCase.assertEquals(comment, method.documentationComment);
(...skipping 20 matching lines...) Expand all
2641 JUnitTestCase.assertNull(method.externalKeyword); 2673 JUnitTestCase.assertNull(method.externalKeyword);
2642 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); 2674 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
2643 JUnitTestCase.assertNotNull(method.name); 2675 JUnitTestCase.assertNotNull(method.name);
2644 JUnitTestCase.assertNull(method.operatorKeyword); 2676 JUnitTestCase.assertNull(method.operatorKeyword);
2645 JUnitTestCase.assertNull(method.parameters); 2677 JUnitTestCase.assertNull(method.parameters);
2646 JUnitTestCase.assertNotNull(method.propertyKeyword); 2678 JUnitTestCase.assertNotNull(method.propertyKeyword);
2647 JUnitTestCase.assertEquals(returnType, method.returnType); 2679 JUnitTestCase.assertEquals(returnType, method.returnType);
2648 } 2680 }
2649 2681
2650 void test_parseIdentifierList_multiple() { 2682 void test_parseIdentifierList_multiple() {
2651 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a, b, c", []); 2683 List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", " a, b, c", []);
2652 EngineTestCase.assertSize(3, list); 2684 EngineTestCase.assertSize(3, list);
2653 } 2685 }
2654 2686
2655 void test_parseIdentifierList_single() { 2687 void test_parseIdentifierList_single() {
2656 List<SimpleIdentifier> list = ParserTestCase.parse5("parseIdentifierList", " a", []); 2688 List<SimpleIdentifier> list = ParserTestCase.parse4("parseIdentifierList", " a", []);
2657 EngineTestCase.assertSize(1, list); 2689 EngineTestCase.assertSize(1, list);
2658 } 2690 }
2659 2691
2660 void test_parseIfStatement_else_block() { 2692 void test_parseIfStatement_else_block() {
2661 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} else {}", []); 2693 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {} else {}", []);
2662 JUnitTestCase.assertNotNull(statement.ifKeyword); 2694 JUnitTestCase.assertNotNull(statement.ifKeyword);
2663 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2695 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2664 JUnitTestCase.assertNotNull(statement.condition); 2696 JUnitTestCase.assertNotNull(statement.condition);
2665 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2697 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2666 JUnitTestCase.assertNotNull(statement.thenStatement); 2698 JUnitTestCase.assertNotNull(statement.thenStatement);
2667 JUnitTestCase.assertNotNull(statement.elseKeyword); 2699 JUnitTestCase.assertNotNull(statement.elseKeyword);
2668 JUnitTestCase.assertNotNull(statement.elseStatement); 2700 JUnitTestCase.assertNotNull(statement.elseStatement);
2669 } 2701 }
2670 2702
2671 void test_parseIfStatement_else_statement() { 2703 void test_parseIfStatement_else_statement() {
2672 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x); else f(y);", []); 2704 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f( x); else f(y);", []);
2673 JUnitTestCase.assertNotNull(statement.ifKeyword); 2705 JUnitTestCase.assertNotNull(statement.ifKeyword);
2674 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2706 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2675 JUnitTestCase.assertNotNull(statement.condition); 2707 JUnitTestCase.assertNotNull(statement.condition);
2676 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2708 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2677 JUnitTestCase.assertNotNull(statement.thenStatement); 2709 JUnitTestCase.assertNotNull(statement.thenStatement);
2678 JUnitTestCase.assertNotNull(statement.elseKeyword); 2710 JUnitTestCase.assertNotNull(statement.elseKeyword);
2679 JUnitTestCase.assertNotNull(statement.elseStatement); 2711 JUnitTestCase.assertNotNull(statement.elseStatement);
2680 } 2712 }
2681 2713
2682 void test_parseIfStatement_noElse_block() { 2714 void test_parseIfStatement_noElse_block() {
2683 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) {} ", []); 2715 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) {} ", []);
2684 JUnitTestCase.assertNotNull(statement.ifKeyword); 2716 JUnitTestCase.assertNotNull(statement.ifKeyword);
2685 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2717 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2686 JUnitTestCase.assertNotNull(statement.condition); 2718 JUnitTestCase.assertNotNull(statement.condition);
2687 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2719 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2688 JUnitTestCase.assertNotNull(statement.thenStatement); 2720 JUnitTestCase.assertNotNull(statement.thenStatement);
2689 JUnitTestCase.assertNull(statement.elseKeyword); 2721 JUnitTestCase.assertNull(statement.elseKeyword);
2690 JUnitTestCase.assertNull(statement.elseStatement); 2722 JUnitTestCase.assertNull(statement.elseStatement);
2691 } 2723 }
2692 2724
2693 void test_parseIfStatement_noElse_statement() { 2725 void test_parseIfStatement_noElse_statement() {
2694 IfStatement statement = ParserTestCase.parse5("parseIfStatement", "if (x) f( x);", []); 2726 IfStatement statement = ParserTestCase.parse4("parseIfStatement", "if (x) f( x);", []);
2695 JUnitTestCase.assertNotNull(statement.ifKeyword); 2727 JUnitTestCase.assertNotNull(statement.ifKeyword);
2696 JUnitTestCase.assertNotNull(statement.leftParenthesis); 2728 JUnitTestCase.assertNotNull(statement.leftParenthesis);
2697 JUnitTestCase.assertNotNull(statement.condition); 2729 JUnitTestCase.assertNotNull(statement.condition);
2698 JUnitTestCase.assertNotNull(statement.rightParenthesis); 2730 JUnitTestCase.assertNotNull(statement.rightParenthesis);
2699 JUnitTestCase.assertNotNull(statement.thenStatement); 2731 JUnitTestCase.assertNotNull(statement.thenStatement);
2700 JUnitTestCase.assertNull(statement.elseKeyword); 2732 JUnitTestCase.assertNull(statement.elseKeyword);
2701 JUnitTestCase.assertNull(statement.elseStatement); 2733 JUnitTestCase.assertNull(statement.elseStatement);
2702 } 2734 }
2703 2735
2704 void test_parseImplementsClause_multiple() { 2736 void test_parseImplementsClause_multiple() {
2705 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A, B, C", []); 2737 ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "im plements A, B, C", []);
2706 EngineTestCase.assertSize(3, clause.interfaces); 2738 EngineTestCase.assertSize(3, clause.interfaces);
2707 JUnitTestCase.assertNotNull(clause.keyword); 2739 JUnitTestCase.assertNotNull(clause.keyword);
2708 } 2740 }
2709 2741
2710 void test_parseImplementsClause_single() { 2742 void test_parseImplementsClause_single() {
2711 ImplementsClause clause = ParserTestCase.parse5("parseImplementsClause", "im plements A", []); 2743 ImplementsClause clause = ParserTestCase.parse4("parseImplementsClause", "im plements A", []);
2712 EngineTestCase.assertSize(1, clause.interfaces); 2744 EngineTestCase.assertSize(1, clause.interfaces);
2713 JUnitTestCase.assertNotNull(clause.keyword); 2745 JUnitTestCase.assertNotNull(clause.keyword);
2714 } 2746 }
2715 2747
2716 void test_parseImportDirective_hide() { 2748 void test_parseImportDirective_hide() {
2717 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); 2749 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;");
2718 JUnitTestCase.assertNotNull(directive.keyword); 2750 JUnitTestCase.assertNotNull(directive.keyword);
2719 JUnitTestCase.assertNotNull(directive.uri); 2751 JUnitTestCase.assertNotNull(directive.uri);
2720 JUnitTestCase.assertNull(directive.asToken); 2752 JUnitTestCase.assertNull(directive.asToken);
2721 JUnitTestCase.assertNull(directive.prefix); 2753 JUnitTestCase.assertNull(directive.prefix);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
2861 2893
2862 void test_parseLibraryDirective() { 2894 void test_parseLibraryDirective() {
2863 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", < Object> [emptyCommentAndMetadata()], "library l;"); 2895 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", < Object> [emptyCommentAndMetadata()], "library l;");
2864 JUnitTestCase.assertNotNull(directive.libraryToken); 2896 JUnitTestCase.assertNotNull(directive.libraryToken);
2865 JUnitTestCase.assertNotNull(directive.name); 2897 JUnitTestCase.assertNotNull(directive.name);
2866 JUnitTestCase.assertNotNull(directive.semicolon); 2898 JUnitTestCase.assertNotNull(directive.semicolon);
2867 } 2899 }
2868 2900
2869 void test_parseLibraryIdentifier_multiple() { 2901 void test_parseLibraryIdentifier_multiple() {
2870 String name = "a.b.c"; 2902 String name = "a.b.c";
2871 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []); 2903 LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier ", name, []);
2872 JUnitTestCase.assertEquals(name, identifier.name); 2904 JUnitTestCase.assertEquals(name, identifier.name);
2873 } 2905 }
2874 2906
2875 void test_parseLibraryIdentifier_single() { 2907 void test_parseLibraryIdentifier_single() {
2876 String name = "a"; 2908 String name = "a";
2877 LibraryIdentifier identifier = ParserTestCase.parse5("parseLibraryIdentifier ", name, []); 2909 LibraryIdentifier identifier = ParserTestCase.parse4("parseLibraryIdentifier ", name, []);
2878 JUnitTestCase.assertEquals(name, identifier.name); 2910 JUnitTestCase.assertEquals(name, identifier.name);
2879 } 2911 }
2880 2912
2881 void test_parseListLiteral_empty_oneToken() { 2913 void test_parseListLiteral_empty_oneToken() {
2882 Token token = TokenFactory.token(Keyword.CONST); 2914 Token token = TokenFactory.token(Keyword.CONST);
2883 TypeArgumentList typeArguments = null; 2915 TypeArgumentList typeArguments = null;
2884 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en, typeArguments], "[]"); 2916 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok en, typeArguments], "[]");
2885 JUnitTestCase.assertEquals(token, literal.constKeyword); 2917 JUnitTestCase.assertEquals(token, literal.constKeyword);
2886 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); 2918 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments);
2887 JUnitTestCase.assertNotNull(literal.leftBracket); 2919 JUnitTestCase.assertNotNull(literal.leftBracket);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
2948 void test_parseListOrMapLiteral_map_type() { 2980 void test_parseListOrMapLiteral_map_type() {
2949 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<String, int> {'1' : 1}"); 2981 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object> [null], "<String, int> {'1' : 1}");
2950 JUnitTestCase.assertNull(literal.constKeyword); 2982 JUnitTestCase.assertNull(literal.constKeyword);
2951 JUnitTestCase.assertNotNull(literal.typeArguments); 2983 JUnitTestCase.assertNotNull(literal.typeArguments);
2952 JUnitTestCase.assertNotNull(literal.leftBracket); 2984 JUnitTestCase.assertNotNull(literal.leftBracket);
2953 EngineTestCase.assertSize(1, literal.entries); 2985 EngineTestCase.assertSize(1, literal.entries);
2954 JUnitTestCase.assertNotNull(literal.rightBracket); 2986 JUnitTestCase.assertNotNull(literal.rightBracket);
2955 } 2987 }
2956 2988
2957 void test_parseLogicalAndExpression() { 2989 void test_parseLogicalAndExpression() {
2958 BinaryExpression expression = ParserTestCase.parse5("parseLogicalAndExpressi on", "x && y", []); 2990 BinaryExpression expression = ParserTestCase.parse4("parseLogicalAndExpressi on", "x && y", []);
2959 JUnitTestCase.assertNotNull(expression.leftOperand); 2991 JUnitTestCase.assertNotNull(expression.leftOperand);
2960 JUnitTestCase.assertNotNull(expression.operator); 2992 JUnitTestCase.assertNotNull(expression.operator);
2961 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato r.type); 2993 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato r.type);
2962 JUnitTestCase.assertNotNull(expression.rightOperand); 2994 JUnitTestCase.assertNotNull(expression.rightOperand);
2963 } 2995 }
2964 2996
2965 void test_parseLogicalOrExpression() { 2997 void test_parseLogicalOrExpression() {
2966 BinaryExpression expression = ParserTestCase.parse5("parseLogicalOrExpressio n", "x || y", []); 2998 BinaryExpression expression = ParserTestCase.parse4("parseLogicalOrExpressio n", "x || y", []);
2967 JUnitTestCase.assertNotNull(expression.leftOperand); 2999 JUnitTestCase.assertNotNull(expression.leftOperand);
2968 JUnitTestCase.assertNotNull(expression.operator); 3000 JUnitTestCase.assertNotNull(expression.operator);
2969 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); 3001 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type);
2970 JUnitTestCase.assertNotNull(expression.rightOperand); 3002 JUnitTestCase.assertNotNull(expression.rightOperand);
2971 } 3003 }
2972 3004
2973 void test_parseMapLiteral_empty() { 3005 void test_parseMapLiteral_empty() {
2974 Token token = TokenFactory.token(Keyword.CONST); 3006 Token token = TokenFactory.token(Keyword.CONST);
2975 TypeArgumentList typeArguments = ASTFactory.typeArgumentList([ 3007 TypeArgumentList typeArguments = ASTFactory.typeArgumentList([
2976 ASTFactory.typeName4("String", []), 3008 ASTFactory.typeName4("String", []),
(...skipping 14 matching lines...) Expand all
2991 } 3023 }
2992 3024
2993 void test_parseMapLiteral_single() { 3025 void test_parseMapLiteral_single() {
2994 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}"); 3026 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null, null], "{'x' : y}");
2995 JUnitTestCase.assertNotNull(literal.leftBracket); 3027 JUnitTestCase.assertNotNull(literal.leftBracket);
2996 EngineTestCase.assertSize(1, literal.entries); 3028 EngineTestCase.assertSize(1, literal.entries);
2997 JUnitTestCase.assertNotNull(literal.rightBracket); 3029 JUnitTestCase.assertNotNull(literal.rightBracket);
2998 } 3030 }
2999 3031
3000 void test_parseMapLiteralEntry_complex() { 3032 void test_parseMapLiteralEntry_complex() {
3001 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "2 + 2 : y", []); 3033 MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "2 + 2 : y", []);
3002 JUnitTestCase.assertNotNull(entry.key); 3034 JUnitTestCase.assertNotNull(entry.key);
3003 JUnitTestCase.assertNotNull(entry.separator); 3035 JUnitTestCase.assertNotNull(entry.separator);
3004 JUnitTestCase.assertNotNull(entry.value); 3036 JUnitTestCase.assertNotNull(entry.value);
3005 } 3037 }
3006 3038
3007 void test_parseMapLiteralEntry_int() { 3039 void test_parseMapLiteralEntry_int() {
3008 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "0 : y ", []); 3040 MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "0 : y ", []);
3009 JUnitTestCase.assertNotNull(entry.key); 3041 JUnitTestCase.assertNotNull(entry.key);
3010 JUnitTestCase.assertNotNull(entry.separator); 3042 JUnitTestCase.assertNotNull(entry.separator);
3011 JUnitTestCase.assertNotNull(entry.value); 3043 JUnitTestCase.assertNotNull(entry.value);
3012 } 3044 }
3013 3045
3014 void test_parseMapLiteralEntry_string() { 3046 void test_parseMapLiteralEntry_string() {
3015 MapLiteralEntry entry = ParserTestCase.parse5("parseMapLiteralEntry", "'x' : y", []); 3047 MapLiteralEntry entry = ParserTestCase.parse4("parseMapLiteralEntry", "'x' : y", []);
3016 JUnitTestCase.assertNotNull(entry.key); 3048 JUnitTestCase.assertNotNull(entry.key);
3017 JUnitTestCase.assertNotNull(entry.separator); 3049 JUnitTestCase.assertNotNull(entry.separator);
3018 JUnitTestCase.assertNotNull(entry.value); 3050 JUnitTestCase.assertNotNull(entry.value);
3019 } 3051 }
3020 3052
3021 void test_parseModifiers_abstract() { 3053 void test_parseModifiers_abstract() {
3022 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "abstract A", []); 3054 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "abstract A", []);
3023 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); 3055 JUnitTestCase.assertNotNull(modifiers.abstractKeyword);
3024 } 3056 }
3025 3057
3026 void test_parseModifiers_const() { 3058 void test_parseModifiers_const() {
3027 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "const A", []) ; 3059 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "const A", []) ;
3028 JUnitTestCase.assertNotNull(modifiers.constKeyword); 3060 JUnitTestCase.assertNotNull(modifiers.constKeyword);
3029 } 3061 }
3030 3062
3031 void test_parseModifiers_external() { 3063 void test_parseModifiers_external() {
3032 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "external A", []); 3064 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "external A", []);
3033 JUnitTestCase.assertNotNull(modifiers.externalKeyword); 3065 JUnitTestCase.assertNotNull(modifiers.externalKeyword);
3034 } 3066 }
3035 3067
3036 void test_parseModifiers_factory() { 3068 void test_parseModifiers_factory() {
3037 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "factory A", [ ]); 3069 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "factory A", [ ]);
3038 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); 3070 JUnitTestCase.assertNotNull(modifiers.factoryKeyword);
3039 } 3071 }
3040 3072
3041 void test_parseModifiers_final() { 3073 void test_parseModifiers_final() {
3042 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "final A", []) ; 3074 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "final A", []) ;
3043 JUnitTestCase.assertNotNull(modifiers.finalKeyword); 3075 JUnitTestCase.assertNotNull(modifiers.finalKeyword);
3044 } 3076 }
3045 3077
3046 void test_parseModifiers_static() { 3078 void test_parseModifiers_static() {
3047 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "static A", [] ); 3079 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "static A", [] );
3048 JUnitTestCase.assertNotNull(modifiers.staticKeyword); 3080 JUnitTestCase.assertNotNull(modifiers.staticKeyword);
3049 } 3081 }
3050 3082
3051 void test_parseModifiers_var() { 3083 void test_parseModifiers_var() {
3052 Modifiers modifiers = ParserTestCase.parse5("parseModifiers", "var A", []); 3084 Modifiers modifiers = ParserTestCase.parse4("parseModifiers", "var A", []);
3053 JUnitTestCase.assertNotNull(modifiers.varKeyword); 3085 JUnitTestCase.assertNotNull(modifiers.varKeyword);
3054 } 3086 }
3055 3087
3056 void test_parseMultiplicativeExpression_normal() { 3088 void test_parseMultiplicativeExpression_normal() {
3057 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "x * y", []); 3089 BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpr ession", "x * y", []);
3058 JUnitTestCase.assertNotNull(expression.leftOperand); 3090 JUnitTestCase.assertNotNull(expression.leftOperand);
3059 JUnitTestCase.assertNotNull(expression.operator); 3091 JUnitTestCase.assertNotNull(expression.operator);
3060 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); 3092 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
3061 JUnitTestCase.assertNotNull(expression.rightOperand); 3093 JUnitTestCase.assertNotNull(expression.rightOperand);
3062 } 3094 }
3063 3095
3064 void test_parseMultiplicativeExpression_super() { 3096 void test_parseMultiplicativeExpression_super() {
3065 BinaryExpression expression = ParserTestCase.parse5("parseMultiplicativeExpr ession", "super * y", []); 3097 BinaryExpression expression = ParserTestCase.parse4("parseMultiplicativeExpr ession", "super * y", []);
3066 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); 3098 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand);
3067 JUnitTestCase.assertNotNull(expression.operator); 3099 JUnitTestCase.assertNotNull(expression.operator);
3068 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); 3100 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type);
3069 JUnitTestCase.assertNotNull(expression.rightOperand); 3101 JUnitTestCase.assertNotNull(expression.rightOperand);
3070 } 3102 }
3071 3103
3072 void test_parseNewExpression() { 3104 void test_parseNewExpression() {
3073 InstanceCreationExpression expression = ParserTestCase.parse5("parseNewExpre ssion", "new A()", []); 3105 InstanceCreationExpression expression = ParserTestCase.parse4("parseNewExpre ssion", "new A()", []);
3074 JUnitTestCase.assertNotNull(expression.keyword); 3106 JUnitTestCase.assertNotNull(expression.keyword);
3075 ConstructorName name = expression.constructorName; 3107 ConstructorName name = expression.constructorName;
3076 JUnitTestCase.assertNotNull(name); 3108 JUnitTestCase.assertNotNull(name);
3077 JUnitTestCase.assertNotNull(name.type); 3109 JUnitTestCase.assertNotNull(name.type);
3078 JUnitTestCase.assertNull(name.period); 3110 JUnitTestCase.assertNull(name.period);
3079 JUnitTestCase.assertNull(name.name); 3111 JUnitTestCase.assertNull(name.name);
3080 JUnitTestCase.assertNotNull(expression.argumentList); 3112 JUnitTestCase.assertNotNull(expression.argumentList);
3081 } 3113 }
3082 3114
3083 void test_parseNonLabeledStatement_const_list_empty() { 3115 void test_parseNonLabeledStatement_const_list_empty() {
3084 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [];", []); 3116 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const [];", []);
3085 JUnitTestCase.assertNotNull(statement.expression); 3117 JUnitTestCase.assertNotNull(statement.expression);
3086 } 3118 }
3087 3119
3088 void test_parseNonLabeledStatement_const_list_nonEmpty() { 3120 void test_parseNonLabeledStatement_const_list_nonEmpty() {
3089 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const [1, 2];", []); 3121 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const [1, 2];", []);
3090 JUnitTestCase.assertNotNull(statement.expression); 3122 JUnitTestCase.assertNotNull(statement.expression);
3091 } 3123 }
3092 3124
3093 void test_parseNonLabeledStatement_const_map_empty() { 3125 void test_parseNonLabeledStatement_const_map_empty() {
3094 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {};", []); 3126 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const {};", []);
3095 JUnitTestCase.assertNotNull(statement.expression); 3127 JUnitTestCase.assertNotNull(statement.expression);
3096 } 3128 }
3097 3129
3098 void test_parseNonLabeledStatement_const_map_nonEmpty() { 3130 void test_parseNonLabeledStatement_const_map_nonEmpty() {
3099 // TODO(brianwilkerson) Implement more tests for this method. 3131 // TODO(brianwilkerson) Implement more tests for this method.
3100 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const {'a' : 1};", []); 3132 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const {'a' : 1};", []);
3101 JUnitTestCase.assertNotNull(statement.expression); 3133 JUnitTestCase.assertNotNull(statement.expression);
3102 } 3134 }
3103 3135
3104 void test_parseNonLabeledStatement_const_object() { 3136 void test_parseNonLabeledStatement_const_object() {
3105 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A();", []); 3137 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const A();", []);
3106 JUnitTestCase.assertNotNull(statement.expression); 3138 JUnitTestCase.assertNotNull(statement.expression);
3107 } 3139 }
3108 3140
3109 void test_parseNonLabeledStatement_const_object_named_typeParameters() { 3141 void test_parseNonLabeledStatement_const_object_named_typeParameters() {
3110 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "const A<B>.c();", []); 3142 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "const A<B>.c();", []);
3111 JUnitTestCase.assertNotNull(statement.expression); 3143 JUnitTestCase.assertNotNull(statement.expression);
3112 } 3144 }
3113 3145
3114 void test_parseNonLabeledStatement_constructorInvocation() { 3146 void test_parseNonLabeledStatement_constructorInvocation() {
3115 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "new C().m();", []); 3147 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "new C().m();", []);
3116 JUnitTestCase.assertNotNull(statement.expression); 3148 JUnitTestCase.assertNotNull(statement.expression);
3117 } 3149 }
3118 3150
3119 void test_parseNonLabeledStatement_false() { 3151 void test_parseNonLabeledStatement_false() {
3120 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "false;", []); 3152 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "false;", []);
3121 JUnitTestCase.assertNotNull(statement.expression); 3153 JUnitTestCase.assertNotNull(statement.expression);
3122 } 3154 }
3123 3155
3124 void test_parseNonLabeledStatement_functionDeclaration() { 3156 void test_parseNonLabeledStatement_functionDeclaration() {
3125 ParserTestCase.parse5("parseNonLabeledStatement", "f() {};", []); 3157 ParserTestCase.parse4("parseNonLabeledStatement", "f() {};", []);
3126 } 3158 }
3127 3159
3128 void test_parseNonLabeledStatement_functionDeclaration_arguments() { 3160 void test_parseNonLabeledStatement_functionDeclaration_arguments() {
3129 ParserTestCase.parse5("parseNonLabeledStatement", "f(void g()) {};", []); 3161 ParserTestCase.parse4("parseNonLabeledStatement", "f(void g()) {};", []);
3130 } 3162 }
3131 3163
3132 void test_parseNonLabeledStatement_functionExpressionIndex() { 3164 void test_parseNonLabeledStatement_functionExpressionIndex() {
3133 ParserTestCase.parse5("parseNonLabeledStatement", "() {}[0] = null;", []); 3165 ParserTestCase.parse4("parseNonLabeledStatement", "() {}[0] = null;", []);
3134 } 3166 }
3135 3167
3136 void test_parseNonLabeledStatement_functionInvocation() { 3168 void test_parseNonLabeledStatement_functionInvocation() {
3137 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "f();", []); 3169 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "f();", []);
3138 JUnitTestCase.assertNotNull(statement.expression); 3170 JUnitTestCase.assertNotNull(statement.expression);
3139 } 3171 }
3140 3172
3141 void test_parseNonLabeledStatement_invokeFunctionExpression() { 3173 void test_parseNonLabeledStatement_invokeFunctionExpression() {
3142 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "(a) {return a + a;} (3);", []); 3174 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "(a) {return a + a;} (3);", []);
3143 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr ession); 3175 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr ession);
3144 FunctionExpressionInvocation invocation = statement.expression as FunctionEx pressionInvocation; 3176 FunctionExpressionInvocation invocation = statement.expression as FunctionEx pressionInvocation;
3145 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); 3177 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function);
3146 FunctionExpression expression = invocation.function as FunctionExpression; 3178 FunctionExpression expression = invocation.function as FunctionExpression;
3147 JUnitTestCase.assertNotNull(expression.parameters); 3179 JUnitTestCase.assertNotNull(expression.parameters);
3148 JUnitTestCase.assertNotNull(expression.body); 3180 JUnitTestCase.assertNotNull(expression.body);
3149 ArgumentList list = invocation.argumentList; 3181 ArgumentList list = invocation.argumentList;
3150 JUnitTestCase.assertNotNull(list); 3182 JUnitTestCase.assertNotNull(list);
3151 EngineTestCase.assertSize(1, list.arguments); 3183 EngineTestCase.assertSize(1, list.arguments);
3152 } 3184 }
3153 3185
3154 void test_parseNonLabeledStatement_null() { 3186 void test_parseNonLabeledStatement_null() {
3155 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "null;", []); 3187 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "null;", []);
3156 JUnitTestCase.assertNotNull(statement.expression); 3188 JUnitTestCase.assertNotNull(statement.expression);
3157 } 3189 }
3158 3190
3159 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { 3191 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() {
3160 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "library.getName();", []); 3192 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "library.getName();", []);
3161 JUnitTestCase.assertNotNull(statement.expression); 3193 JUnitTestCase.assertNotNull(statement.expression);
3162 } 3194 }
3163 3195
3164 void test_parseNonLabeledStatement_true() { 3196 void test_parseNonLabeledStatement_true() {
3165 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "true;", []); 3197 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "true;", []);
3166 JUnitTestCase.assertNotNull(statement.expression); 3198 JUnitTestCase.assertNotNull(statement.expression);
3167 } 3199 }
3168 3200
3169 void test_parseNonLabeledStatement_typeCast() { 3201 void test_parseNonLabeledStatement_typeCast() {
3170 ExpressionStatement statement = ParserTestCase.parse5("parseNonLabeledStatem ent", "double.NAN as num;", []); 3202 ExpressionStatement statement = ParserTestCase.parse4("parseNonLabeledStatem ent", "double.NAN as num;", []);
3171 JUnitTestCase.assertNotNull(statement.expression); 3203 JUnitTestCase.assertNotNull(statement.expression);
3172 } 3204 }
3173 3205
3174 void test_parseNormalFormalParameter_field_const_noType() { 3206 void test_parseNormalFormalParameter_field_const_noType() {
3175 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const this.a)", []); 3207 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "const this.a)", []);
3176 JUnitTestCase.assertNotNull(parameter.keyword); 3208 JUnitTestCase.assertNotNull(parameter.keyword);
3177 JUnitTestCase.assertNull(parameter.type); 3209 JUnitTestCase.assertNull(parameter.type);
3178 JUnitTestCase.assertNotNull(parameter.identifier); 3210 JUnitTestCase.assertNotNull(parameter.identifier);
3179 JUnitTestCase.assertNull(parameter.parameters); 3211 JUnitTestCase.assertNull(parameter.parameters);
3180 } 3212 }
3181 3213
3182 void test_parseNormalFormalParameter_field_const_type() { 3214 void test_parseNormalFormalParameter_field_const_type() {
3183 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "const A this.a)", []); 3215 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "const A this.a)", []);
3184 JUnitTestCase.assertNotNull(parameter.keyword); 3216 JUnitTestCase.assertNotNull(parameter.keyword);
3185 JUnitTestCase.assertNotNull(parameter.type); 3217 JUnitTestCase.assertNotNull(parameter.type);
3186 JUnitTestCase.assertNotNull(parameter.identifier); 3218 JUnitTestCase.assertNotNull(parameter.identifier);
3187 JUnitTestCase.assertNull(parameter.parameters); 3219 JUnitTestCase.assertNull(parameter.parameters);
3188 } 3220 }
3189 3221
3190 void test_parseNormalFormalParameter_field_final_noType() { 3222 void test_parseNormalFormalParameter_field_final_noType() {
3191 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final this.a)", []); 3223 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "final this.a)", []);
3192 JUnitTestCase.assertNotNull(parameter.keyword); 3224 JUnitTestCase.assertNotNull(parameter.keyword);
3193 JUnitTestCase.assertNull(parameter.type); 3225 JUnitTestCase.assertNull(parameter.type);
3194 JUnitTestCase.assertNotNull(parameter.identifier); 3226 JUnitTestCase.assertNotNull(parameter.identifier);
3195 JUnitTestCase.assertNull(parameter.parameters); 3227 JUnitTestCase.assertNull(parameter.parameters);
3196 } 3228 }
3197 3229
3198 void test_parseNormalFormalParameter_field_final_type() { 3230 void test_parseNormalFormalParameter_field_final_type() {
3199 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "final A this.a)", []); 3231 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "final A this.a)", []);
3200 JUnitTestCase.assertNotNull(parameter.keyword); 3232 JUnitTestCase.assertNotNull(parameter.keyword);
3201 JUnitTestCase.assertNotNull(parameter.type); 3233 JUnitTestCase.assertNotNull(parameter.type);
3202 JUnitTestCase.assertNotNull(parameter.identifier); 3234 JUnitTestCase.assertNotNull(parameter.identifier);
3203 JUnitTestCase.assertNull(parameter.parameters); 3235 JUnitTestCase.assertNull(parameter.parameters);
3204 } 3236 }
3205 3237
3206 void test_parseNormalFormalParameter_field_function_nested() { 3238 void test_parseNormalFormalParameter_field_function_nested() {
3207 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a(B b))", []); 3239 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "this.a(B b))", []);
3208 JUnitTestCase.assertNull(parameter.keyword); 3240 JUnitTestCase.assertNull(parameter.keyword);
3209 JUnitTestCase.assertNull(parameter.type); 3241 JUnitTestCase.assertNull(parameter.type);
3210 JUnitTestCase.assertNotNull(parameter.identifier); 3242 JUnitTestCase.assertNotNull(parameter.identifier);
3211 FormalParameterList parameterList = parameter.parameters; 3243 FormalParameterList parameterList = parameter.parameters;
3212 JUnitTestCase.assertNotNull(parameterList); 3244 JUnitTestCase.assertNotNull(parameterList);
3213 EngineTestCase.assertSize(1, parameterList.parameters); 3245 EngineTestCase.assertSize(1, parameterList.parameters);
3214 } 3246 }
3215 3247
3216 void test_parseNormalFormalParameter_field_function_noNested() { 3248 void test_parseNormalFormalParameter_field_function_noNested() {
3217 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a())", []); 3249 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "this.a())", []);
3218 JUnitTestCase.assertNull(parameter.keyword); 3250 JUnitTestCase.assertNull(parameter.keyword);
3219 JUnitTestCase.assertNull(parameter.type); 3251 JUnitTestCase.assertNull(parameter.type);
3220 JUnitTestCase.assertNotNull(parameter.identifier); 3252 JUnitTestCase.assertNotNull(parameter.identifier);
3221 FormalParameterList parameterList = parameter.parameters; 3253 FormalParameterList parameterList = parameter.parameters;
3222 JUnitTestCase.assertNotNull(parameterList); 3254 JUnitTestCase.assertNotNull(parameterList);
3223 EngineTestCase.assertSize(0, parameterList.parameters); 3255 EngineTestCase.assertSize(0, parameterList.parameters);
3224 } 3256 }
3225 3257
3226 void test_parseNormalFormalParameter_field_noType() { 3258 void test_parseNormalFormalParameter_field_noType() {
3227 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "this.a)", []); 3259 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "this.a)", []);
3228 JUnitTestCase.assertNull(parameter.keyword); 3260 JUnitTestCase.assertNull(parameter.keyword);
3229 JUnitTestCase.assertNull(parameter.type); 3261 JUnitTestCase.assertNull(parameter.type);
3230 JUnitTestCase.assertNotNull(parameter.identifier); 3262 JUnitTestCase.assertNotNull(parameter.identifier);
3231 JUnitTestCase.assertNull(parameter.parameters); 3263 JUnitTestCase.assertNull(parameter.parameters);
3232 } 3264 }
3233 3265
3234 void test_parseNormalFormalParameter_field_type() { 3266 void test_parseNormalFormalParameter_field_type() {
3235 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "A this.a)", []); 3267 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "A this.a)", []);
3236 JUnitTestCase.assertNull(parameter.keyword); 3268 JUnitTestCase.assertNull(parameter.keyword);
3237 JUnitTestCase.assertNotNull(parameter.type); 3269 JUnitTestCase.assertNotNull(parameter.type);
3238 JUnitTestCase.assertNotNull(parameter.identifier); 3270 JUnitTestCase.assertNotNull(parameter.identifier);
3239 JUnitTestCase.assertNull(parameter.parameters); 3271 JUnitTestCase.assertNull(parameter.parameters);
3240 } 3272 }
3241 3273
3242 void test_parseNormalFormalParameter_field_var() { 3274 void test_parseNormalFormalParameter_field_var() {
3243 FieldFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPar ameter", "var this.a)", []); 3275 FieldFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPar ameter", "var this.a)", []);
3244 JUnitTestCase.assertNotNull(parameter.keyword); 3276 JUnitTestCase.assertNotNull(parameter.keyword);
3245 JUnitTestCase.assertNull(parameter.type); 3277 JUnitTestCase.assertNull(parameter.type);
3246 JUnitTestCase.assertNotNull(parameter.identifier); 3278 JUnitTestCase.assertNotNull(parameter.identifier);
3247 JUnitTestCase.assertNull(parameter.parameters); 3279 JUnitTestCase.assertNull(parameter.parameters);
3248 } 3280 }
3249 3281
3250 void test_parseNormalFormalParameter_function_noType() { 3282 void test_parseNormalFormalParameter_function_noType() {
3251 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "a())", []); 3283 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF ormalParameter", "a())", []);
3252 JUnitTestCase.assertNull(parameter.returnType); 3284 JUnitTestCase.assertNull(parameter.returnType);
3253 JUnitTestCase.assertNotNull(parameter.identifier); 3285 JUnitTestCase.assertNotNull(parameter.identifier);
3254 JUnitTestCase.assertNotNull(parameter.parameters); 3286 JUnitTestCase.assertNotNull(parameter.parameters);
3255 } 3287 }
3256 3288
3257 void test_parseNormalFormalParameter_function_type() { 3289 void test_parseNormalFormalParameter_function_type() {
3258 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "A a())", []); 3290 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF ormalParameter", "A a())", []);
3259 JUnitTestCase.assertNotNull(parameter.returnType); 3291 JUnitTestCase.assertNotNull(parameter.returnType);
3260 JUnitTestCase.assertNotNull(parameter.identifier); 3292 JUnitTestCase.assertNotNull(parameter.identifier);
3261 JUnitTestCase.assertNotNull(parameter.parameters); 3293 JUnitTestCase.assertNotNull(parameter.parameters);
3262 } 3294 }
3263 3295
3264 void test_parseNormalFormalParameter_function_void() { 3296 void test_parseNormalFormalParameter_function_void() {
3265 FunctionTypedFormalParameter parameter = ParserTestCase.parse5("parseNormalF ormalParameter", "void a())", []); 3297 FunctionTypedFormalParameter parameter = ParserTestCase.parse4("parseNormalF ormalParameter", "void a())", []);
3266 JUnitTestCase.assertNotNull(parameter.returnType); 3298 JUnitTestCase.assertNotNull(parameter.returnType);
3267 JUnitTestCase.assertNotNull(parameter.identifier); 3299 JUnitTestCase.assertNotNull(parameter.identifier);
3268 JUnitTestCase.assertNotNull(parameter.parameters); 3300 JUnitTestCase.assertNotNull(parameter.parameters);
3269 } 3301 }
3270 3302
3271 void test_parseNormalFormalParameter_simple_const_noType() { 3303 void test_parseNormalFormalParameter_simple_const_noType() {
3272 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const a)", []); 3304 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "const a)", []);
3273 JUnitTestCase.assertNotNull(parameter.keyword); 3305 JUnitTestCase.assertNotNull(parameter.keyword);
3274 JUnitTestCase.assertNull(parameter.type); 3306 JUnitTestCase.assertNull(parameter.type);
3275 JUnitTestCase.assertNotNull(parameter.identifier); 3307 JUnitTestCase.assertNotNull(parameter.identifier);
3276 } 3308 }
3277 3309
3278 void test_parseNormalFormalParameter_simple_const_type() { 3310 void test_parseNormalFormalParameter_simple_const_type() {
3279 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "const A a)", []); 3311 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "const A a)", []);
3280 JUnitTestCase.assertNotNull(parameter.keyword); 3312 JUnitTestCase.assertNotNull(parameter.keyword);
3281 JUnitTestCase.assertNotNull(parameter.type); 3313 JUnitTestCase.assertNotNull(parameter.type);
3282 JUnitTestCase.assertNotNull(parameter.identifier); 3314 JUnitTestCase.assertNotNull(parameter.identifier);
3283 } 3315 }
3284 3316
3285 void test_parseNormalFormalParameter_simple_final_noType() { 3317 void test_parseNormalFormalParameter_simple_final_noType() {
3286 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final a)", []); 3318 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "final a)", []);
3287 JUnitTestCase.assertNotNull(parameter.keyword); 3319 JUnitTestCase.assertNotNull(parameter.keyword);
3288 JUnitTestCase.assertNull(parameter.type); 3320 JUnitTestCase.assertNull(parameter.type);
3289 JUnitTestCase.assertNotNull(parameter.identifier); 3321 JUnitTestCase.assertNotNull(parameter.identifier);
3290 } 3322 }
3291 3323
3292 void test_parseNormalFormalParameter_simple_final_type() { 3324 void test_parseNormalFormalParameter_simple_final_type() {
3293 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "final A a)", []); 3325 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "final A a)", []);
3294 JUnitTestCase.assertNotNull(parameter.keyword); 3326 JUnitTestCase.assertNotNull(parameter.keyword);
3295 JUnitTestCase.assertNotNull(parameter.type); 3327 JUnitTestCase.assertNotNull(parameter.type);
3296 JUnitTestCase.assertNotNull(parameter.identifier); 3328 JUnitTestCase.assertNotNull(parameter.identifier);
3297 } 3329 }
3298 3330
3299 void test_parseNormalFormalParameter_simple_noType() { 3331 void test_parseNormalFormalParameter_simple_noType() {
3300 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "a)", []); 3332 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "a)", []);
3301 JUnitTestCase.assertNull(parameter.keyword); 3333 JUnitTestCase.assertNull(parameter.keyword);
3302 JUnitTestCase.assertNull(parameter.type); 3334 JUnitTestCase.assertNull(parameter.type);
3303 JUnitTestCase.assertNotNull(parameter.identifier); 3335 JUnitTestCase.assertNotNull(parameter.identifier);
3304 } 3336 }
3305 3337
3306 void test_parseNormalFormalParameter_simple_type() { 3338 void test_parseNormalFormalParameter_simple_type() {
3307 SimpleFormalParameter parameter = ParserTestCase.parse5("parseNormalFormalPa rameter", "A a)", []); 3339 SimpleFormalParameter parameter = ParserTestCase.parse4("parseNormalFormalPa rameter", "A a)", []);
3308 JUnitTestCase.assertNull(parameter.keyword); 3340 JUnitTestCase.assertNull(parameter.keyword);
3309 JUnitTestCase.assertNotNull(parameter.type); 3341 JUnitTestCase.assertNotNull(parameter.type);
3310 JUnitTestCase.assertNotNull(parameter.identifier); 3342 JUnitTestCase.assertNotNull(parameter.identifier);
3311 } 3343 }
3312 3344
3313 void test_parseOperator() { 3345 void test_parseOperator() {
3314 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 3346 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
3315 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); 3347 TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
3316 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); 3348 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c ommentAndMetadata(comment, []), null, returnType], "operator +(A a);");
3317 JUnitTestCase.assertNotNull(method.body); 3349 JUnitTestCase.assertNotNull(method.body);
(...skipping 19 matching lines...) Expand all
3337 3369
3338 void test_parsePartDirective_partOf() { 3370 void test_parsePartDirective_partOf() {
3339 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje ct> [emptyCommentAndMetadata()], "part of l;"); 3371 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje ct> [emptyCommentAndMetadata()], "part of l;");
3340 JUnitTestCase.assertNotNull(directive.partToken); 3372 JUnitTestCase.assertNotNull(directive.partToken);
3341 JUnitTestCase.assertNotNull(directive.ofToken); 3373 JUnitTestCase.assertNotNull(directive.ofToken);
3342 JUnitTestCase.assertNotNull(directive.libraryName); 3374 JUnitTestCase.assertNotNull(directive.libraryName);
3343 JUnitTestCase.assertNotNull(directive.semicolon); 3375 JUnitTestCase.assertNotNull(directive.semicolon);
3344 } 3376 }
3345 3377
3346 void test_parsePostfixExpression_decrement() { 3378 void test_parsePostfixExpression_decrement() {
3347 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i--", []); 3379 PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression ", "i--", []);
3348 JUnitTestCase.assertNotNull(expression.operand); 3380 JUnitTestCase.assertNotNull(expression.operand);
3349 JUnitTestCase.assertNotNull(expression.operator); 3381 JUnitTestCase.assertNotNull(expression.operator);
3350 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); 3382 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
3351 } 3383 }
3352 3384
3353 void test_parsePostfixExpression_increment() { 3385 void test_parsePostfixExpression_increment() {
3354 PostfixExpression expression = ParserTestCase.parse5("parsePostfixExpression ", "i++", []); 3386 PostfixExpression expression = ParserTestCase.parse4("parsePostfixExpression ", "i++", []);
3355 JUnitTestCase.assertNotNull(expression.operand); 3387 JUnitTestCase.assertNotNull(expression.operand);
3356 JUnitTestCase.assertNotNull(expression.operator); 3388 JUnitTestCase.assertNotNull(expression.operator);
3357 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 3389 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
3358 } 3390 }
3359 3391
3360 void test_parsePostfixExpression_none_indexExpression() { 3392 void test_parsePostfixExpression_none_indexExpression() {
3361 IndexExpression expression = ParserTestCase.parse5("parsePostfixExpression", "a[0]", []); 3393 IndexExpression expression = ParserTestCase.parse4("parsePostfixExpression", "a[0]", []);
3362 JUnitTestCase.assertNotNull(expression.target); 3394 JUnitTestCase.assertNotNull(expression.target);
3363 JUnitTestCase.assertNotNull(expression.index); 3395 JUnitTestCase.assertNotNull(expression.index);
3364 } 3396 }
3365 3397
3366 void test_parsePostfixExpression_none_methodInvocation() { 3398 void test_parsePostfixExpression_none_methodInvocation() {
3367 MethodInvocation expression = ParserTestCase.parse5("parsePostfixExpression" , "a.m()", []); 3399 MethodInvocation expression = ParserTestCase.parse4("parsePostfixExpression" , "a.m()", []);
3368 JUnitTestCase.assertNotNull(expression.target); 3400 JUnitTestCase.assertNotNull(expression.target);
3369 JUnitTestCase.assertNotNull(expression.methodName); 3401 JUnitTestCase.assertNotNull(expression.methodName);
3370 JUnitTestCase.assertNotNull(expression.argumentList); 3402 JUnitTestCase.assertNotNull(expression.argumentList);
3371 } 3403 }
3372 3404
3373 void test_parsePostfixExpression_none_propertyAccess() { 3405 void test_parsePostfixExpression_none_propertyAccess() {
3374 PrefixedIdentifier expression = ParserTestCase.parse5("parsePostfixExpressio n", "a.b", []); 3406 PrefixedIdentifier expression = ParserTestCase.parse4("parsePostfixExpressio n", "a.b", []);
3375 JUnitTestCase.assertNotNull(expression.prefix); 3407 JUnitTestCase.assertNotNull(expression.prefix);
3376 JUnitTestCase.assertNotNull(expression.identifier); 3408 JUnitTestCase.assertNotNull(expression.identifier);
3377 } 3409 }
3378 3410
3379 void test_parsePrefixedIdentifier_noPrefix() { 3411 void test_parsePrefixedIdentifier_noPrefix() {
3380 String lexeme = "bar"; 3412 String lexeme = "bar";
3381 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifier ", lexeme, []); 3413 SimpleIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifier ", lexeme, []);
3382 JUnitTestCase.assertNotNull(identifier.token); 3414 JUnitTestCase.assertNotNull(identifier.token);
3383 JUnitTestCase.assertEquals(lexeme, identifier.name); 3415 JUnitTestCase.assertEquals(lexeme, identifier.name);
3384 } 3416 }
3385 3417
3386 void test_parsePrefixedIdentifier_prefix() { 3418 void test_parsePrefixedIdentifier_prefix() {
3387 String lexeme = "foo.bar"; 3419 String lexeme = "foo.bar";
3388 PrefixedIdentifier identifier = ParserTestCase.parse5("parsePrefixedIdentifi er", lexeme, []); 3420 PrefixedIdentifier identifier = ParserTestCase.parse4("parsePrefixedIdentifi er", lexeme, []);
3389 JUnitTestCase.assertEquals("foo", identifier.prefix.name); 3421 JUnitTestCase.assertEquals("foo", identifier.prefix.name);
3390 JUnitTestCase.assertNotNull(identifier.period); 3422 JUnitTestCase.assertNotNull(identifier.period);
3391 JUnitTestCase.assertEquals("bar", identifier.identifier.name); 3423 JUnitTestCase.assertEquals("bar", identifier.identifier.name);
3392 } 3424 }
3393 3425
3394 void test_parsePrimaryExpression_const() { 3426 void test_parsePrimaryExpression_const() {
3395 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "const A()", []); 3427 InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryE xpression", "const A()", []);
3396 JUnitTestCase.assertNotNull(expression); 3428 JUnitTestCase.assertNotNull(expression);
3397 } 3429 }
3398 3430
3399 void test_parsePrimaryExpression_double() { 3431 void test_parsePrimaryExpression_double() {
3400 String doubleLiteral = "3.2e4"; 3432 String doubleLiteral = "3.2e4";
3401 DoubleLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", doub leLiteral, []); 3433 DoubleLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", doub leLiteral, []);
3402 JUnitTestCase.assertNotNull(literal.literal); 3434 JUnitTestCase.assertNotNull(literal.literal);
3403 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); 3435 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value);
3404 } 3436 }
3405 3437
3406 void test_parsePrimaryExpression_false() { 3438 void test_parsePrimaryExpression_false() {
3407 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "fa lse", []); 3439 BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "fa lse", []);
3408 JUnitTestCase.assertNotNull(literal.literal); 3440 JUnitTestCase.assertNotNull(literal.literal);
3409 JUnitTestCase.assertFalse(literal.value); 3441 JUnitTestCase.assertFalse(literal.value);
3410 } 3442 }
3411 3443
3412 void test_parsePrimaryExpression_function_arguments() { 3444 void test_parsePrimaryExpression_function_arguments() {
3413 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "(int i) => i + 1", []); 3445 FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpressio n", "(int i) => i + 1", []);
3414 JUnitTestCase.assertNotNull(expression.parameters); 3446 JUnitTestCase.assertNotNull(expression.parameters);
3415 JUnitTestCase.assertNotNull(expression.body); 3447 JUnitTestCase.assertNotNull(expression.body);
3416 } 3448 }
3417 3449
3418 void test_parsePrimaryExpression_function_noArguments() { 3450 void test_parsePrimaryExpression_function_noArguments() {
3419 FunctionExpression expression = ParserTestCase.parse5("parsePrimaryExpressio n", "() => 42", []); 3451 FunctionExpression expression = ParserTestCase.parse4("parsePrimaryExpressio n", "() => 42", []);
3420 JUnitTestCase.assertNotNull(expression.parameters); 3452 JUnitTestCase.assertNotNull(expression.parameters);
3421 JUnitTestCase.assertNotNull(expression.body); 3453 JUnitTestCase.assertNotNull(expression.body);
3422 } 3454 }
3423 3455
3424 void test_parsePrimaryExpression_hex() { 3456 void test_parsePrimaryExpression_hex() {
3425 String hexLiteral = "3F"; 3457 String hexLiteral = "3F";
3426 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "0x ${hexLiteral}", []); 3458 IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "0x ${hexLiteral}", []);
3427 JUnitTestCase.assertNotNull(literal.literal); 3459 JUnitTestCase.assertNotNull(literal.literal);
3428 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); 3460 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value);
3429 } 3461 }
3430 3462
3431 void test_parsePrimaryExpression_identifier() { 3463 void test_parsePrimaryExpression_identifier() {
3432 SimpleIdentifier identifier = ParserTestCase.parse5("parsePrimaryExpression" , "a", []); 3464 SimpleIdentifier identifier = ParserTestCase.parse4("parsePrimaryExpression" , "a", []);
3433 JUnitTestCase.assertNotNull(identifier); 3465 JUnitTestCase.assertNotNull(identifier);
3434 } 3466 }
3435 3467
3436 void test_parsePrimaryExpression_int() { 3468 void test_parsePrimaryExpression_int() {
3437 String intLiteral = "472"; 3469 String intLiteral = "472";
3438 IntegerLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", int Literal, []); 3470 IntegerLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", int Literal, []);
3439 JUnitTestCase.assertNotNull(literal.literal); 3471 JUnitTestCase.assertNotNull(literal.literal);
3440 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); 3472 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value);
3441 } 3473 }
3442 3474
3443 void test_parsePrimaryExpression_listLiteral() { 3475 void test_parsePrimaryExpression_listLiteral() {
3444 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[ ]", []); 3476 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[ ]", []);
3445 JUnitTestCase.assertNotNull(literal); 3477 JUnitTestCase.assertNotNull(literal);
3446 } 3478 }
3447 3479
3448 void test_parsePrimaryExpression_listLiteral_index() { 3480 void test_parsePrimaryExpression_listLiteral_index() {
3449 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "[]", []); 3481 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "[]", []);
3450 JUnitTestCase.assertNotNull(literal); 3482 JUnitTestCase.assertNotNull(literal);
3451 } 3483 }
3452 3484
3453 void test_parsePrimaryExpression_listLiteral_typed() { 3485 void test_parsePrimaryExpression_listLiteral_typed() {
3454 ListLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A>[ ]", []); 3486 ListLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A>[ ]", []);
3455 JUnitTestCase.assertNotNull(literal.typeArguments); 3487 JUnitTestCase.assertNotNull(literal.typeArguments);
3456 EngineTestCase.assertSize(1, literal.typeArguments.arguments); 3488 EngineTestCase.assertSize(1, literal.typeArguments.arguments);
3457 } 3489 }
3458 3490
3459 void test_parsePrimaryExpression_mapLiteral() { 3491 void test_parsePrimaryExpression_mapLiteral() {
3460 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "{}", [ ]); 3492 MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "{}", [ ]);
3461 JUnitTestCase.assertNotNull(literal); 3493 JUnitTestCase.assertNotNull(literal);
3462 } 3494 }
3463 3495
3464 void test_parsePrimaryExpression_mapLiteral_typed() { 3496 void test_parsePrimaryExpression_mapLiteral_typed() {
3465 MapLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "<A, B> {}", []); 3497 MapLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "<A, B> {}", []);
3466 JUnitTestCase.assertNotNull(literal.typeArguments); 3498 JUnitTestCase.assertNotNull(literal.typeArguments);
3467 EngineTestCase.assertSize(2, literal.typeArguments.arguments); 3499 EngineTestCase.assertSize(2, literal.typeArguments.arguments);
3468 } 3500 }
3469 3501
3470 void test_parsePrimaryExpression_new() { 3502 void test_parsePrimaryExpression_new() {
3471 InstanceCreationExpression expression = ParserTestCase.parse5("parsePrimaryE xpression", "new A()", []); 3503 InstanceCreationExpression expression = ParserTestCase.parse4("parsePrimaryE xpression", "new A()", []);
3472 JUnitTestCase.assertNotNull(expression); 3504 JUnitTestCase.assertNotNull(expression);
3473 } 3505 }
3474 3506
3475 void test_parsePrimaryExpression_null() { 3507 void test_parsePrimaryExpression_null() {
3476 NullLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "null" , []); 3508 NullLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "null" , []);
3477 JUnitTestCase.assertNotNull(literal.literal); 3509 JUnitTestCase.assertNotNull(literal.literal);
3478 } 3510 }
3479 3511
3480 void test_parsePrimaryExpression_parenthesized() { 3512 void test_parsePrimaryExpression_parenthesized() {
3481 ParenthesizedExpression expression = ParserTestCase.parse5("parsePrimaryExpr ession", "(x)", []); 3513 ParenthesizedExpression expression = ParserTestCase.parse4("parsePrimaryExpr ession", "(x)", []);
3482 JUnitTestCase.assertNotNull(expression); 3514 JUnitTestCase.assertNotNull(expression);
3483 } 3515 }
3484 3516
3485 void test_parsePrimaryExpression_string() { 3517 void test_parsePrimaryExpression_string() {
3486 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression" , "\"string\"", []); 3518 SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression" , "\"string\"", []);
3487 JUnitTestCase.assertFalse(literal.isMultiline); 3519 JUnitTestCase.assertFalse(literal.isMultiline);
3488 JUnitTestCase.assertFalse(literal.isRaw); 3520 JUnitTestCase.assertFalse(literal.isRaw);
3489 JUnitTestCase.assertEquals("string", literal.value); 3521 JUnitTestCase.assertEquals("string", literal.value);
3490 } 3522 }
3491 3523
3492 void test_parsePrimaryExpression_string_multiline() { 3524 void test_parsePrimaryExpression_string_multiline() {
3493 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression" , "'''string'''", []); 3525 SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression" , "'''string'''", []);
3494 JUnitTestCase.assertTrue(literal.isMultiline); 3526 JUnitTestCase.assertTrue(literal.isMultiline);
3495 JUnitTestCase.assertFalse(literal.isRaw); 3527 JUnitTestCase.assertFalse(literal.isRaw);
3496 JUnitTestCase.assertEquals("string", literal.value); 3528 JUnitTestCase.assertEquals("string", literal.value);
3497 } 3529 }
3498 3530
3499 void test_parsePrimaryExpression_string_raw() { 3531 void test_parsePrimaryExpression_string_raw() {
3500 SimpleStringLiteral literal = ParserTestCase.parse5("parsePrimaryExpression" , "r'string'", []); 3532 SimpleStringLiteral literal = ParserTestCase.parse4("parsePrimaryExpression" , "r'string'", []);
3501 JUnitTestCase.assertFalse(literal.isMultiline); 3533 JUnitTestCase.assertFalse(literal.isMultiline);
3502 JUnitTestCase.assertTrue(literal.isRaw); 3534 JUnitTestCase.assertTrue(literal.isRaw);
3503 JUnitTestCase.assertEquals("string", literal.value); 3535 JUnitTestCase.assertEquals("string", literal.value);
3504 } 3536 }
3505 3537
3506 void test_parsePrimaryExpression_super() { 3538 void test_parsePrimaryExpression_super() {
3507 PropertyAccess propertyAccess = ParserTestCase.parse5("parsePrimaryExpressio n", "super.x", []); 3539 PropertyAccess propertyAccess = ParserTestCase.parse4("parsePrimaryExpressio n", "super.x", []);
3508 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); 3540 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression);
3509 JUnitTestCase.assertNotNull(propertyAccess.operator); 3541 JUnitTestCase.assertNotNull(propertyAccess.operator);
3510 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); 3542 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type);
3511 JUnitTestCase.assertNotNull(propertyAccess.propertyName); 3543 JUnitTestCase.assertNotNull(propertyAccess.propertyName);
3512 } 3544 }
3513 3545
3514 void test_parsePrimaryExpression_this() { 3546 void test_parsePrimaryExpression_this() {
3515 ThisExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "this", []); 3547 ThisExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "this", []);
3516 JUnitTestCase.assertNotNull(expression.keyword); 3548 JUnitTestCase.assertNotNull(expression.keyword);
3517 } 3549 }
3518 3550
3519 void test_parsePrimaryExpression_true() { 3551 void test_parsePrimaryExpression_true() {
3520 BooleanLiteral literal = ParserTestCase.parse5("parsePrimaryExpression", "tr ue", []); 3552 BooleanLiteral literal = ParserTestCase.parse4("parsePrimaryExpression", "tr ue", []);
3521 JUnitTestCase.assertNotNull(literal.literal); 3553 JUnitTestCase.assertNotNull(literal.literal);
3522 JUnitTestCase.assertTrue(literal.value); 3554 JUnitTestCase.assertTrue(literal.value);
3523 } 3555 }
3524 3556
3525 void test_Parser() { 3557 void test_Parser() {
3526 JUnitTestCase.assertNotNull(new Parser(null, null)); 3558 JUnitTestCase.assertNotNull(new Parser(null, null));
3527 } 3559 }
3528 3560
3529 void test_parseRedirectingConstructorInvocation_named() { 3561 void test_parseRedirectingConstructorInvocation_named() {
3530 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this.a()", []); 3562 RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRe directingConstructorInvocation", "this.a()", []);
3531 JUnitTestCase.assertNotNull(invocation.argumentList); 3563 JUnitTestCase.assertNotNull(invocation.argumentList);
3532 JUnitTestCase.assertNotNull(invocation.constructorName); 3564 JUnitTestCase.assertNotNull(invocation.constructorName);
3533 JUnitTestCase.assertNotNull(invocation.keyword); 3565 JUnitTestCase.assertNotNull(invocation.keyword);
3534 JUnitTestCase.assertNotNull(invocation.period); 3566 JUnitTestCase.assertNotNull(invocation.period);
3535 } 3567 }
3536 3568
3537 void test_parseRedirectingConstructorInvocation_unnamed() { 3569 void test_parseRedirectingConstructorInvocation_unnamed() {
3538 RedirectingConstructorInvocation invocation = ParserTestCase.parse5("parseRe directingConstructorInvocation", "this()", []); 3570 RedirectingConstructorInvocation invocation = ParserTestCase.parse4("parseRe directingConstructorInvocation", "this()", []);
3539 JUnitTestCase.assertNotNull(invocation.argumentList); 3571 JUnitTestCase.assertNotNull(invocation.argumentList);
3540 JUnitTestCase.assertNull(invocation.constructorName); 3572 JUnitTestCase.assertNull(invocation.constructorName);
3541 JUnitTestCase.assertNotNull(invocation.keyword); 3573 JUnitTestCase.assertNotNull(invocation.keyword);
3542 JUnitTestCase.assertNull(invocation.period); 3574 JUnitTestCase.assertNull(invocation.period);
3543 } 3575 }
3544 3576
3545 void test_parseRelationalExpression_as() { 3577 void test_parseRelationalExpression_as() {
3546 AsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x as Y", []); 3578 AsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x as Y", []);
3547 JUnitTestCase.assertNotNull(expression.expression); 3579 JUnitTestCase.assertNotNull(expression.expression);
3548 JUnitTestCase.assertNotNull(expression.asOperator); 3580 JUnitTestCase.assertNotNull(expression.asOperator);
3549 JUnitTestCase.assertNotNull(expression.type); 3581 JUnitTestCase.assertNotNull(expression.type);
3550 } 3582 }
3551 3583
3552 void test_parseRelationalExpression_is() { 3584 void test_parseRelationalExpression_is() {
3553 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is y", []); 3585 IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is y", []);
3554 JUnitTestCase.assertNotNull(expression.expression); 3586 JUnitTestCase.assertNotNull(expression.expression);
3555 JUnitTestCase.assertNotNull(expression.isOperator); 3587 JUnitTestCase.assertNotNull(expression.isOperator);
3556 JUnitTestCase.assertNull(expression.notOperator); 3588 JUnitTestCase.assertNull(expression.notOperator);
3557 JUnitTestCase.assertNotNull(expression.type); 3589 JUnitTestCase.assertNotNull(expression.type);
3558 } 3590 }
3559 3591
3560 void test_parseRelationalExpression_isNot() { 3592 void test_parseRelationalExpression_isNot() {
3561 IsExpression expression = ParserTestCase.parse5("parseRelationalExpression", "x is! y", []); 3593 IsExpression expression = ParserTestCase.parse4("parseRelationalExpression", "x is! y", []);
3562 JUnitTestCase.assertNotNull(expression.expression); 3594 JUnitTestCase.assertNotNull(expression.expression);
3563 JUnitTestCase.assertNotNull(expression.isOperator); 3595 JUnitTestCase.assertNotNull(expression.isOperator);
3564 JUnitTestCase.assertNotNull(expression.notOperator); 3596 JUnitTestCase.assertNotNull(expression.notOperator);
3565 JUnitTestCase.assertNotNull(expression.type); 3597 JUnitTestCase.assertNotNull(expression.type);
3566 } 3598 }
3567 3599
3568 void test_parseRelationalExpression_normal() { 3600 void test_parseRelationalExpression_normal() {
3569 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "x < y", []); 3601 BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpressi on", "x < y", []);
3570 JUnitTestCase.assertNotNull(expression.leftOperand); 3602 JUnitTestCase.assertNotNull(expression.leftOperand);
3571 JUnitTestCase.assertNotNull(expression.operator); 3603 JUnitTestCase.assertNotNull(expression.operator);
3572 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); 3604 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
3573 JUnitTestCase.assertNotNull(expression.rightOperand); 3605 JUnitTestCase.assertNotNull(expression.rightOperand);
3574 } 3606 }
3575 3607
3576 void test_parseRelationalExpression_super() { 3608 void test_parseRelationalExpression_super() {
3577 BinaryExpression expression = ParserTestCase.parse5("parseRelationalExpressi on", "super < y", []); 3609 BinaryExpression expression = ParserTestCase.parse4("parseRelationalExpressi on", "super < y", []);
3578 JUnitTestCase.assertNotNull(expression.leftOperand); 3610 JUnitTestCase.assertNotNull(expression.leftOperand);
3579 JUnitTestCase.assertNotNull(expression.operator); 3611 JUnitTestCase.assertNotNull(expression.operator);
3580 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); 3612 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type);
3581 JUnitTestCase.assertNotNull(expression.rightOperand); 3613 JUnitTestCase.assertNotNull(expression.rightOperand);
3582 } 3614 }
3583 3615
3584 void test_parseRethrowExpression() { 3616 void test_parseRethrowExpression() {
3585 RethrowExpression expression = ParserTestCase.parse5("parseRethrowExpression ", "rethrow;", []); 3617 RethrowExpression expression = ParserTestCase.parse4("parseRethrowExpression ", "rethrow;", []);
3586 JUnitTestCase.assertNotNull(expression.keyword); 3618 JUnitTestCase.assertNotNull(expression.keyword);
3587 } 3619 }
3588 3620
3589 void test_parseReturnStatement_noValue() { 3621 void test_parseReturnStatement_noValue() {
3590 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn;", []); 3622 ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "r eturn;", []);
3591 JUnitTestCase.assertNotNull(statement.keyword); 3623 JUnitTestCase.assertNotNull(statement.keyword);
3592 JUnitTestCase.assertNull(statement.expression); 3624 JUnitTestCase.assertNull(statement.expression);
3593 JUnitTestCase.assertNotNull(statement.semicolon); 3625 JUnitTestCase.assertNotNull(statement.semicolon);
3594 } 3626 }
3595 3627
3596 void test_parseReturnStatement_value() { 3628 void test_parseReturnStatement_value() {
3597 ReturnStatement statement = ParserTestCase.parse5("parseReturnStatement", "r eturn x;", []); 3629 ReturnStatement statement = ParserTestCase.parse4("parseReturnStatement", "r eturn x;", []);
3598 JUnitTestCase.assertNotNull(statement.keyword); 3630 JUnitTestCase.assertNotNull(statement.keyword);
3599 JUnitTestCase.assertNotNull(statement.expression); 3631 JUnitTestCase.assertNotNull(statement.expression);
3600 JUnitTestCase.assertNotNull(statement.semicolon); 3632 JUnitTestCase.assertNotNull(statement.semicolon);
3601 } 3633 }
3602 3634
3603 void test_parseReturnType_nonVoid() { 3635 void test_parseReturnType_nonVoid() {
3604 TypeName typeName = ParserTestCase.parse5("parseReturnType", "A<B>", []); 3636 TypeName typeName = ParserTestCase.parse4("parseReturnType", "A<B>", []);
3605 JUnitTestCase.assertNotNull(typeName.name); 3637 JUnitTestCase.assertNotNull(typeName.name);
3606 JUnitTestCase.assertNotNull(typeName.typeArguments); 3638 JUnitTestCase.assertNotNull(typeName.typeArguments);
3607 } 3639 }
3608 3640
3609 void test_parseReturnType_void() { 3641 void test_parseReturnType_void() {
3610 TypeName typeName = ParserTestCase.parse5("parseReturnType", "void", []); 3642 TypeName typeName = ParserTestCase.parse4("parseReturnType", "void", []);
3611 JUnitTestCase.assertNotNull(typeName.name); 3643 JUnitTestCase.assertNotNull(typeName.name);
3612 JUnitTestCase.assertNull(typeName.typeArguments); 3644 JUnitTestCase.assertNull(typeName.typeArguments);
3613 } 3645 }
3614 3646
3615 void test_parseSetter_nonStatic() { 3647 void test_parseSetter_nonStatic() {
3616 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); 3648 Comment comment = Comment.createDocumentationComment(new List<Token>(0));
3617 TypeName returnType = new TypeName(new SimpleIdentifier(null), null); 3649 TypeName returnType = new TypeName(new SimpleIdentifier(null), null);
3618 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); 3650 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com mentAndMetadata(comment, []), null, null, returnType], "set a(var x);");
3619 JUnitTestCase.assertNotNull(method.body); 3651 JUnitTestCase.assertNotNull(method.body);
3620 JUnitTestCase.assertEquals(comment, method.documentationComment); 3652 JUnitTestCase.assertEquals(comment, method.documentationComment);
(...skipping 20 matching lines...) Expand all
3641 JUnitTestCase.assertNull(method.externalKeyword); 3673 JUnitTestCase.assertNull(method.externalKeyword);
3642 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); 3674 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword);
3643 JUnitTestCase.assertNotNull(method.name); 3675 JUnitTestCase.assertNotNull(method.name);
3644 JUnitTestCase.assertNull(method.operatorKeyword); 3676 JUnitTestCase.assertNull(method.operatorKeyword);
3645 JUnitTestCase.assertNotNull(method.parameters); 3677 JUnitTestCase.assertNotNull(method.parameters);
3646 JUnitTestCase.assertNotNull(method.propertyKeyword); 3678 JUnitTestCase.assertNotNull(method.propertyKeyword);
3647 JUnitTestCase.assertEquals(returnType, method.returnType); 3679 JUnitTestCase.assertEquals(returnType, method.returnType);
3648 } 3680 }
3649 3681
3650 void test_parseShiftExpression_normal() { 3682 void test_parseShiftExpression_normal() {
3651 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "x << y", []); 3683 BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "x << y", []);
3652 JUnitTestCase.assertNotNull(expression.leftOperand); 3684 JUnitTestCase.assertNotNull(expression.leftOperand);
3653 JUnitTestCase.assertNotNull(expression.operator); 3685 JUnitTestCase.assertNotNull(expression.operator);
3654 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); 3686 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
3655 JUnitTestCase.assertNotNull(expression.rightOperand); 3687 JUnitTestCase.assertNotNull(expression.rightOperand);
3656 } 3688 }
3657 3689
3658 void test_parseShiftExpression_super() { 3690 void test_parseShiftExpression_super() {
3659 BinaryExpression expression = ParserTestCase.parse5("parseShiftExpression", "super << y", []); 3691 BinaryExpression expression = ParserTestCase.parse4("parseShiftExpression", "super << y", []);
3660 JUnitTestCase.assertNotNull(expression.leftOperand); 3692 JUnitTestCase.assertNotNull(expression.leftOperand);
3661 JUnitTestCase.assertNotNull(expression.operator); 3693 JUnitTestCase.assertNotNull(expression.operator);
3662 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); 3694 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type);
3663 JUnitTestCase.assertNotNull(expression.rightOperand); 3695 JUnitTestCase.assertNotNull(expression.rightOperand);
3664 } 3696 }
3665 3697
3666 void test_parseSimpleIdentifier_builtInIdentifier() { 3698 void test_parseSimpleIdentifier_builtInIdentifier() {
3667 String lexeme = "as"; 3699 String lexeme = "as";
3668 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []); 3700 SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme, []);
3669 JUnitTestCase.assertNotNull(identifier.token); 3701 JUnitTestCase.assertNotNull(identifier.token);
3670 JUnitTestCase.assertEquals(lexeme, identifier.name); 3702 JUnitTestCase.assertEquals(lexeme, identifier.name);
3671 } 3703 }
3672 3704
3673 void test_parseSimpleIdentifier_normalIdentifier() { 3705 void test_parseSimpleIdentifier_normalIdentifier() {
3674 String lexeme = "foo"; 3706 String lexeme = "foo";
3675 SimpleIdentifier identifier = ParserTestCase.parse5("parseSimpleIdentifier", lexeme, []); 3707 SimpleIdentifier identifier = ParserTestCase.parse4("parseSimpleIdentifier", lexeme, []);
3676 JUnitTestCase.assertNotNull(identifier.token); 3708 JUnitTestCase.assertNotNull(identifier.token);
3677 JUnitTestCase.assertEquals(lexeme, identifier.name); 3709 JUnitTestCase.assertEquals(lexeme, identifier.name);
3678 } 3710 }
3679 3711
3680 void test_parseSimpleIdentifier1_normalIdentifier() { 3712 void test_parseSimpleIdentifier1_normalIdentifier() {
3681 } 3713 }
3682 3714
3683 void test_parseStatement_functionDeclaration() { 3715 void test_parseStatement_functionDeclaration() {
3684 // TODO(brianwilkerson) Implement more tests for this method. 3716 // TODO(brianwilkerson) Implement more tests for this method.
3685 FunctionDeclarationStatement statement = ParserTestCase.parse5("parseStateme nt", "int f(a, b) {};", []); 3717 FunctionDeclarationStatement statement = ParserTestCase.parse4("parseStateme nt", "int f(a, b) {};", []);
3686 JUnitTestCase.assertNotNull(statement.functionDeclaration); 3718 JUnitTestCase.assertNotNull(statement.functionDeclaration);
3687 } 3719 }
3688 3720
3689 void test_parseStatement_mulipleLabels() { 3721 void test_parseStatement_mulipleLabels() {
3690 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: m: return x;", []); 3722 LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: m: return x;", []);
3691 EngineTestCase.assertSize(2, statement.labels); 3723 EngineTestCase.assertSize(2, statement.labels);
3692 JUnitTestCase.assertNotNull(statement.statement); 3724 JUnitTestCase.assertNotNull(statement.statement);
3693 } 3725 }
3694 3726
3695 void test_parseStatement_noLabels() { 3727 void test_parseStatement_noLabels() {
3696 ParserTestCase.parse5("parseStatement", "return x;", []); 3728 ParserTestCase.parse4("parseStatement", "return x;", []);
3697 } 3729 }
3698 3730
3699 void test_parseStatement_singleLabel() { 3731 void test_parseStatement_singleLabel() {
3700 LabeledStatement statement = ParserTestCase.parse5("parseStatement", "l: ret urn x;", []); 3732 LabeledStatement statement = ParserTestCase.parse4("parseStatement", "l: ret urn x;", []);
3701 EngineTestCase.assertSize(1, statement.labels); 3733 EngineTestCase.assertSize(1, statement.labels);
3702 JUnitTestCase.assertNotNull(statement.statement); 3734 JUnitTestCase.assertNotNull(statement.statement);
3703 } 3735 }
3704 3736
3705 void test_parseStatements_multiple() { 3737 void test_parseStatements_multiple() {
3706 List<Statement> statements = ParserTestCase.parseStatements("return; return; ", 2, []); 3738 List<Statement> statements = ParserTestCase.parseStatements("return; return; ", 2, []);
3707 EngineTestCase.assertSize(2, statements); 3739 EngineTestCase.assertSize(2, statements);
3708 } 3740 }
3709 3741
3710 void test_parseStatements_single() { 3742 void test_parseStatements_single() {
3711 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, [] ); 3743 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, [] );
3712 EngineTestCase.assertSize(1, statements); 3744 EngineTestCase.assertSize(1, statements);
3713 } 3745 }
3714 3746
3715 void test_parseStringLiteral_adjacent() { 3747 void test_parseStringLiteral_adjacent() {
3716 AdjacentStrings literal = ParserTestCase.parse5("parseStringLiteral", "'a' ' b'", []); 3748 AdjacentStrings literal = ParserTestCase.parse4("parseStringLiteral", "'a' ' b'", []);
3717 NodeList<StringLiteral> strings = literal.strings; 3749 NodeList<StringLiteral> strings = literal.strings;
3718 EngineTestCase.assertSize(2, strings); 3750 EngineTestCase.assertSize(2, strings);
3719 StringLiteral firstString = strings[0]; 3751 StringLiteral firstString = strings[0];
3720 StringLiteral secondString = strings[1]; 3752 StringLiteral secondString = strings[1];
3721 JUnitTestCase.assertEquals("a", (firstString as SimpleStringLiteral).value); 3753 JUnitTestCase.assertEquals("a", (firstString as SimpleStringLiteral).value);
3722 JUnitTestCase.assertEquals("b", (secondString as SimpleStringLiteral).value) ; 3754 JUnitTestCase.assertEquals("b", (secondString as SimpleStringLiteral).value) ;
3723 } 3755 }
3724 3756
3725 void test_parseStringLiteral_interpolated() { 3757 void test_parseStringLiteral_interpolated() {
3726 StringInterpolation literal = ParserTestCase.parse5("parseStringLiteral", "' a \${b} c \$this d'", []); 3758 StringInterpolation literal = ParserTestCase.parse4("parseStringLiteral", "' a \${b} c \$this d'", []);
3727 NodeList<InterpolationElement> elements = literal.elements; 3759 NodeList<InterpolationElement> elements = literal.elements;
3728 EngineTestCase.assertSize(5, elements); 3760 EngineTestCase.assertSize(5, elements);
3729 JUnitTestCase.assertTrue(elements[0] is InterpolationString); 3761 JUnitTestCase.assertTrue(elements[0] is InterpolationString);
3730 JUnitTestCase.assertTrue(elements[1] is InterpolationExpression); 3762 JUnitTestCase.assertTrue(elements[1] is InterpolationExpression);
3731 JUnitTestCase.assertTrue(elements[2] is InterpolationString); 3763 JUnitTestCase.assertTrue(elements[2] is InterpolationString);
3732 JUnitTestCase.assertTrue(elements[3] is InterpolationExpression); 3764 JUnitTestCase.assertTrue(elements[3] is InterpolationExpression);
3733 JUnitTestCase.assertTrue(elements[4] is InterpolationString); 3765 JUnitTestCase.assertTrue(elements[4] is InterpolationString);
3734 } 3766 }
3735 3767
3736 void test_parseStringLiteral_single() { 3768 void test_parseStringLiteral_single() {
3737 SimpleStringLiteral literal = ParserTestCase.parse5("parseStringLiteral", "' a'", []); 3769 SimpleStringLiteral literal = ParserTestCase.parse4("parseStringLiteral", "' a'", []);
3738 JUnitTestCase.assertNotNull(literal.literal); 3770 JUnitTestCase.assertNotNull(literal.literal);
3739 JUnitTestCase.assertEquals("a", literal.value); 3771 JUnitTestCase.assertEquals("a", literal.value);
3740 } 3772 }
3741 3773
3742 void test_parseSuperConstructorInvocation_named() { 3774 void test_parseSuperConstructorInvocation_named() {
3743 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super.a()", []); 3775 SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperCon structorInvocation", "super.a()", []);
3744 JUnitTestCase.assertNotNull(invocation.argumentList); 3776 JUnitTestCase.assertNotNull(invocation.argumentList);
3745 JUnitTestCase.assertNotNull(invocation.constructorName); 3777 JUnitTestCase.assertNotNull(invocation.constructorName);
3746 JUnitTestCase.assertNotNull(invocation.keyword); 3778 JUnitTestCase.assertNotNull(invocation.keyword);
3747 JUnitTestCase.assertNotNull(invocation.period); 3779 JUnitTestCase.assertNotNull(invocation.period);
3748 } 3780 }
3749 3781
3750 void test_parseSuperConstructorInvocation_unnamed() { 3782 void test_parseSuperConstructorInvocation_unnamed() {
3751 SuperConstructorInvocation invocation = ParserTestCase.parse5("parseSuperCon structorInvocation", "super()", []); 3783 SuperConstructorInvocation invocation = ParserTestCase.parse4("parseSuperCon structorInvocation", "super()", []);
3752 JUnitTestCase.assertNotNull(invocation.argumentList); 3784 JUnitTestCase.assertNotNull(invocation.argumentList);
3753 JUnitTestCase.assertNull(invocation.constructorName); 3785 JUnitTestCase.assertNull(invocation.constructorName);
3754 JUnitTestCase.assertNotNull(invocation.keyword); 3786 JUnitTestCase.assertNotNull(invocation.keyword);
3755 JUnitTestCase.assertNull(invocation.period); 3787 JUnitTestCase.assertNull(invocation.period);
3756 } 3788 }
3757 3789
3758 void test_parseSwitchStatement_case() { 3790 void test_parseSwitchStatement_case() {
3759 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 1: return 'I';}", []); 3791 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s witch (a) {case 1: return 'I';}", []);
3760 JUnitTestCase.assertNotNull(statement.keyword); 3792 JUnitTestCase.assertNotNull(statement.keyword);
3761 JUnitTestCase.assertNotNull(statement.leftParenthesis); 3793 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3762 JUnitTestCase.assertNotNull(statement.expression); 3794 JUnitTestCase.assertNotNull(statement.expression);
3763 JUnitTestCase.assertNotNull(statement.rightParenthesis); 3795 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3764 JUnitTestCase.assertNotNull(statement.leftBracket); 3796 JUnitTestCase.assertNotNull(statement.leftBracket);
3765 EngineTestCase.assertSize(1, statement.members); 3797 EngineTestCase.assertSize(1, statement.members);
3766 JUnitTestCase.assertNotNull(statement.rightBracket); 3798 JUnitTestCase.assertNotNull(statement.rightBracket);
3767 } 3799 }
3768 3800
3769 void test_parseSwitchStatement_empty() { 3801 void test_parseSwitchStatement_empty() {
3770 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {}", []); 3802 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s witch (a) {}", []);
3771 JUnitTestCase.assertNotNull(statement.keyword); 3803 JUnitTestCase.assertNotNull(statement.keyword);
3772 JUnitTestCase.assertNotNull(statement.leftParenthesis); 3804 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3773 JUnitTestCase.assertNotNull(statement.expression); 3805 JUnitTestCase.assertNotNull(statement.expression);
3774 JUnitTestCase.assertNotNull(statement.rightParenthesis); 3806 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3775 JUnitTestCase.assertNotNull(statement.leftBracket); 3807 JUnitTestCase.assertNotNull(statement.leftBracket);
3776 EngineTestCase.assertSize(0, statement.members); 3808 EngineTestCase.assertSize(0, statement.members);
3777 JUnitTestCase.assertNotNull(statement.rightBracket); 3809 JUnitTestCase.assertNotNull(statement.rightBracket);
3778 } 3810 }
3779 3811
3780 void test_parseSwitchStatement_labeledCase() { 3812 void test_parseSwitchStatement_labeledCase() {
3781 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {l1: l2: l3: case(1):}", []); 3813 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s witch (a) {l1: l2: l3: case(1):}", []);
3782 JUnitTestCase.assertNotNull(statement.keyword); 3814 JUnitTestCase.assertNotNull(statement.keyword);
3783 JUnitTestCase.assertNotNull(statement.leftParenthesis); 3815 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3784 JUnitTestCase.assertNotNull(statement.expression); 3816 JUnitTestCase.assertNotNull(statement.expression);
3785 JUnitTestCase.assertNotNull(statement.rightParenthesis); 3817 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3786 JUnitTestCase.assertNotNull(statement.leftBracket); 3818 JUnitTestCase.assertNotNull(statement.leftBracket);
3787 EngineTestCase.assertSize(1, statement.members); 3819 EngineTestCase.assertSize(1, statement.members);
3788 EngineTestCase.assertSize(3, statement.members[0].labels); 3820 EngineTestCase.assertSize(3, statement.members[0].labels);
3789 JUnitTestCase.assertNotNull(statement.rightBracket); 3821 JUnitTestCase.assertNotNull(statement.rightBracket);
3790 } 3822 }
3791 3823
3792 void test_parseSwitchStatement_labeledStatementInCase() { 3824 void test_parseSwitchStatement_labeledStatementInCase() {
3793 SwitchStatement statement = ParserTestCase.parse5("parseSwitchStatement", "s witch (a) {case 0: f(); l1: g(); break;}", []); 3825 SwitchStatement statement = ParserTestCase.parse4("parseSwitchStatement", "s witch (a) {case 0: f(); l1: g(); break;}", []);
3794 JUnitTestCase.assertNotNull(statement.keyword); 3826 JUnitTestCase.assertNotNull(statement.keyword);
3795 JUnitTestCase.assertNotNull(statement.leftParenthesis); 3827 JUnitTestCase.assertNotNull(statement.leftParenthesis);
3796 JUnitTestCase.assertNotNull(statement.expression); 3828 JUnitTestCase.assertNotNull(statement.expression);
3797 JUnitTestCase.assertNotNull(statement.rightParenthesis); 3829 JUnitTestCase.assertNotNull(statement.rightParenthesis);
3798 JUnitTestCase.assertNotNull(statement.leftBracket); 3830 JUnitTestCase.assertNotNull(statement.leftBracket);
3799 EngineTestCase.assertSize(1, statement.members); 3831 EngineTestCase.assertSize(1, statement.members);
3800 EngineTestCase.assertSize(3, statement.members[0].statements); 3832 EngineTestCase.assertSize(3, statement.members[0].statements);
3801 JUnitTestCase.assertNotNull(statement.rightBracket); 3833 JUnitTestCase.assertNotNull(statement.rightBracket);
3802 } 3834 }
3803 3835
3804 void test_parseSymbolLiteral_builtInIdentifier() { 3836 void test_parseSymbolLiteral_builtInIdentifier() {
3805 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#dynami c.static.abstract", []); 3837 SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#dynami c.static.abstract", []);
3806 JUnitTestCase.assertNotNull(literal.poundSign); 3838 JUnitTestCase.assertNotNull(literal.poundSign);
3807 List<Token> components = literal.components; 3839 List<Token> components = literal.components;
3808 EngineTestCase.assertLength(3, components); 3840 EngineTestCase.assertLength(3, components);
3809 JUnitTestCase.assertEquals("dynamic", components[0].lexeme); 3841 JUnitTestCase.assertEquals("dynamic", components[0].lexeme);
3810 JUnitTestCase.assertEquals("static", components[1].lexeme); 3842 JUnitTestCase.assertEquals("static", components[1].lexeme);
3811 JUnitTestCase.assertEquals("abstract", components[2].lexeme); 3843 JUnitTestCase.assertEquals("abstract", components[2].lexeme);
3812 } 3844 }
3813 3845
3814 void test_parseSymbolLiteral_multiple() { 3846 void test_parseSymbolLiteral_multiple() {
3815 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#a.b.c" , []); 3847 SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a.b.c" , []);
3816 JUnitTestCase.assertNotNull(literal.poundSign); 3848 JUnitTestCase.assertNotNull(literal.poundSign);
3817 List<Token> components = literal.components; 3849 List<Token> components = literal.components;
3818 EngineTestCase.assertLength(3, components); 3850 EngineTestCase.assertLength(3, components);
3819 JUnitTestCase.assertEquals("a", components[0].lexeme); 3851 JUnitTestCase.assertEquals("a", components[0].lexeme);
3820 JUnitTestCase.assertEquals("b", components[1].lexeme); 3852 JUnitTestCase.assertEquals("b", components[1].lexeme);
3821 JUnitTestCase.assertEquals("c", components[2].lexeme); 3853 JUnitTestCase.assertEquals("c", components[2].lexeme);
3822 } 3854 }
3823 3855
3824 void test_parseSymbolLiteral_operator() { 3856 void test_parseSymbolLiteral_operator() {
3825 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#==", [ ]); 3857 SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#==", [ ]);
3826 JUnitTestCase.assertNotNull(literal.poundSign); 3858 JUnitTestCase.assertNotNull(literal.poundSign);
3827 List<Token> components = literal.components; 3859 List<Token> components = literal.components;
3828 EngineTestCase.assertLength(1, components); 3860 EngineTestCase.assertLength(1, components);
3829 JUnitTestCase.assertEquals("==", components[0].lexeme); 3861 JUnitTestCase.assertEquals("==", components[0].lexeme);
3830 } 3862 }
3831 3863
3832 void test_parseSymbolLiteral_single() { 3864 void test_parseSymbolLiteral_single() {
3833 SymbolLiteral literal = ParserTestCase.parse5("parseSymbolLiteral", "#a", [] ); 3865 SymbolLiteral literal = ParserTestCase.parse4("parseSymbolLiteral", "#a", [] );
3834 JUnitTestCase.assertNotNull(literal.poundSign); 3866 JUnitTestCase.assertNotNull(literal.poundSign);
3835 List<Token> components = literal.components; 3867 List<Token> components = literal.components;
3836 EngineTestCase.assertLength(1, components); 3868 EngineTestCase.assertLength(1, components);
3837 JUnitTestCase.assertEquals("a", components[0].lexeme); 3869 JUnitTestCase.assertEquals("a", components[0].lexeme);
3838 } 3870 }
3839 3871
3840 void test_parseThrowExpression() { 3872 void test_parseThrowExpression() {
3841 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpression", " throw x;", []); 3873 ThrowExpression expression = ParserTestCase.parse4("parseThrowExpression", " throw x;", []);
3842 JUnitTestCase.assertNotNull(expression.keyword); 3874 JUnitTestCase.assertNotNull(expression.keyword);
3843 JUnitTestCase.assertNotNull(expression.expression); 3875 JUnitTestCase.assertNotNull(expression.expression);
3844 } 3876 }
3845 3877
3846 void test_parseThrowExpressionWithoutCascade() { 3878 void test_parseThrowExpressionWithoutCascade() {
3847 ThrowExpression expression = ParserTestCase.parse5("parseThrowExpressionWith outCascade", "throw x;", []); 3879 ThrowExpression expression = ParserTestCase.parse4("parseThrowExpressionWith outCascade", "throw x;", []);
3848 JUnitTestCase.assertNotNull(expression.keyword); 3880 JUnitTestCase.assertNotNull(expression.keyword);
3849 JUnitTestCase.assertNotNull(expression.expression); 3881 JUnitTestCase.assertNotNull(expression.expression);
3850 } 3882 }
3851 3883
3852 void test_parseTryStatement_catch() { 3884 void test_parseTryStatement_catch() {
3853 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e) {}", []); 3885 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e) {}", []);
3854 JUnitTestCase.assertNotNull(statement.tryKeyword); 3886 JUnitTestCase.assertNotNull(statement.tryKeyword);
3855 JUnitTestCase.assertNotNull(statement.body); 3887 JUnitTestCase.assertNotNull(statement.body);
3856 NodeList<CatchClause> catchClauses = statement.catchClauses; 3888 NodeList<CatchClause> catchClauses = statement.catchClauses;
3857 EngineTestCase.assertSize(1, catchClauses); 3889 EngineTestCase.assertSize(1, catchClauses);
3858 CatchClause clause = catchClauses[0]; 3890 CatchClause clause = catchClauses[0];
3859 JUnitTestCase.assertNull(clause.onKeyword); 3891 JUnitTestCase.assertNull(clause.onKeyword);
3860 JUnitTestCase.assertNull(clause.exceptionType); 3892 JUnitTestCase.assertNull(clause.exceptionType);
3861 JUnitTestCase.assertNotNull(clause.catchKeyword); 3893 JUnitTestCase.assertNotNull(clause.catchKeyword);
3862 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3894 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3863 JUnitTestCase.assertNull(clause.comma); 3895 JUnitTestCase.assertNull(clause.comma);
3864 JUnitTestCase.assertNull(clause.stackTraceParameter); 3896 JUnitTestCase.assertNull(clause.stackTraceParameter);
3865 JUnitTestCase.assertNotNull(clause.body); 3897 JUnitTestCase.assertNotNull(clause.body);
3866 JUnitTestCase.assertNull(statement.finallyKeyword); 3898 JUnitTestCase.assertNull(statement.finallyKeyword);
3867 JUnitTestCase.assertNull(statement.finallyBlock); 3899 JUnitTestCase.assertNull(statement.finallyBlock);
3868 } 3900 }
3869 3901
3870 void test_parseTryStatement_catch_finally() { 3902 void test_parseTryStatement_catch_finally() {
3871 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} catch (e, s) {} finally {}", []); 3903 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} catch (e, s) {} finally {}", []);
3872 JUnitTestCase.assertNotNull(statement.tryKeyword); 3904 JUnitTestCase.assertNotNull(statement.tryKeyword);
3873 JUnitTestCase.assertNotNull(statement.body); 3905 JUnitTestCase.assertNotNull(statement.body);
3874 NodeList<CatchClause> catchClauses = statement.catchClauses; 3906 NodeList<CatchClause> catchClauses = statement.catchClauses;
3875 EngineTestCase.assertSize(1, catchClauses); 3907 EngineTestCase.assertSize(1, catchClauses);
3876 CatchClause clause = catchClauses[0]; 3908 CatchClause clause = catchClauses[0];
3877 JUnitTestCase.assertNull(clause.onKeyword); 3909 JUnitTestCase.assertNull(clause.onKeyword);
3878 JUnitTestCase.assertNull(clause.exceptionType); 3910 JUnitTestCase.assertNull(clause.exceptionType);
3879 JUnitTestCase.assertNotNull(clause.catchKeyword); 3911 JUnitTestCase.assertNotNull(clause.catchKeyword);
3880 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3912 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3881 JUnitTestCase.assertNotNull(clause.comma); 3913 JUnitTestCase.assertNotNull(clause.comma);
3882 JUnitTestCase.assertNotNull(clause.stackTraceParameter); 3914 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3883 JUnitTestCase.assertNotNull(clause.body); 3915 JUnitTestCase.assertNotNull(clause.body);
3884 JUnitTestCase.assertNotNull(statement.finallyKeyword); 3916 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3885 JUnitTestCase.assertNotNull(statement.finallyBlock); 3917 JUnitTestCase.assertNotNull(statement.finallyBlock);
3886 } 3918 }
3887 3919
3888 void test_parseTryStatement_finally() { 3920 void test_parseTryStatement_finally() {
3889 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} finally {}", []); 3921 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} finally {}", []);
3890 JUnitTestCase.assertNotNull(statement.tryKeyword); 3922 JUnitTestCase.assertNotNull(statement.tryKeyword);
3891 JUnitTestCase.assertNotNull(statement.body); 3923 JUnitTestCase.assertNotNull(statement.body);
3892 EngineTestCase.assertSize(0, statement.catchClauses); 3924 EngineTestCase.assertSize(0, statement.catchClauses);
3893 JUnitTestCase.assertNotNull(statement.finallyKeyword); 3925 JUnitTestCase.assertNotNull(statement.finallyKeyword);
3894 JUnitTestCase.assertNotNull(statement.finallyBlock); 3926 JUnitTestCase.assertNotNull(statement.finallyBlock);
3895 } 3927 }
3896 3928
3897 void test_parseTryStatement_multiple() { 3929 void test_parseTryStatement_multiple() {
3898 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []); 3930 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on NPE catch (e) {} on Error {} catch (e) {}", []);
3899 JUnitTestCase.assertNotNull(statement.tryKeyword); 3931 JUnitTestCase.assertNotNull(statement.tryKeyword);
3900 JUnitTestCase.assertNotNull(statement.body); 3932 JUnitTestCase.assertNotNull(statement.body);
3901 EngineTestCase.assertSize(3, statement.catchClauses); 3933 EngineTestCase.assertSize(3, statement.catchClauses);
3902 JUnitTestCase.assertNull(statement.finallyKeyword); 3934 JUnitTestCase.assertNull(statement.finallyKeyword);
3903 JUnitTestCase.assertNull(statement.finallyBlock); 3935 JUnitTestCase.assertNull(statement.finallyBlock);
3904 } 3936 }
3905 3937
3906 void test_parseTryStatement_on() { 3938 void test_parseTryStatement_on() {
3907 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error {}", []); 3939 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error {}", []);
3908 JUnitTestCase.assertNotNull(statement.tryKeyword); 3940 JUnitTestCase.assertNotNull(statement.tryKeyword);
3909 JUnitTestCase.assertNotNull(statement.body); 3941 JUnitTestCase.assertNotNull(statement.body);
3910 NodeList<CatchClause> catchClauses = statement.catchClauses; 3942 NodeList<CatchClause> catchClauses = statement.catchClauses;
3911 EngineTestCase.assertSize(1, catchClauses); 3943 EngineTestCase.assertSize(1, catchClauses);
3912 CatchClause clause = catchClauses[0]; 3944 CatchClause clause = catchClauses[0];
3913 JUnitTestCase.assertNotNull(clause.onKeyword); 3945 JUnitTestCase.assertNotNull(clause.onKeyword);
3914 JUnitTestCase.assertNotNull(clause.exceptionType); 3946 JUnitTestCase.assertNotNull(clause.exceptionType);
3915 JUnitTestCase.assertNull(clause.catchKeyword); 3947 JUnitTestCase.assertNull(clause.catchKeyword);
3916 JUnitTestCase.assertNull(clause.exceptionParameter); 3948 JUnitTestCase.assertNull(clause.exceptionParameter);
3917 JUnitTestCase.assertNull(clause.comma); 3949 JUnitTestCase.assertNull(clause.comma);
3918 JUnitTestCase.assertNull(clause.stackTraceParameter); 3950 JUnitTestCase.assertNull(clause.stackTraceParameter);
3919 JUnitTestCase.assertNotNull(clause.body); 3951 JUnitTestCase.assertNotNull(clause.body);
3920 JUnitTestCase.assertNull(statement.finallyKeyword); 3952 JUnitTestCase.assertNull(statement.finallyKeyword);
3921 JUnitTestCase.assertNull(statement.finallyBlock); 3953 JUnitTestCase.assertNull(statement.finallyBlock);
3922 } 3954 }
3923 3955
3924 void test_parseTryStatement_on_catch() { 3956 void test_parseTryStatement_on_catch() {
3925 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {}", []); 3957 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {}", []);
3926 JUnitTestCase.assertNotNull(statement.tryKeyword); 3958 JUnitTestCase.assertNotNull(statement.tryKeyword);
3927 JUnitTestCase.assertNotNull(statement.body); 3959 JUnitTestCase.assertNotNull(statement.body);
3928 NodeList<CatchClause> catchClauses = statement.catchClauses; 3960 NodeList<CatchClause> catchClauses = statement.catchClauses;
3929 EngineTestCase.assertSize(1, catchClauses); 3961 EngineTestCase.assertSize(1, catchClauses);
3930 CatchClause clause = catchClauses[0]; 3962 CatchClause clause = catchClauses[0];
3931 JUnitTestCase.assertNotNull(clause.onKeyword); 3963 JUnitTestCase.assertNotNull(clause.onKeyword);
3932 JUnitTestCase.assertNotNull(clause.exceptionType); 3964 JUnitTestCase.assertNotNull(clause.exceptionType);
3933 JUnitTestCase.assertNotNull(clause.catchKeyword); 3965 JUnitTestCase.assertNotNull(clause.catchKeyword);
3934 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3966 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3935 JUnitTestCase.assertNotNull(clause.comma); 3967 JUnitTestCase.assertNotNull(clause.comma);
3936 JUnitTestCase.assertNotNull(clause.stackTraceParameter); 3968 JUnitTestCase.assertNotNull(clause.stackTraceParameter);
3937 JUnitTestCase.assertNotNull(clause.body); 3969 JUnitTestCase.assertNotNull(clause.body);
3938 JUnitTestCase.assertNull(statement.finallyKeyword); 3970 JUnitTestCase.assertNull(statement.finallyKeyword);
3939 JUnitTestCase.assertNull(statement.finallyBlock); 3971 JUnitTestCase.assertNull(statement.finallyBlock);
3940 } 3972 }
3941 3973
3942 void test_parseTryStatement_on_catch_finally() { 3974 void test_parseTryStatement_on_catch_finally() {
3943 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []); 3975 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {} on Error catch (e, s) {} finally {}", []);
3944 JUnitTestCase.assertNotNull(statement.tryKeyword); 3976 JUnitTestCase.assertNotNull(statement.tryKeyword);
3945 JUnitTestCase.assertNotNull(statement.body); 3977 JUnitTestCase.assertNotNull(statement.body);
3946 NodeList<CatchClause> catchClauses = statement.catchClauses; 3978 NodeList<CatchClause> catchClauses = statement.catchClauses;
3947 EngineTestCase.assertSize(1, catchClauses); 3979 EngineTestCase.assertSize(1, catchClauses);
3948 CatchClause clause = catchClauses[0]; 3980 CatchClause clause = catchClauses[0];
3949 JUnitTestCase.assertNotNull(clause.onKeyword); 3981 JUnitTestCase.assertNotNull(clause.onKeyword);
3950 JUnitTestCase.assertNotNull(clause.exceptionType); 3982 JUnitTestCase.assertNotNull(clause.exceptionType);
3951 JUnitTestCase.assertNotNull(clause.catchKeyword); 3983 JUnitTestCase.assertNotNull(clause.catchKeyword);
3952 JUnitTestCase.assertNotNull(clause.exceptionParameter); 3984 JUnitTestCase.assertNotNull(clause.exceptionParameter);
3953 JUnitTestCase.assertNotNull(clause.comma); 3985 JUnitTestCase.assertNotNull(clause.comma);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
4011 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef void F();"); 4043 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object > [emptyCommentAndMetadata()], "typedef void F();");
4012 JUnitTestCase.assertNotNull(typeAlias.keyword); 4044 JUnitTestCase.assertNotNull(typeAlias.keyword);
4013 JUnitTestCase.assertNotNull(typeAlias.name); 4045 JUnitTestCase.assertNotNull(typeAlias.name);
4014 JUnitTestCase.assertNotNull(typeAlias.parameters); 4046 JUnitTestCase.assertNotNull(typeAlias.parameters);
4015 JUnitTestCase.assertNotNull(typeAlias.returnType); 4047 JUnitTestCase.assertNotNull(typeAlias.returnType);
4016 JUnitTestCase.assertNotNull(typeAlias.semicolon); 4048 JUnitTestCase.assertNotNull(typeAlias.semicolon);
4017 JUnitTestCase.assertNull(typeAlias.typeParameters); 4049 JUnitTestCase.assertNull(typeAlias.typeParameters);
4018 } 4050 }
4019 4051
4020 void test_parseTypeArgumentList_multiple() { 4052 void test_parseTypeArgumentList_multiple() {
4021 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int, int, int>", []); 4053 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList ", "<int, int, int>", []);
4022 JUnitTestCase.assertNotNull(argumentList.leftBracket); 4054 JUnitTestCase.assertNotNull(argumentList.leftBracket);
4023 EngineTestCase.assertSize(3, argumentList.arguments); 4055 EngineTestCase.assertSize(3, argumentList.arguments);
4024 JUnitTestCase.assertNotNull(argumentList.rightBracket); 4056 JUnitTestCase.assertNotNull(argumentList.rightBracket);
4025 } 4057 }
4026 4058
4027 void test_parseTypeArgumentList_nested() { 4059 void test_parseTypeArgumentList_nested() {
4028 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<A<B>>", []); 4060 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList ", "<A<B>>", []);
4029 JUnitTestCase.assertNotNull(argumentList.leftBracket); 4061 JUnitTestCase.assertNotNull(argumentList.leftBracket);
4030 EngineTestCase.assertSize(1, argumentList.arguments); 4062 EngineTestCase.assertSize(1, argumentList.arguments);
4031 TypeName argument = argumentList.arguments[0]; 4063 TypeName argument = argumentList.arguments[0];
4032 JUnitTestCase.assertNotNull(argument); 4064 JUnitTestCase.assertNotNull(argument);
4033 TypeArgumentList innerList = argument.typeArguments; 4065 TypeArgumentList innerList = argument.typeArguments;
4034 JUnitTestCase.assertNotNull(innerList); 4066 JUnitTestCase.assertNotNull(innerList);
4035 EngineTestCase.assertSize(1, innerList.arguments); 4067 EngineTestCase.assertSize(1, innerList.arguments);
4036 JUnitTestCase.assertNotNull(argumentList.rightBracket); 4068 JUnitTestCase.assertNotNull(argumentList.rightBracket);
4037 } 4069 }
4038 4070
4039 void test_parseTypeArgumentList_single() { 4071 void test_parseTypeArgumentList_single() {
4040 TypeArgumentList argumentList = ParserTestCase.parse5("parseTypeArgumentList ", "<int>", []); 4072 TypeArgumentList argumentList = ParserTestCase.parse4("parseTypeArgumentList ", "<int>", []);
4041 JUnitTestCase.assertNotNull(argumentList.leftBracket); 4073 JUnitTestCase.assertNotNull(argumentList.leftBracket);
4042 EngineTestCase.assertSize(1, argumentList.arguments); 4074 EngineTestCase.assertSize(1, argumentList.arguments);
4043 JUnitTestCase.assertNotNull(argumentList.rightBracket); 4075 JUnitTestCase.assertNotNull(argumentList.rightBracket);
4044 } 4076 }
4045 4077
4046 void test_parseTypeName_parameterized() { 4078 void test_parseTypeName_parameterized() {
4047 TypeName typeName = ParserTestCase.parse5("parseTypeName", "List<int>", []); 4079 TypeName typeName = ParserTestCase.parse4("parseTypeName", "List<int>", []);
4048 JUnitTestCase.assertNotNull(typeName.name); 4080 JUnitTestCase.assertNotNull(typeName.name);
4049 JUnitTestCase.assertNotNull(typeName.typeArguments); 4081 JUnitTestCase.assertNotNull(typeName.typeArguments);
4050 } 4082 }
4051 4083
4052 void test_parseTypeName_simple() { 4084 void test_parseTypeName_simple() {
4053 TypeName typeName = ParserTestCase.parse5("parseTypeName", "int", []); 4085 TypeName typeName = ParserTestCase.parse4("parseTypeName", "int", []);
4054 JUnitTestCase.assertNotNull(typeName.name); 4086 JUnitTestCase.assertNotNull(typeName.name);
4055 JUnitTestCase.assertNull(typeName.typeArguments); 4087 JUnitTestCase.assertNull(typeName.typeArguments);
4056 } 4088 }
4057 4089
4058 void test_parseTypeParameter_bounded() { 4090 void test_parseTypeParameter_bounded() {
4059 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A ext ends B", []); 4091 TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A ext ends B", []);
4060 JUnitTestCase.assertNotNull(parameter.bound); 4092 JUnitTestCase.assertNotNull(parameter.bound);
4061 JUnitTestCase.assertNotNull(parameter.keyword); 4093 JUnitTestCase.assertNotNull(parameter.keyword);
4062 JUnitTestCase.assertNotNull(parameter.name); 4094 JUnitTestCase.assertNotNull(parameter.name);
4063 } 4095 }
4064 4096
4065 void test_parseTypeParameter_simple() { 4097 void test_parseTypeParameter_simple() {
4066 TypeParameter parameter = ParserTestCase.parse5("parseTypeParameter", "A", [ ]); 4098 TypeParameter parameter = ParserTestCase.parse4("parseTypeParameter", "A", [ ]);
4067 JUnitTestCase.assertNull(parameter.bound); 4099 JUnitTestCase.assertNull(parameter.bound);
4068 JUnitTestCase.assertNull(parameter.keyword); 4100 JUnitTestCase.assertNull(parameter.keyword);
4069 JUnitTestCase.assertNotNull(parameter.name); 4101 JUnitTestCase.assertNotNull(parameter.name);
4070 } 4102 }
4071 4103
4072 void test_parseTypeParameterList_multiple() { 4104 void test_parseTypeParameterList_multiple() {
4073 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A, B extends C, D>", []); 4105 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL ist", "<A, B extends C, D>", []);
4074 JUnitTestCase.assertNotNull(parameterList.leftBracket); 4106 JUnitTestCase.assertNotNull(parameterList.leftBracket);
4075 JUnitTestCase.assertNotNull(parameterList.rightBracket); 4107 JUnitTestCase.assertNotNull(parameterList.rightBracket);
4076 EngineTestCase.assertSize(3, parameterList.typeParameters); 4108 EngineTestCase.assertSize(3, parameterList.typeParameters);
4077 } 4109 }
4078 4110
4079 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { 4111 void test_parseTypeParameterList_parameterizedWithTrailingEquals() {
4080 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A extends B<E>>=", []); 4112 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL ist", "<A extends B<E>>=", []);
4081 JUnitTestCase.assertNotNull(parameterList.leftBracket); 4113 JUnitTestCase.assertNotNull(parameterList.leftBracket);
4082 JUnitTestCase.assertNotNull(parameterList.rightBracket); 4114 JUnitTestCase.assertNotNull(parameterList.rightBracket);
4083 EngineTestCase.assertSize(1, parameterList.typeParameters); 4115 EngineTestCase.assertSize(1, parameterList.typeParameters);
4084 } 4116 }
4085 4117
4086 void test_parseTypeParameterList_single() { 4118 void test_parseTypeParameterList_single() {
4087 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>", []); 4119 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL ist", "<A>", []);
4088 JUnitTestCase.assertNotNull(parameterList.leftBracket); 4120 JUnitTestCase.assertNotNull(parameterList.leftBracket);
4089 JUnitTestCase.assertNotNull(parameterList.rightBracket); 4121 JUnitTestCase.assertNotNull(parameterList.rightBracket);
4090 EngineTestCase.assertSize(1, parameterList.typeParameters); 4122 EngineTestCase.assertSize(1, parameterList.typeParameters);
4091 } 4123 }
4092 4124
4093 void test_parseTypeParameterList_withTrailingEquals() { 4125 void test_parseTypeParameterList_withTrailingEquals() {
4094 TypeParameterList parameterList = ParserTestCase.parse5("parseTypeParameterL ist", "<A>=", []); 4126 TypeParameterList parameterList = ParserTestCase.parse4("parseTypeParameterL ist", "<A>=", []);
4095 JUnitTestCase.assertNotNull(parameterList.leftBracket); 4127 JUnitTestCase.assertNotNull(parameterList.leftBracket);
4096 JUnitTestCase.assertNotNull(parameterList.rightBracket); 4128 JUnitTestCase.assertNotNull(parameterList.rightBracket);
4097 EngineTestCase.assertSize(1, parameterList.typeParameters); 4129 EngineTestCase.assertSize(1, parameterList.typeParameters);
4098 } 4130 }
4099 4131
4100 void test_parseUnaryExpression_decrement_normal() { 4132 void test_parseUnaryExpression_decrement_normal() {
4101 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--x", []); 4133 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--x", []);
4102 JUnitTestCase.assertNotNull(expression.operator); 4134 JUnitTestCase.assertNotNull(expression.operator);
4103 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); 4135 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
4104 JUnitTestCase.assertNotNull(expression.operand); 4136 JUnitTestCase.assertNotNull(expression.operand);
4105 } 4137 }
4106 4138
4107 void test_parseUnaryExpression_decrement_super() { 4139 void test_parseUnaryExpression_decrement_super() {
4108 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super", []); 4140 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super", []);
4109 JUnitTestCase.assertNotNull(expression.operator); 4141 JUnitTestCase.assertNotNull(expression.operator);
4110 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 4142 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
4111 Expression innerExpression = expression.operand; 4143 Expression innerExpression = expression.operand;
4112 JUnitTestCase.assertNotNull(innerExpression); 4144 JUnitTestCase.assertNotNull(innerExpression);
4113 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); 4145 JUnitTestCase.assertTrue(innerExpression is PrefixExpression);
4114 PrefixExpression operand = innerExpression as PrefixExpression; 4146 PrefixExpression operand = innerExpression as PrefixExpression;
4115 JUnitTestCase.assertNotNull(operand.operator); 4147 JUnitTestCase.assertNotNull(operand.operator);
4116 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); 4148 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type);
4117 JUnitTestCase.assertNotNull(operand.operand); 4149 JUnitTestCase.assertNotNull(operand.operand);
4118 } 4150 }
4119 4151
4120 void test_parseUnaryExpression_decrement_super_propertyAccess() { 4152 void test_parseUnaryExpression_decrement_super_propertyAccess() {
4121 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "--super.x", []); 4153 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "--super.x", []);
4122 JUnitTestCase.assertNotNull(expression.operator); 4154 JUnitTestCase.assertNotNull(expression.operator);
4123 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); 4155 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type);
4124 JUnitTestCase.assertNotNull(expression.operand); 4156 JUnitTestCase.assertNotNull(expression.operand);
4125 PropertyAccess operand = expression.operand as PropertyAccess; 4157 PropertyAccess operand = expression.operand as PropertyAccess;
4126 JUnitTestCase.assertTrue(operand.target is SuperExpression); 4158 JUnitTestCase.assertTrue(operand.target is SuperExpression);
4127 JUnitTestCase.assertEquals("x", operand.propertyName.name); 4159 JUnitTestCase.assertEquals("x", operand.propertyName.name);
4128 } 4160 }
4129 4161
4130 void test_parseUnaryExpression_increment_normal() { 4162 void test_parseUnaryExpression_increment_normal() {
4131 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++x", []); 4163 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++x", []);
4132 JUnitTestCase.assertNotNull(expression.operator); 4164 JUnitTestCase.assertNotNull(expression.operator);
4133 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 4165 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
4134 JUnitTestCase.assertNotNull(expression.operand); 4166 JUnitTestCase.assertNotNull(expression.operand);
4135 } 4167 }
4136 4168
4137 void test_parseUnaryExpression_increment_super_index() { 4169 void test_parseUnaryExpression_increment_super_index() {
4138 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super[0]", []); 4170 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super[0]", []);
4139 JUnitTestCase.assertNotNull(expression.operator); 4171 JUnitTestCase.assertNotNull(expression.operator);
4140 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 4172 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
4141 JUnitTestCase.assertNotNull(expression.operand); 4173 JUnitTestCase.assertNotNull(expression.operand);
4142 IndexExpression operand = expression.operand as IndexExpression; 4174 IndexExpression operand = expression.operand as IndexExpression;
4143 JUnitTestCase.assertTrue(operand.realTarget is SuperExpression); 4175 JUnitTestCase.assertTrue(operand.realTarget is SuperExpression);
4144 JUnitTestCase.assertTrue(operand.index is IntegerLiteral); 4176 JUnitTestCase.assertTrue(operand.index is IntegerLiteral);
4145 } 4177 }
4146 4178
4147 void test_parseUnaryExpression_increment_super_propertyAccess() { 4179 void test_parseUnaryExpression_increment_super_propertyAccess() {
4148 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "++super.x", []); 4180 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "++super.x", []);
4149 JUnitTestCase.assertNotNull(expression.operator); 4181 JUnitTestCase.assertNotNull(expression.operator);
4150 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); 4182 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type);
4151 JUnitTestCase.assertNotNull(expression.operand); 4183 JUnitTestCase.assertNotNull(expression.operand);
4152 PropertyAccess operand = expression.operand as PropertyAccess; 4184 PropertyAccess operand = expression.operand as PropertyAccess;
4153 JUnitTestCase.assertTrue(operand.target is SuperExpression); 4185 JUnitTestCase.assertTrue(operand.target is SuperExpression);
4154 JUnitTestCase.assertEquals("x", operand.propertyName.name); 4186 JUnitTestCase.assertEquals("x", operand.propertyName.name);
4155 } 4187 }
4156 4188
4157 void test_parseUnaryExpression_minus_normal() { 4189 void test_parseUnaryExpression_minus_normal() {
4158 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-x", []); 4190 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-x", []);
4159 JUnitTestCase.assertNotNull(expression.operator); 4191 JUnitTestCase.assertNotNull(expression.operator);
4160 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 4192 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
4161 JUnitTestCase.assertNotNull(expression.operand); 4193 JUnitTestCase.assertNotNull(expression.operand);
4162 } 4194 }
4163 4195
4164 void test_parseUnaryExpression_minus_super() { 4196 void test_parseUnaryExpression_minus_super() {
4165 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "-super", []); 4197 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "-super", []);
4166 JUnitTestCase.assertNotNull(expression.operator); 4198 JUnitTestCase.assertNotNull(expression.operator);
4167 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); 4199 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type);
4168 JUnitTestCase.assertNotNull(expression.operand); 4200 JUnitTestCase.assertNotNull(expression.operand);
4169 } 4201 }
4170 4202
4171 void test_parseUnaryExpression_not_normal() { 4203 void test_parseUnaryExpression_not_normal() {
4172 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!x", []); 4204 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!x", []);
4173 JUnitTestCase.assertNotNull(expression.operator); 4205 JUnitTestCase.assertNotNull(expression.operator);
4174 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); 4206 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
4175 JUnitTestCase.assertNotNull(expression.operand); 4207 JUnitTestCase.assertNotNull(expression.operand);
4176 } 4208 }
4177 4209
4178 void test_parseUnaryExpression_not_super() { 4210 void test_parseUnaryExpression_not_super() {
4179 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "!super", []); 4211 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "!super", []);
4180 JUnitTestCase.assertNotNull(expression.operator); 4212 JUnitTestCase.assertNotNull(expression.operator);
4181 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); 4213 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type);
4182 JUnitTestCase.assertNotNull(expression.operand); 4214 JUnitTestCase.assertNotNull(expression.operand);
4183 } 4215 }
4184 4216
4185 void test_parseUnaryExpression_tilda_normal() { 4217 void test_parseUnaryExpression_tilda_normal() {
4186 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~x", []); 4218 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~x", []);
4187 JUnitTestCase.assertNotNull(expression.operator); 4219 JUnitTestCase.assertNotNull(expression.operator);
4188 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); 4220 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
4189 JUnitTestCase.assertNotNull(expression.operand); 4221 JUnitTestCase.assertNotNull(expression.operand);
4190 } 4222 }
4191 4223
4192 void test_parseUnaryExpression_tilda_super() { 4224 void test_parseUnaryExpression_tilda_super() {
4193 PrefixExpression expression = ParserTestCase.parse5("parseUnaryExpression", "~super", []); 4225 PrefixExpression expression = ParserTestCase.parse4("parseUnaryExpression", "~super", []);
4194 JUnitTestCase.assertNotNull(expression.operator); 4226 JUnitTestCase.assertNotNull(expression.operator);
4195 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); 4227 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type);
4196 JUnitTestCase.assertNotNull(expression.operand); 4228 JUnitTestCase.assertNotNull(expression.operand);
4197 } 4229 }
4198 4230
4199 void test_parseVariableDeclaration_equals() { 4231 void test_parseVariableDeclaration_equals() {
4200 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a = b", []); 4232 VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclar ation", "a = b", []);
4201 JUnitTestCase.assertNotNull(declaration.name); 4233 JUnitTestCase.assertNotNull(declaration.name);
4202 JUnitTestCase.assertNotNull(declaration.equals); 4234 JUnitTestCase.assertNotNull(declaration.equals);
4203 JUnitTestCase.assertNotNull(declaration.initializer); 4235 JUnitTestCase.assertNotNull(declaration.initializer);
4204 } 4236 }
4205 4237
4206 void test_parseVariableDeclaration_noEquals() { 4238 void test_parseVariableDeclaration_noEquals() {
4207 VariableDeclaration declaration = ParserTestCase.parse5("parseVariableDeclar ation", "a", []); 4239 VariableDeclaration declaration = ParserTestCase.parse4("parseVariableDeclar ation", "a", []);
4208 JUnitTestCase.assertNotNull(declaration.name); 4240 JUnitTestCase.assertNotNull(declaration.name);
4209 JUnitTestCase.assertNull(declaration.equals); 4241 JUnitTestCase.assertNull(declaration.equals);
4210 JUnitTestCase.assertNull(declaration.initializer); 4242 JUnitTestCase.assertNull(declaration.initializer);
4211 } 4243 }
4212 4244
4213 void test_parseVariableDeclarationList_const_noType() { 4245 void test_parseVariableDeclarationList_const_noType() {
4214 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const a"); 4246 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl eDeclarationList", <Object> [emptyCommentAndMetadata()], "const a");
4215 JUnitTestCase.assertNotNull(declarationList.keyword); 4247 JUnitTestCase.assertNotNull(declarationList.keyword);
4216 JUnitTestCase.assertNull(declarationList.type); 4248 JUnitTestCase.assertNull(declarationList.type);
4217 EngineTestCase.assertSize(1, declarationList.variables); 4249 EngineTestCase.assertSize(1, declarationList.variables);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
4292 4324
4293 void test_parseVariableDeclarationStatement_single() { 4325 void test_parseVariableDeclarationStatement_single() {
4294 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x;"); 4326 VariableDeclarationStatement statement = ParserTestCase.parse("parseVariable DeclarationStatement", <Object> [emptyCommentAndMetadata()], "var x;");
4295 JUnitTestCase.assertNotNull(statement.semicolon); 4327 JUnitTestCase.assertNotNull(statement.semicolon);
4296 VariableDeclarationList variableList = statement.variables; 4328 VariableDeclarationList variableList = statement.variables;
4297 JUnitTestCase.assertNotNull(variableList); 4329 JUnitTestCase.assertNotNull(variableList);
4298 EngineTestCase.assertSize(1, variableList.variables); 4330 EngineTestCase.assertSize(1, variableList.variables);
4299 } 4331 }
4300 4332
4301 void test_parseWhileStatement() { 4333 void test_parseWhileStatement() {
4302 WhileStatement statement = ParserTestCase.parse5("parseWhileStatement", "whi le (x) {}", []); 4334 WhileStatement statement = ParserTestCase.parse4("parseWhileStatement", "whi le (x) {}", []);
4303 JUnitTestCase.assertNotNull(statement.keyword); 4335 JUnitTestCase.assertNotNull(statement.keyword);
4304 JUnitTestCase.assertNotNull(statement.leftParenthesis); 4336 JUnitTestCase.assertNotNull(statement.leftParenthesis);
4305 JUnitTestCase.assertNotNull(statement.condition); 4337 JUnitTestCase.assertNotNull(statement.condition);
4306 JUnitTestCase.assertNotNull(statement.rightParenthesis); 4338 JUnitTestCase.assertNotNull(statement.rightParenthesis);
4307 JUnitTestCase.assertNotNull(statement.body); 4339 JUnitTestCase.assertNotNull(statement.body);
4308 } 4340 }
4309 4341
4310 void test_parseWithClause_multiple() { 4342 void test_parseWithClause_multiple() {
4311 WithClause clause = ParserTestCase.parse5("parseWithClause", "with A, B, C", []); 4343 WithClause clause = ParserTestCase.parse4("parseWithClause", "with A, B, C", []);
4312 JUnitTestCase.assertNotNull(clause.withKeyword); 4344 JUnitTestCase.assertNotNull(clause.withKeyword);
4313 EngineTestCase.assertSize(3, clause.mixinTypes); 4345 EngineTestCase.assertSize(3, clause.mixinTypes);
4314 } 4346 }
4315 4347
4316 void test_parseWithClause_single() { 4348 void test_parseWithClause_single() {
4317 WithClause clause = ParserTestCase.parse5("parseWithClause", "with M", []); 4349 WithClause clause = ParserTestCase.parse4("parseWithClause", "with M", []);
4318 JUnitTestCase.assertNotNull(clause.withKeyword); 4350 JUnitTestCase.assertNotNull(clause.withKeyword);
4319 EngineTestCase.assertSize(1, clause.mixinTypes); 4351 EngineTestCase.assertSize(1, clause.mixinTypes);
4320 } 4352 }
4321 4353
4322 void test_skipPrefixedIdentifier_invalid() { 4354 void test_skipPrefixedIdentifier_invalid() {
4323 Token following = skip("skipPrefixedIdentifier", "+"); 4355 Token following = skip("skipPrefixedIdentifier", "+");
4324 JUnitTestCase.assertNull(following); 4356 JUnitTestCase.assertNull(following);
4325 } 4357 }
4326 4358
4327 void test_skipPrefixedIdentifier_notPrefixed() { 4359 void test_skipPrefixedIdentifier_notPrefixed() {
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
5228 runJUnitTest(__test, __test.test_parseCommentReference_new_simple); 5260 runJUnitTest(__test, __test.test_parseCommentReference_new_simple);
5229 }); 5261 });
5230 _ut.test('test_parseCommentReference_prefixed', () { 5262 _ut.test('test_parseCommentReference_prefixed', () {
5231 final __test = new SimpleParserTest(); 5263 final __test = new SimpleParserTest();
5232 runJUnitTest(__test, __test.test_parseCommentReference_prefixed); 5264 runJUnitTest(__test, __test.test_parseCommentReference_prefixed);
5233 }); 5265 });
5234 _ut.test('test_parseCommentReference_simple', () { 5266 _ut.test('test_parseCommentReference_simple', () {
5235 final __test = new SimpleParserTest(); 5267 final __test = new SimpleParserTest();
5236 runJUnitTest(__test, __test.test_parseCommentReference_simple); 5268 runJUnitTest(__test, __test.test_parseCommentReference_simple);
5237 }); 5269 });
5270 _ut.test('test_parseCommentReference_synthetic', () {
5271 final __test = new SimpleParserTest();
5272 runJUnitTest(__test, __test.test_parseCommentReference_synthetic);
5273 });
5238 _ut.test('test_parseCommentReferences_multiLine', () { 5274 _ut.test('test_parseCommentReferences_multiLine', () {
5239 final __test = new SimpleParserTest(); 5275 final __test = new SimpleParserTest();
5240 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine); 5276 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine);
5241 }); 5277 });
5278 _ut.test('test_parseCommentReferences_notClosed_noIdentifier', () {
5279 final __test = new SimpleParserTest();
5280 runJUnitTest(__test, __test.test_parseCommentReferences_notClosed_noIden tifier);
5281 });
5282 _ut.test('test_parseCommentReferences_notClosed_withIdentifier', () {
5283 final __test = new SimpleParserTest();
5284 runJUnitTest(__test, __test.test_parseCommentReferences_notClosed_withId entifier);
5285 });
5242 _ut.test('test_parseCommentReferences_singleLine', () { 5286 _ut.test('test_parseCommentReferences_singleLine', () {
5243 final __test = new SimpleParserTest(); 5287 final __test = new SimpleParserTest();
5244 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine); 5288 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine);
5245 }); 5289 });
5246 _ut.test('test_parseCommentReferences_skipCodeBlock_bracketed', () { 5290 _ut.test('test_parseCommentReferences_skipCodeBlock_bracketed', () {
5247 final __test = new SimpleParserTest(); 5291 final __test = new SimpleParserTest();
5248 runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_br acketed); 5292 runJUnitTest(__test, __test.test_parseCommentReferences_skipCodeBlock_br acketed);
5249 }); 5293 });
5250 _ut.test('test_parseCommentReferences_skipCodeBlock_spaces', () { 5294 _ut.test('test_parseCommentReferences_skipCodeBlock_spaces', () {
5251 final __test = new SimpleParserTest(); 5295 final __test = new SimpleParserTest();
(...skipping 2069 matching lines...) Expand 10 before | Expand all | Expand 10 after
7321 * The given source is scanned and the parser is initialized to start with the first token in the 7365 * The given source is scanned and the parser is initialized to start with the first token in the
7322 * source before the parse method is invoked. 7366 * source before the parse method is invoked.
7323 * 7367 *
7324 * @param methodName the name of the parse method that should be invoked to pa rse the source 7368 * @param methodName the name of the parse method that should be invoked to pa rse the source
7325 * @param objects the values of the arguments to the method 7369 * @param objects the values of the arguments to the method
7326 * @param source the source to be parsed by the parse method 7370 * @param source the source to be parsed by the parse method
7327 * @return the result of invoking the method 7371 * @return the result of invoking the method
7328 * @throws Exception if the method could not be invoked or throws an exception 7372 * @throws Exception if the method could not be invoked or throws an exception
7329 * @throws AssertionFailedError if the result is `null` or if any errors are p roduced 7373 * @throws AssertionFailedError if the result is `null` or if any errors are p roduced
7330 */ 7374 */
7331 static Object parse(String methodName, List<Object> objects, String source) => parse3(methodName, objects, source, new List<AnalysisError>(0)); 7375 static Object parse(String methodName, List<Object> objects, String source) => parse2(methodName, objects, source, new List<AnalysisError>(0));
7332 7376
7333 /** 7377 /**
7334 * Invoke a parse method in [Parser]. The method is assumed to have the given number and 7378 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
7335 * type of parameters and will be invoked with the given arguments. 7379 * type of parameters and will be invoked with the given arguments.
7336 * 7380 *
7337 * The given source is scanned and the parser is initialized to start with the first token in the 7381 * The given source is scanned and the parser is initialized to start with the first token in the
7338 * source before the parse method is invoked. 7382 * source before the parse method is invoked.
7339 * 7383 *
7340 * @param methodName the name of the parse method that should be invoked to pa rse the source 7384 * @param methodName the name of the parse method that should be invoked to pa rse the source
7341 * @param objects the values of the arguments to the method 7385 * @param objects the values of the arguments to the method
7342 * @param source the source to be parsed by the parse method 7386 * @param source the source to be parsed by the parse method
7343 * @param errorCodes the error codes of the errors that should be generated 7387 * @param errorCodes the error codes of the errors that should be generated
7344 * @return the result of invoking the method 7388 * @return the result of invoking the method
7345 * @throws Exception if the method could not be invoked or throws an exception 7389 * @throws Exception if the method could not be invoked or throws an exception
7346 * @throws AssertionFailedError if the result is `null` or the errors produced while 7390 * @throws AssertionFailedError if the result is `null` or the errors produced while
7347 * scanning and parsing the source do not match the expected errors 7391 * scanning and parsing the source do not match the expected errors
7348 */ 7392 */
7349 static Object parse3(String methodName, List<Object> objects, String source, L ist<AnalysisError> errors) { 7393 static Object parse2(String methodName, List<Object> objects, String source, L ist<AnalysisError> errors) {
7350 GatheringErrorListener listener = new GatheringErrorListener(); 7394 GatheringErrorListener listener = new GatheringErrorListener();
7351 Object result = invokeParserMethod(methodName, objects, source, listener); 7395 Object result = invokeParserMethod(methodName, objects, source, listener);
7352 listener.assertErrors(errors); 7396 listener.assertErrors(errors);
7353 return result; 7397 return result;
7354 } 7398 }
7355 7399
7356 /** 7400 /**
7357 * Invoke a parse method in [Parser]. The method is assumed to have the given number and 7401 * Invoke a parse method in [Parser]. The method is assumed to have the given number and
7358 * type of parameters and will be invoked with the given arguments. 7402 * type of parameters and will be invoked with the given arguments.
7359 * 7403 *
7360 * The given source is scanned and the parser is initialized to start with the first token in the 7404 * The given source is scanned and the parser is initialized to start with the first token in the
7361 * source before the parse method is invoked. 7405 * source before the parse method is invoked.
7362 * 7406 *
7363 * @param methodName the name of the parse method that should be invoked to pa rse the source 7407 * @param methodName the name of the parse method that should be invoked to pa rse the source
7364 * @param objects the values of the arguments to the method 7408 * @param objects the values of the arguments to the method
7365 * @param source the source to be parsed by the parse method 7409 * @param source the source to be parsed by the parse method
7366 * @param errorCodes the error codes of the errors that should be generated 7410 * @param errorCodes the error codes of the errors that should be generated
7367 * @return the result of invoking the method 7411 * @return the result of invoking the method
7368 * @throws Exception if the method could not be invoked or throws an exception 7412 * @throws Exception if the method could not be invoked or throws an exception
7369 * @throws AssertionFailedError if the result is `null` or the errors produced while 7413 * @throws AssertionFailedError if the result is `null` or the errors produced while
7370 * scanning and parsing the source do not match the expected errors 7414 * scanning and parsing the source do not match the expected errors
7371 */ 7415 */
7372 static Object parse4(String methodName, List<Object> objects, String source, L ist<ErrorCode> errorCodes) { 7416 static Object parse3(String methodName, List<Object> objects, String source, L ist<ErrorCode> errorCodes) {
7373 GatheringErrorListener listener = new GatheringErrorListener(); 7417 GatheringErrorListener listener = new GatheringErrorListener();
7374 Object result = invokeParserMethod(methodName, objects, source, listener); 7418 Object result = invokeParserMethod(methodName, objects, source, listener);
7375 listener.assertErrors2(errorCodes); 7419 listener.assertErrors2(errorCodes);
7376 return result; 7420 return result;
7377 } 7421 }
7378 7422
7379 /** 7423 /**
7380 * Invoke a parse method in [Parser]. The method is assumed to have no argumen ts. 7424 * Invoke a parse method in [Parser]. The method is assumed to have no argumen ts.
7381 * 7425 *
7382 * The given source is scanned and the parser is initialized to start with the first token in the 7426 * The given source is scanned and the parser is initialized to start with the first token in the
7383 * source before the parse method is invoked. 7427 * source before the parse method is invoked.
7384 * 7428 *
7385 * @param methodName the name of the parse method that should be invoked to pa rse the source 7429 * @param methodName the name of the parse method that should be invoked to pa rse the source
7386 * @param source the source to be parsed by the parse method 7430 * @param source the source to be parsed by the parse method
7387 * @param errorCodes the error codes of the errors that should be generated 7431 * @param errorCodes the error codes of the errors that should be generated
7388 * @return the result of invoking the method 7432 * @return the result of invoking the method
7389 * @throws Exception if the method could not be invoked or throws an exception 7433 * @throws Exception if the method could not be invoked or throws an exception
7390 * @throws AssertionFailedError if the result is `null` or the errors produced while 7434 * @throws AssertionFailedError if the result is `null` or the errors produced while
7391 * scanning and parsing the source do not match the expected errors 7435 * scanning and parsing the source do not match the expected errors
7392 */ 7436 */
7393 static Object parse5(String methodName, String source, List<ErrorCode> errorCo des) => parse4(methodName, _EMPTY_ARGUMENTS, source, errorCodes); 7437 static Object parse4(String methodName, String source, List<ErrorCode> errorCo des) => parse3(methodName, _EMPTY_ARGUMENTS, source, errorCodes);
7394 7438
7395 /** 7439 /**
7396 * Parse the given source as a compilation unit. 7440 * Parse the given source as a compilation unit.
7397 * 7441 *
7398 * @param source the source to be parsed 7442 * @param source the source to be parsed
7399 * @param errorCodes the error codes of the errors that are expected to be fou nd 7443 * @param errorCodes the error codes of the errors that are expected to be fou nd
7400 * @return the compilation unit that was parsed 7444 * @return the compilation unit that was parsed
7401 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do 7445 * @throws Exception if the source could not be parsed, if the compilation err ors in the source do
7402 * not match those that are expected, or if the result would have be en `null` 7446 * not match those that are expected, or if the result would have be en `null`
7403 */ 7447 */
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
8554 ParserErrorCode.MISSING_IDENTIFIER, 8598 ParserErrorCode.MISSING_IDENTIFIER,
8555 ParserErrorCode.MISSING_IDENTIFIER]); 8599 ParserErrorCode.MISSING_IDENTIFIER]);
8556 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); 8600 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
8557 } 8601 }
8558 8602
8559 void test_classTypeAlias_withBody() { 8603 void test_classTypeAlias_withBody() {
8560 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {} ", "class B = Object with A {}"]), [ParserErrorCode.EXPECTED_TOKEN]); 8604 ParserTestCase.parseCompilationUnit(EngineTestCase.createSource(["class A {} ", "class B = Object with A {}"]), [ParserErrorCode.EXPECTED_TOKEN]);
8561 } 8605 }
8562 8606
8563 void test_conditionalExpression_missingElse() { 8607 void test_conditionalExpression_missingElse() {
8564 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]); 8608 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx pression", "x ? y :", [ParserErrorCode.MISSING_IDENTIFIER]);
8565 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression) ; 8609 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression) ;
8566 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic); 8610 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic);
8567 } 8611 }
8568 8612
8569 void test_conditionalExpression_missingThen() { 8613 void test_conditionalExpression_missingThen() {
8570 ConditionalExpression expression = ParserTestCase.parse5("parseConditionalEx pression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]); 8614 ConditionalExpression expression = ParserTestCase.parse4("parseConditionalEx pression", "x ? : z", [ParserErrorCode.MISSING_IDENTIFIER]);
8571 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression) ; 8615 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression) ;
8572 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic); 8616 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic);
8573 } 8617 }
8574 8618
8575 void test_equalityExpression_missing_LHS() { 8619 void test_equalityExpression_missing_LHS() {
8576 BinaryExpression expression = ParserTestCase.parseExpression("== y", [Parser ErrorCode.MISSING_IDENTIFIER]); 8620 BinaryExpression expression = ParserTestCase.parseExpression("== y", [Parser ErrorCode.MISSING_IDENTIFIER]);
8577 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); 8621 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
8578 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); 8622 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
8579 } 8623 }
8580 8624
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
8618 8662
8619 void test_equalityExpression_super() { 8663 void test_equalityExpression_super() {
8620 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", [ 8664 BinaryExpression expression = ParserTestCase.parseExpression("super == ==", [
8621 ParserErrorCode.MISSING_IDENTIFIER, 8665 ParserErrorCode.MISSING_IDENTIFIER,
8622 ParserErrorCode.MISSING_IDENTIFIER, 8666 ParserErrorCode.MISSING_IDENTIFIER,
8623 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]); 8667 ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND]);
8624 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); 8668 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand);
8625 } 8669 }
8626 8670
8627 void test_expressionList_multiple_end() { 8671 void test_expressionList_multiple_end() {
8628 List<Expression> result = ParserTestCase.parse5("parseExpressionList", ", 2, 3, 4", [ParserErrorCode.MISSING_IDENTIFIER]); 8672 List<Expression> result = ParserTestCase.parse4("parseExpressionList", ", 2, 3, 4", [ParserErrorCode.MISSING_IDENTIFIER]);
8629 EngineTestCase.assertSize(4, result); 8673 EngineTestCase.assertSize(4, result);
8630 Expression syntheticExpression = result[0]; 8674 Expression syntheticExpression = result[0];
8631 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 8675 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
8632 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); 8676 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
8633 } 8677 }
8634 8678
8635 void test_expressionList_multiple_middle() { 8679 void test_expressionList_multiple_middle() {
8636 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , , 4", [ParserErrorCode.MISSING_IDENTIFIER]); 8680 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2 , , 4", [ParserErrorCode.MISSING_IDENTIFIER]);
8637 EngineTestCase.assertSize(4, result); 8681 EngineTestCase.assertSize(4, result);
8638 Expression syntheticExpression = result[2]; 8682 Expression syntheticExpression = result[2];
8639 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 8683 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
8640 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); 8684 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
8641 } 8685 }
8642 8686
8643 void test_expressionList_multiple_start() { 8687 void test_expressionList_multiple_start() {
8644 List<Expression> result = ParserTestCase.parse5("parseExpressionList", "1, 2 , 3,", [ParserErrorCode.MISSING_IDENTIFIER]); 8688 List<Expression> result = ParserTestCase.parse4("parseExpressionList", "1, 2 , 3,", [ParserErrorCode.MISSING_IDENTIFIER]);
8645 EngineTestCase.assertSize(4, result); 8689 EngineTestCase.assertSize(4, result);
8646 Expression syntheticExpression = result[3]; 8690 Expression syntheticExpression = result[3];
8647 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); 8691 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression);
8648 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic); 8692 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic);
8649 } 8693 }
8650 8694
8651 void test_incomplete_topLevelVariable() { 8695 void test_incomplete_topLevelVariable() {
8652 CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [Parser ErrorCode.EXPECTED_EXECUTABLE]); 8696 CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [Parser ErrorCode.EXPECTED_EXECUTABLE]);
8653 NodeList<CompilationUnitMember> declarations = unit.declarations; 8697 NodeList<CompilationUnitMember> declarations = unit.declarations;
8654 EngineTestCase.assertSize(1, declarations); 8698 EngineTestCase.assertSize(1, declarations);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
8748 } 8792 }
8749 8793
8750 void test_logicalOrExpression_precedence_logicalAnd_right() { 8794 void test_logicalOrExpression_precedence_logicalAnd_right() {
8751 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [ 8795 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", [
8752 ParserErrorCode.MISSING_IDENTIFIER, 8796 ParserErrorCode.MISSING_IDENTIFIER,
8753 ParserErrorCode.MISSING_IDENTIFIER, 8797 ParserErrorCode.MISSING_IDENTIFIER,
8754 ParserErrorCode.MISSING_IDENTIFIER]); 8798 ParserErrorCode.MISSING_IDENTIFIER]);
8755 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); 8799 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand);
8756 } 8800 }
8757 8801
8802 void test_missingIdentifier_afterAnnotation() {
8803 MethodDeclaration method = ParserTestCase.parse3("parseClassMember", <Object > ["C"], "@override }", [ParserErrorCode.EXPECTED_CLASS_MEMBER]);
8804 JUnitTestCase.assertNull(method.documentationComment);
8805 NodeList<Annotation> metadata = method.metadata;
8806 EngineTestCase.assertSize(1, metadata);
8807 JUnitTestCase.assertEquals("override", metadata[0].name.name);
8808 }
8809
8758 void test_multiplicativeExpression_missing_LHS() { 8810 void test_multiplicativeExpression_missing_LHS() {
8759 BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserE rrorCode.MISSING_IDENTIFIER]); 8811 BinaryExpression expression = ParserTestCase.parseExpression("* y", [ParserE rrorCode.MISSING_IDENTIFIER]);
8760 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); 8812 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand);
8761 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic); 8813 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic);
8762 } 8814 }
8763 8815
8764 void test_multiplicativeExpression_missing_LHS_RHS() { 8816 void test_multiplicativeExpression_missing_LHS_RHS() {
8765 BinaryExpression expression = ParserTestCase.parseExpression("*", [ 8817 BinaryExpression expression = ParserTestCase.parseExpression("*", [
8766 ParserErrorCode.MISSING_IDENTIFIER, 8818 ParserErrorCode.MISSING_IDENTIFIER,
8767 ParserErrorCode.MISSING_IDENTIFIER]); 8819 ParserErrorCode.MISSING_IDENTIFIER]);
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
9126 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS); 9178 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS);
9127 }); 9179 });
9128 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () { 9180 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () {
9129 final __test = new RecoveryParserTest(); 9181 final __test = new RecoveryParserTest();
9130 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_left); 9182 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_left);
9131 }); 9183 });
9132 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () { 9184 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () {
9133 final __test = new RecoveryParserTest(); 9185 final __test = new RecoveryParserTest();
9134 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_right); 9186 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA nd_right);
9135 }); 9187 });
9188 _ut.test('test_missingIdentifier_afterAnnotation', () {
9189 final __test = new RecoveryParserTest();
9190 runJUnitTest(__test, __test.test_missingIdentifier_afterAnnotation);
9191 });
9136 _ut.test('test_multiplicativeExpression_missing_LHS', () { 9192 _ut.test('test_multiplicativeExpression_missing_LHS', () {
9137 final __test = new RecoveryParserTest(); 9193 final __test = new RecoveryParserTest();
9138 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS); 9194 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS);
9139 }); 9195 });
9140 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () { 9196 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () {
9141 final __test = new RecoveryParserTest(); 9197 final __test = new RecoveryParserTest();
9142 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH S); 9198 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH S);
9143 }); 9199 });
9144 _ut.test('test_multiplicativeExpression_missing_RHS', () { 9200 _ut.test('test_multiplicativeExpression_missing_RHS', () {
9145 final __test = new RecoveryParserTest(); 9201 final __test = new RecoveryParserTest();
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
9277 // "f() => 0; g() {}" 9333 // "f() => 0; g() {}"
9278 assertParse("f()", "", " => 0; g()", " {}"); 9334 assertParse("f()", "", " => 0; g()", " {}");
9279 } 9335 }
9280 9336
9281 void test_insert_end() { 9337 void test_insert_end() {
9282 // "class A {}" 9338 // "class A {}"
9283 // "class A {} class B {}" 9339 // "class A {} class B {}"
9284 assertParse("class A {}", "", " class B {}", ""); 9340 assertParse("class A {}", "", " class B {}", "");
9285 } 9341 }
9286 9342
9343 void test_insert_insideClassBody() {
9344 // "class C {C(); }"
9345 // "class C { C(); }"
9346 assertParse("class C {", "", " ", "C(); }");
9347 }
9348
9287 void test_insert_insideIdentifier() { 9349 void test_insert_insideIdentifier() {
9288 // "f() => cob;" 9350 // "f() => cob;"
9289 // "f() => cow.b;" 9351 // "f() => cow.b;"
9290 assertParse("f() => co", "", "w.", "b;"); 9352 assertParse("f() => co", "", "w.", "b;");
9291 } 9353 }
9292 9354
9293 void test_insert_newIdentifier1() { 9355 void test_insert_newIdentifier1() {
9294 // "f() => a; c;" 9356 // "f() => a; c;"
9295 // "f() => a; b c;" 9357 // "f() => a; b c;"
9296 assertParse("f() => a;", "", " b", " c;"); 9358 assertParse("f() => a;", "", " b", " c;");
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
9503 runJUnitTest(__test, __test.test_insert_beforeIdentifier2); 9565 runJUnitTest(__test, __test.test_insert_beforeIdentifier2);
9504 }); 9566 });
9505 _ut.test('test_insert_convertOneFunctionToTwo', () { 9567 _ut.test('test_insert_convertOneFunctionToTwo', () {
9506 final __test = new IncrementalParserTest(); 9568 final __test = new IncrementalParserTest();
9507 runJUnitTest(__test, __test.test_insert_convertOneFunctionToTwo); 9569 runJUnitTest(__test, __test.test_insert_convertOneFunctionToTwo);
9508 }); 9570 });
9509 _ut.test('test_insert_end', () { 9571 _ut.test('test_insert_end', () {
9510 final __test = new IncrementalParserTest(); 9572 final __test = new IncrementalParserTest();
9511 runJUnitTest(__test, __test.test_insert_end); 9573 runJUnitTest(__test, __test.test_insert_end);
9512 }); 9574 });
9575 _ut.test('test_insert_insideClassBody', () {
9576 final __test = new IncrementalParserTest();
9577 runJUnitTest(__test, __test.test_insert_insideClassBody);
9578 });
9513 _ut.test('test_insert_insideIdentifier', () { 9579 _ut.test('test_insert_insideIdentifier', () {
9514 final __test = new IncrementalParserTest(); 9580 final __test = new IncrementalParserTest();
9515 runJUnitTest(__test, __test.test_insert_insideIdentifier); 9581 runJUnitTest(__test, __test.test_insert_insideIdentifier);
9516 }); 9582 });
9517 _ut.test('test_insert_newIdentifier1', () { 9583 _ut.test('test_insert_newIdentifier1', () {
9518 final __test = new IncrementalParserTest(); 9584 final __test = new IncrementalParserTest();
9519 runJUnitTest(__test, __test.test_insert_newIdentifier1); 9585 runJUnitTest(__test, __test.test_insert_newIdentifier1);
9520 }); 9586 });
9521 _ut.test('test_insert_newIdentifier2', () { 9587 _ut.test('test_insert_newIdentifier2', () {
9522 final __test = new IncrementalParserTest(); 9588 final __test = new IncrementalParserTest();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
9601 /** 9667 /**
9602 * The class `ErrorParserTest` defines parser tests that test the parsing of cod e to ensure 9668 * The class `ErrorParserTest` defines parser tests that test the parsing of cod e to ensure
9603 * that errors are correctly reported, and in some cases, not reported. 9669 * that errors are correctly reported, and in some cases, not reported.
9604 */ 9670 */
9605 class ErrorParserTest extends ParserTestCase { 9671 class ErrorParserTest extends ParserTestCase {
9606 void fail_expectedListOrMapLiteral() { 9672 void fail_expectedListOrMapLiteral() {
9607 // It isn't clear that this test can ever pass. The parser is currently crea te a synthetic list 9673 // It isn't clear that this test can ever pass. The parser is currently crea te a synthetic list
9608 // literal in this case, but isSynthetic() isn't overridden for ListLiteral. The problem is that 9674 // literal in this case, but isSynthetic() isn't overridden for ListLiteral. The problem is that
9609 // the synthetic list literals that are being created are not always zero le ngth (because they 9675 // the synthetic list literals that are being created are not always zero le ngth (because they
9610 // could have type parameters), which violates the contract of isSynthetic() . 9676 // could have type parameters), which violates the contract of isSynthetic() .
9611 TypedLiteral literal = ParserTestCase.parse4("parseListOrMapLiteral", <Objec t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); 9677 TypedLiteral literal = ParserTestCase.parse3("parseListOrMapLiteral", <Objec t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]);
9612 JUnitTestCase.assertTrue(literal.isSynthetic); 9678 JUnitTestCase.assertTrue(literal.isSynthetic);
9613 } 9679 }
9614 9680
9615 void fail_illegalAssignmentToNonAssignable_superAssigned() { 9681 void fail_illegalAssignmentToNonAssignable_superAssigned() {
9616 // TODO(brianwilkerson) When this test starts to pass, remove the test 9682 // TODO(brianwilkerson) When this test starts to pass, remove the test
9617 // test_illegalAssignmentToNonAssignable_superAssigned. 9683 // test_illegalAssignmentToNonAssignable_superAssigned.
9618 ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGN MENT_TO_NON_ASSIGNABLE]); 9684 ParserTestCase.parseExpression("super = x;", [ParserErrorCode.ILLEGAL_ASSIGN MENT_TO_NON_ASSIGNABLE]);
9619 } 9685 }
9620 9686
9621 void fail_invalidCommentReference__new_nonIdentifier() { 9687 void fail_invalidCommentReference__new_nonIdentifier() {
9622 // This test fails because the method parseCommentReference returns null. 9688 // This test fails because the method parseCommentReference returns null.
9623 ParserTestCase.parse4("parseCommentReference", <Object> ["new 42", 0], "", [ ParserErrorCode.INVALID_COMMENT_REFERENCE]); 9689 ParserTestCase.parse3("parseCommentReference", <Object> ["new 42", 0], "", [ ParserErrorCode.INVALID_COMMENT_REFERENCE]);
9624 } 9690 }
9625 9691
9626 void fail_invalidCommentReference__new_tooMuch() { 9692 void fail_invalidCommentReference__new_tooMuch() {
9627 ParserTestCase.parse4("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); 9693 ParserTestCase.parse3("parseCommentReference", <Object> ["new a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
9628 } 9694 }
9629 9695
9630 void fail_invalidCommentReference__nonNew_nonIdentifier() { 9696 void fail_invalidCommentReference__nonNew_nonIdentifier() {
9631 // This test fails because the method parseCommentReference returns null. 9697 // This test fails because the method parseCommentReference returns null.
9632 ParserTestCase.parse4("parseCommentReference", <Object> ["42", 0], "", [Pars erErrorCode.INVALID_COMMENT_REFERENCE]); 9698 ParserTestCase.parse3("parseCommentReference", <Object> ["42", 0], "", [Pars erErrorCode.INVALID_COMMENT_REFERENCE]);
9633 } 9699 }
9634 9700
9635 void fail_invalidCommentReference__nonNew_tooMuch() { 9701 void fail_invalidCommentReference__nonNew_tooMuch() {
9636 ParserTestCase.parse4("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); 9702 ParserTestCase.parse3("parseCommentReference", <Object> ["a.b.c.d", 0], "", [ParserErrorCode.INVALID_COMMENT_REFERENCE]);
9637 } 9703 }
9638 9704
9639 void fail_missingClosingParenthesis() { 9705 void fail_missingClosingParenthesis() {
9640 // It is possible that it is not possible to generate this error (that it's being reported in 9706 // It is possible that it is not possible to generate this error (that it's being reported in
9641 // code that cannot actually be reached), but that hasn't been proven yet. 9707 // code that cannot actually be reached), but that hasn't been proven yet.
9642 ParserTestCase.parse5("parseFormalParameterList", "(int a, int b ;", [Parser ErrorCode.MISSING_CLOSING_PARENTHESIS]); 9708 ParserTestCase.parse4("parseFormalParameterList", "(int a, int b ;", [Parser ErrorCode.MISSING_CLOSING_PARENTHESIS]);
9643 } 9709 }
9644 9710
9645 void fail_missingFunctionParameters_local_nonVoid_block() { 9711 void fail_missingFunctionParameters_local_nonVoid_block() {
9646 // The parser does not recognize this as a function declaration, so it tries to parse it as an 9712 // The parser does not recognize this as a function declaration, so it tries to parse it as an
9647 // expression statement. It isn't clear what the best error message is in th is case. 9713 // expression statement. It isn't clear what the best error message is in th is case.
9648 ParserTestCase.parseStatement("int f { return x;}", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]); 9714 ParserTestCase.parseStatement("int f { return x;}", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]);
9649 } 9715 }
9650 9716
9651 void fail_missingFunctionParameters_local_nonVoid_expression() { 9717 void fail_missingFunctionParameters_local_nonVoid_expression() {
9652 // The parser does not recognize this as a function declaration, so it tries to parse it as an 9718 // The parser does not recognize this as a function declaration, so it tries to parse it as an
9653 // expression statement. It isn't clear what the best error message is in th is case. 9719 // expression statement. It isn't clear what the best error message is in th is case.
9654 ParserTestCase.parseStatement("int f => x;", [ParserErrorCode.MISSING_FUNCTI ON_PARAMETERS]); 9720 ParserTestCase.parseStatement("int f => x;", [ParserErrorCode.MISSING_FUNCTI ON_PARAMETERS]);
9655 } 9721 }
9656 9722
9657 void fail_namedFunctionExpression() { 9723 void fail_namedFunctionExpression() {
9658 Expression expression = ParserTestCase.parse5("parsePrimaryExpression", "f() {}", [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]); 9724 Expression expression = ParserTestCase.parse4("parsePrimaryExpression", "f() {}", [ParserErrorCode.NAMED_FUNCTION_EXPRESSION]);
9659 EngineTestCase.assertInstanceOf(FunctionExpression, expression); 9725 EngineTestCase.assertInstanceOf(FunctionExpression, expression);
9660 } 9726 }
9661 9727
9662 void fail_unexpectedToken_invalidPostfixExpression() { 9728 void fail_unexpectedToken_invalidPostfixExpression() {
9663 // Note: this might not be the right error to produce, but some error should be produced 9729 // Note: this might not be the right error to produce, but some error should be produced
9664 ParserTestCase.parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]); 9730 ParserTestCase.parseExpression("f()++", [ParserErrorCode.UNEXPECTED_TOKEN]);
9665 } 9731 }
9666 9732
9667 void fail_varAndType_local() { 9733 void fail_varAndType_local() {
9668 // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but t his would be a 9734 // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but t his would be a
9669 // better error message. 9735 // better error message.
9670 ParserTestCase.parseStatement("var int x;", [ParserErrorCode.VAR_AND_TYPE]); 9736 ParserTestCase.parseStatement("var int x;", [ParserErrorCode.VAR_AND_TYPE]);
9671 } 9737 }
9672 9738
9673 void fail_varAndType_parameter() { 9739 void fail_varAndType_parameter() {
9674 // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but t his would be a 9740 // This is currently reporting EXPECTED_TOKEN for a missing semicolon, but t his would be a
9675 // better error message. 9741 // better error message.
9676 ParserTestCase.parse5("parseFormalParameterList", "(var int x)", [ParserErro rCode.VAR_AND_TYPE]); 9742 ParserTestCase.parse4("parseFormalParameterList", "(var int x)", [ParserErro rCode.VAR_AND_TYPE]);
9677 } 9743 }
9678 9744
9679 void test_abstractClassMember_constructor() { 9745 void test_abstractClassMember_constructor() {
9680 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 9746 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C.c();", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
9681 } 9747 }
9682 9748
9683 void test_abstractClassMember_field() { 9749 void test_abstractClassMember_field() {
9684 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract C f;", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 9750 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract C f;", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
9685 } 9751 }
9686 9752
9687 void test_abstractClassMember_getter() { 9753 void test_abstractClassMember_getter() {
9688 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 9754 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract get m;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
9689 } 9755 }
9690 9756
9691 void test_abstractClassMember_method() { 9757 void test_abstractClassMember_method() {
9692 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract m();", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 9758 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract m();", [ ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
9693 } 9759 }
9694 9760
9695 void test_abstractClassMember_setter() { 9761 void test_abstractClassMember_setter() {
9696 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "abstract set m(v) ;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); 9762 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "abstract set m(v) ;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]);
9697 } 9763 }
9698 9764
9699 void test_abstractTopLevelFunction_function() { 9765 void test_abstractTopLevelFunction_function() {
9700 ParserTestCase.parseCompilationUnit("abstract f(v) {}", [ParserErrorCode.ABS TRACT_TOP_LEVEL_FUNCTION]); 9766 ParserTestCase.parseCompilationUnit("abstract f(v) {}", [ParserErrorCode.ABS TRACT_TOP_LEVEL_FUNCTION]);
9701 } 9767 }
9702 9768
9703 void test_abstractTopLevelFunction_getter() { 9769 void test_abstractTopLevelFunction_getter() {
9704 ParserTestCase.parseCompilationUnit("abstract get m {}", [ParserErrorCode.AB STRACT_TOP_LEVEL_FUNCTION]); 9770 ParserTestCase.parseCompilationUnit("abstract get m {}", [ParserErrorCode.AB STRACT_TOP_LEVEL_FUNCTION]);
9705 } 9771 }
9706 9772
9707 void test_abstractTopLevelFunction_setter() { 9773 void test_abstractTopLevelFunction_setter() {
9708 ParserTestCase.parseCompilationUnit("abstract set m(v) {}", [ParserErrorCode .ABSTRACT_TOP_LEVEL_FUNCTION]); 9774 ParserTestCase.parseCompilationUnit("abstract set m(v) {}", [ParserErrorCode .ABSTRACT_TOP_LEVEL_FUNCTION]);
9709 } 9775 }
9710 9776
9711 void test_abstractTopLevelVariable() { 9777 void test_abstractTopLevelVariable() {
9712 ParserTestCase.parseCompilationUnit("abstract C f;", [ParserErrorCode.ABSTRA CT_TOP_LEVEL_VARIABLE]); 9778 ParserTestCase.parseCompilationUnit("abstract C f;", [ParserErrorCode.ABSTRA CT_TOP_LEVEL_VARIABLE]);
9713 } 9779 }
9714 9780
9715 void test_abstractTypeDef() { 9781 void test_abstractTypeDef() {
9716 ParserTestCase.parseCompilationUnit("abstract typedef F();", [ParserErrorCod e.ABSTRACT_TYPEDEF]); 9782 ParserTestCase.parseCompilationUnit("abstract typedef F();", [ParserErrorCod e.ABSTRACT_TYPEDEF]);
9717 } 9783 }
9718 9784
9719 void test_assertDoesNotTakeAssignment() { 9785 void test_assertDoesNotTakeAssignment() {
9720 ParserTestCase.parse5("parseAssertStatement", "assert(b = true);", [ParserEr rorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]); 9786 ParserTestCase.parse4("parseAssertStatement", "assert(b = true);", [ParserEr rorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT]);
9721 } 9787 }
9722 9788
9723 void test_assertDoesNotTakeCascades() { 9789 void test_assertDoesNotTakeCascades() {
9724 ParserTestCase.parse5("parseAssertStatement", "assert(new A()..m());", [Pars erErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]); 9790 ParserTestCase.parse4("parseAssertStatement", "assert(new A()..m());", [Pars erErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE]);
9725 } 9791 }
9726 9792
9727 void test_assertDoesNotTakeRethrow() { 9793 void test_assertDoesNotTakeRethrow() {
9728 ParserTestCase.parse5("parseAssertStatement", "assert(rethrow);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_RETHROW]); 9794 ParserTestCase.parse4("parseAssertStatement", "assert(rethrow);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_RETHROW]);
9729 } 9795 }
9730 9796
9731 void test_assertDoesNotTakeThrow() { 9797 void test_assertDoesNotTakeThrow() {
9732 ParserTestCase.parse5("parseAssertStatement", "assert(throw x);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_THROW]); 9798 ParserTestCase.parse4("parseAssertStatement", "assert(throw x);", [ParserErr orCode.ASSERT_DOES_NOT_TAKE_THROW]);
9733 } 9799 }
9734 9800
9735 void test_breakOutsideOfLoop_breakInDoStatement() { 9801 void test_breakOutsideOfLoop_breakInDoStatement() {
9736 ParserTestCase.parse5("parseDoStatement", "do {break;} while (x);", []); 9802 ParserTestCase.parse4("parseDoStatement", "do {break;} while (x);", []);
9737 } 9803 }
9738 9804
9739 void test_breakOutsideOfLoop_breakInForStatement() { 9805 void test_breakOutsideOfLoop_breakInForStatement() {
9740 ParserTestCase.parse5("parseForStatement", "for (; x;) {break;}", []); 9806 ParserTestCase.parse4("parseForStatement", "for (; x;) {break;}", []);
9741 } 9807 }
9742 9808
9743 void test_breakOutsideOfLoop_breakInIfStatement() { 9809 void test_breakOutsideOfLoop_breakInIfStatement() {
9744 ParserTestCase.parse5("parseIfStatement", "if (x) {break;}", [ParserErrorCod e.BREAK_OUTSIDE_OF_LOOP]); 9810 ParserTestCase.parse4("parseIfStatement", "if (x) {break;}", [ParserErrorCod e.BREAK_OUTSIDE_OF_LOOP]);
9745 } 9811 }
9746 9812
9747 void test_breakOutsideOfLoop_breakInSwitchStatement() { 9813 void test_breakOutsideOfLoop_breakInSwitchStatement() {
9748 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: break;}", []); 9814 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: break;}", []);
9749 } 9815 }
9750 9816
9751 void test_breakOutsideOfLoop_breakInWhileStatement() { 9817 void test_breakOutsideOfLoop_breakInWhileStatement() {
9752 ParserTestCase.parse5("parseWhileStatement", "while (x) {break;}", []); 9818 ParserTestCase.parse4("parseWhileStatement", "while (x) {break;}", []);
9753 } 9819 }
9754 9820
9755 void test_breakOutsideOfLoop_functionExpression_inALoop() { 9821 void test_breakOutsideOfLoop_functionExpression_inALoop() {
9756 ParserTestCase.parseStatement("for(; x;) {() {break;};}", [ParserErrorCode.B REAK_OUTSIDE_OF_LOOP]); 9822 ParserTestCase.parseStatement("for(; x;) {() {break;};}", [ParserErrorCode.B REAK_OUTSIDE_OF_LOOP]);
9757 } 9823 }
9758 9824
9759 void test_breakOutsideOfLoop_functionExpression_withALoop() { 9825 void test_breakOutsideOfLoop_functionExpression_withALoop() {
9760 ParserTestCase.parseStatement("() {for (; x;) {break;}};", []); 9826 ParserTestCase.parseStatement("() {for (; x;) {break;}};", []);
9761 } 9827 }
9762 9828
9763 void test_constAndFinal() { 9829 void test_constAndFinal() {
9764 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const final int x ;", [ParserErrorCode.CONST_AND_FINAL]); 9830 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const final int x ;", [ParserErrorCode.CONST_AND_FINAL]);
9765 } 9831 }
9766 9832
9767 void test_constAndVar() { 9833 void test_constAndVar() {
9768 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const var x;", [P arserErrorCode.CONST_AND_VAR]); 9834 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const var x;", [P arserErrorCode.CONST_AND_VAR]);
9769 } 9835 }
9770 9836
9771 void test_constClass() { 9837 void test_constClass() {
9772 ParserTestCase.parseCompilationUnit("const class C {}", [ParserErrorCode.CON ST_CLASS]); 9838 ParserTestCase.parseCompilationUnit("const class C {}", [ParserErrorCode.CON ST_CLASS]);
9773 } 9839 }
9774 9840
9775 void test_constConstructorWithBody() { 9841 void test_constConstructorWithBody() {
9776 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const C() {}", [P arserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]); 9842 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const C() {}", [P arserErrorCode.CONST_CONSTRUCTOR_WITH_BODY]);
9777 } 9843 }
9778 9844
9779 void test_constFactory() { 9845 void test_constFactory() {
9780 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const factory C() {}", [ParserErrorCode.CONST_FACTORY]); 9846 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const factory C() {}", [ParserErrorCode.CONST_FACTORY]);
9781 } 9847 }
9782 9848
9783 void test_constMethod() { 9849 void test_constMethod() {
9784 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const int m() {}" , [ParserErrorCode.CONST_METHOD]); 9850 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const int m() {}" , [ParserErrorCode.CONST_METHOD]);
9785 } 9851 }
9786 9852
9787 void test_constructorWithReturnType() { 9853 void test_constructorWithReturnType() {
9788 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "C C() {}", [Parse rErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); 9854 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "C C() {}", [Parse rErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
9789 } 9855 }
9790 9856
9791 void test_constructorWithReturnType_var() { 9857 void test_constructorWithReturnType_var() {
9792 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var C() {}", [Par serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); 9858 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var C() {}", [Par serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]);
9793 } 9859 }
9794 9860
9795 void test_constTypedef() { 9861 void test_constTypedef() {
9796 ParserTestCase.parseCompilationUnit("const typedef F();", [ParserErrorCode.C ONST_TYPEDEF]); 9862 ParserTestCase.parseCompilationUnit("const typedef F();", [ParserErrorCode.C ONST_TYPEDEF]);
9797 } 9863 }
9798 9864
9799 void test_continueOutsideOfLoop_continueInDoStatement() { 9865 void test_continueOutsideOfLoop_continueInDoStatement() {
9800 ParserTestCase.parse5("parseDoStatement", "do {continue;} while (x);", []); 9866 ParserTestCase.parse4("parseDoStatement", "do {continue;} while (x);", []);
9801 } 9867 }
9802 9868
9803 void test_continueOutsideOfLoop_continueInForStatement() { 9869 void test_continueOutsideOfLoop_continueInForStatement() {
9804 ParserTestCase.parse5("parseForStatement", "for (; x;) {continue;}", []); 9870 ParserTestCase.parse4("parseForStatement", "for (; x;) {continue;}", []);
9805 } 9871 }
9806 9872
9807 void test_continueOutsideOfLoop_continueInIfStatement() { 9873 void test_continueOutsideOfLoop_continueInIfStatement() {
9808 ParserTestCase.parse5("parseIfStatement", "if (x) {continue;}", [ParserError Code.CONTINUE_OUTSIDE_OF_LOOP]); 9874 ParserTestCase.parse4("parseIfStatement", "if (x) {continue;}", [ParserError Code.CONTINUE_OUTSIDE_OF_LOOP]);
9809 } 9875 }
9810 9876
9811 void test_continueOutsideOfLoop_continueInSwitchStatement() { 9877 void test_continueOutsideOfLoop_continueInSwitchStatement() {
9812 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []); 9878 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
9813 } 9879 }
9814 9880
9815 void test_continueOutsideOfLoop_continueInWhileStatement() { 9881 void test_continueOutsideOfLoop_continueInWhileStatement() {
9816 ParserTestCase.parse5("parseWhileStatement", "while (x) {continue;}", []); 9882 ParserTestCase.parse4("parseWhileStatement", "while (x) {continue;}", []);
9817 } 9883 }
9818 9884
9819 void test_continueOutsideOfLoop_functionExpression_inALoop() { 9885 void test_continueOutsideOfLoop_functionExpression_inALoop() {
9820 ParserTestCase.parseStatement("for(; x;) {() {continue;};}", [ParserErrorCod e.CONTINUE_OUTSIDE_OF_LOOP]); 9886 ParserTestCase.parseStatement("for(; x;) {() {continue;};}", [ParserErrorCod e.CONTINUE_OUTSIDE_OF_LOOP]);
9821 } 9887 }
9822 9888
9823 void test_continueOutsideOfLoop_functionExpression_withALoop() { 9889 void test_continueOutsideOfLoop_functionExpression_withALoop() {
9824 ParserTestCase.parseStatement("() {for (; x;) {continue;}};", []); 9890 ParserTestCase.parseStatement("() {for (; x;) {continue;}};", []);
9825 } 9891 }
9826 9892
9827 void test_continueWithoutLabelInCase_error() { 9893 void test_continueWithoutLabelInCase_error() {
9828 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue; }", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); 9894 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue; }", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]);
9829 } 9895 }
9830 9896
9831 void test_continueWithoutLabelInCase_noError() { 9897 void test_continueWithoutLabelInCase_noError() {
9832 ParserTestCase.parse5("parseSwitchStatement", "switch (x) {case 1: continue a;}", []); 9898 ParserTestCase.parse4("parseSwitchStatement", "switch (x) {case 1: continue a;}", []);
9833 } 9899 }
9834 9900
9835 void test_continueWithoutLabelInCase_noError_switchInLoop() { 9901 void test_continueWithoutLabelInCase_noError_switchInLoop() {
9836 ParserTestCase.parse5("parseWhileStatement", "while (a) { switch (b) {defaul t: continue;}}", []); 9902 ParserTestCase.parse4("parseWhileStatement", "while (a) { switch (b) {defaul t: continue;}}", []);
9837 } 9903 }
9838 9904
9839 void test_deprecatedClassTypeAlias() { 9905 void test_deprecatedClassTypeAlias() {
9840 ParserTestCase.parseCompilationUnit("typedef C = abstract S with M;", [Parse rErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]); 9906 ParserTestCase.parseCompilationUnit("typedef C = abstract S with M;", [Parse rErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
9841 } 9907 }
9842 9908
9843 void test_deprecatedClassTypeAlias_withGeneric() { 9909 void test_deprecatedClassTypeAlias_withGeneric() {
9844 ParserTestCase.parseCompilationUnit("typedef C<T> = abstract S<T> with M;", [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]); 9910 ParserTestCase.parseCompilationUnit("typedef C<T> = abstract S<T> with M;", [ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS]);
9845 } 9911 }
9846 9912
9847 void test_directiveAfterDeclaration_classBeforeDirective() { 9913 void test_directiveAfterDeclaration_classBeforeDirective() {
9848 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Foo{} libr ary l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); 9914 CompilationUnit unit = ParserTestCase.parseCompilationUnit("class Foo{} libr ary l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
9849 JUnitTestCase.assertNotNull(unit); 9915 JUnitTestCase.assertNotNull(unit);
9850 } 9916 }
9851 9917
9852 void test_directiveAfterDeclaration_classBetweenDirectives() { 9918 void test_directiveAfterDeclaration_classBetweenDirectives() {
9853 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library l;\nclas s Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); 9919 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library l;\nclas s Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]);
9854 JUnitTestCase.assertNotNull(unit); 9920 JUnitTestCase.assertNotNull(unit);
9855 } 9921 }
9856 9922
9857 void test_duplicatedModifier_const() { 9923 void test_duplicatedModifier_const() {
9858 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]); 9924 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const const m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
9859 } 9925 }
9860 9926
9861 void test_duplicatedModifier_external() { 9927 void test_duplicatedModifier_external() {
9862 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]); 9928 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external external f();", [ParserErrorCode.DUPLICATED_MODIFIER]);
9863 } 9929 }
9864 9930
9865 void test_duplicatedModifier_factory() { 9931 void test_duplicatedModifier_factory() {
9866 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory factory C () {}", [ParserErrorCode.DUPLICATED_MODIFIER]); 9932 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory factory C () {}", [ParserErrorCode.DUPLICATED_MODIFIER]);
9867 } 9933 }
9868 9934
9869 void test_duplicatedModifier_final() { 9935 void test_duplicatedModifier_final() {
9870 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]); 9936 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final final m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
9871 } 9937 }
9872 9938
9873 void test_duplicatedModifier_static() { 9939 void test_duplicatedModifier_static() {
9874 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static static var m;", [ParserErrorCode.DUPLICATED_MODIFIER]); 9940 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static static var m;", [ParserErrorCode.DUPLICATED_MODIFIER]);
9875 } 9941 }
9876 9942
9877 void test_duplicatedModifier_var() { 9943 void test_duplicatedModifier_var() {
9878 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var var m;", [Par serErrorCode.DUPLICATED_MODIFIER]); 9944 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var var m;", [Par serErrorCode.DUPLICATED_MODIFIER]);
9879 } 9945 }
9880 9946
9881 void test_duplicateLabelInSwitchStatement() { 9947 void test_duplicateLabelInSwitchStatement() {
9882 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {l1: case 0: break ; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); 9948 ParserTestCase.parse4("parseSwitchStatement", "switch (e) {l1: case 0: break ; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]);
9883 } 9949 }
9884 9950
9885 void test_equalityCannotBeEqualityOperand_eq_eq() { 9951 void test_equalityCannotBeEqualityOperand_eq_eq() {
9886 ParserTestCase.parseExpression("1 == 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]); 9952 ParserTestCase.parseExpression("1 == 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
9887 } 9953 }
9888 9954
9889 void test_equalityCannotBeEqualityOperand_eq_neq() { 9955 void test_equalityCannotBeEqualityOperand_eq_neq() {
9890 ParserTestCase.parseExpression("1 == 2 != 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]); 9956 ParserTestCase.parseExpression("1 == 2 != 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
9891 } 9957 }
9892 9958
9893 void test_equalityCannotBeEqualityOperand_neq_eq() { 9959 void test_equalityCannotBeEqualityOperand_neq_eq() {
9894 ParserTestCase.parseExpression("1 != 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]); 9960 ParserTestCase.parseExpression("1 != 2 == 3", [ParserErrorCode.EQUALITY_CANN OT_BE_EQUALITY_OPERAND]);
9895 } 9961 }
9896 9962
9897 void test_expectedCaseOrDefault() { 9963 void test_expectedCaseOrDefault() {
9898 ParserTestCase.parse5("parseSwitchStatement", "switch (e) {break;}", [Parser ErrorCode.EXPECTED_CASE_OR_DEFAULT]); 9964 ParserTestCase.parse4("parseSwitchStatement", "switch (e) {break;}", [Parser ErrorCode.EXPECTED_CASE_OR_DEFAULT]);
9899 } 9965 }
9900 9966
9901 void test_expectedClassMember_inClass_afterType() { 9967 void test_expectedClassMember_inClass_afterType() {
9902 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "heart 2 heart", [ ParserErrorCode.EXPECTED_CLASS_MEMBER]); 9968 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "heart 2 heart", [ ParserErrorCode.EXPECTED_CLASS_MEMBER]);
9903 } 9969 }
9904 9970
9905 void test_expectedClassMember_inClass_beforeType() { 9971 void test_expectedClassMember_inClass_beforeType() {
9906 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "4 score", [Parser ErrorCode.EXPECTED_CLASS_MEMBER]); 9972 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "4 score", [Parser ErrorCode.EXPECTED_CLASS_MEMBER]);
9907 } 9973 }
9908 9974
9909 void test_expectedExecutable_inClass_afterVoid() { 9975 void test_expectedExecutable_inClass_afterVoid() {
9910 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void 2 void", [Pa rserErrorCode.EXPECTED_EXECUTABLE]); 9976 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void 2 void", [Pa rserErrorCode.EXPECTED_EXECUTABLE]);
9911 } 9977 }
9912 9978
9913 void test_expectedExecutable_topLevel_afterType() { 9979 void test_expectedExecutable_topLevel_afterType() {
9914 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "heart 2 heart", [ParserErrorCode.EXPECTED_EXECUTABLE]); 9980 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "heart 2 heart", [ParserErrorCode.EXPECTED_EXECUTABLE]);
9915 } 9981 }
9916 9982
9917 void test_expectedExecutable_topLevel_afterVoid() { 9983 void test_expectedExecutable_topLevel_afterVoid() {
9918 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]); 9984 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void 2 void", [ParserErrorCode.EXPECTED_EXECUTABLE]);
9919 } 9985 }
9920 9986
9921 void test_expectedExecutable_topLevel_beforeType() { 9987 void test_expectedExecutable_topLevel_beforeType() {
9922 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]); 9988 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "4 score", [ParserErrorCode.EXPECTED_EXECUTABLE]);
9923 } 9989 }
9924 9990
9925 void test_expectedInterpolationIdentifier() { 9991 void test_expectedInterpolationIdentifier() {
9926 ParserTestCase.parse5("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISS ING_IDENTIFIER]); 9992 ParserTestCase.parse4("parseStringLiteral", "'\$x\$'", [ParserErrorCode.MISS ING_IDENTIFIER]);
9927 } 9993 }
9928 9994
9929 void test_expectedStringLiteral() { 9995 void test_expectedStringLiteral() {
9930 StringLiteral expression = ParserTestCase.parse5("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]); 9996 StringLiteral expression = ParserTestCase.parse4("parseStringLiteral", "1", [ParserErrorCode.EXPECTED_STRING_LITERAL]);
9931 JUnitTestCase.assertTrue(expression.isSynthetic); 9997 JUnitTestCase.assertTrue(expression.isSynthetic);
9932 } 9998 }
9933 9999
9934 void test_expectedToken_commaMissingInArgumentList() { 10000 void test_expectedToken_commaMissingInArgumentList() {
9935 ParserTestCase.parse5("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE CTED_TOKEN]); 10001 ParserTestCase.parse4("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE CTED_TOKEN]);
9936 } 10002 }
9937 10003
9938 void test_expectedToken_parseStatement_afterVoid() { 10004 void test_expectedToken_parseStatement_afterVoid() {
9939 ParserTestCase.parseStatement("void}", [ 10005 ParserTestCase.parseStatement("void}", [
9940 ParserErrorCode.EXPECTED_TOKEN, 10006 ParserErrorCode.EXPECTED_TOKEN,
9941 ParserErrorCode.MISSING_IDENTIFIER]); 10007 ParserErrorCode.MISSING_IDENTIFIER]);
9942 } 10008 }
9943 10009
9944 void test_expectedToken_semicolonAfterClass() { 10010 void test_expectedToken_semicolonAfterClass() {
9945 Token token = TokenFactory.token(Keyword.CLASS); 10011 Token token = TokenFactory.token(Keyword.CLASS);
9946 ParserTestCase.parse4("parseClassTypeAlias", <Object> [emptyCommentAndMetada ta(), null, token], "A = B", [ParserErrorCode.EXPECTED_TOKEN]); 10012 ParserTestCase.parse3("parseClassTypeAlias", <Object> [emptyCommentAndMetada ta(), null, token], "A = B", [ParserErrorCode.EXPECTED_TOKEN]);
10013 }
10014
10015 void test_expectedToken_semicolonMissingAfterExport() {
10016 CompilationUnit unit = ParserTestCase.parseCompilationUnit("export '' class A {}", [ParserErrorCode.EXPECTED_TOKEN]);
10017 ExportDirective directive = unit.directives[0] as ExportDirective;
10018 Token semicolon = directive.semicolon;
10019 JUnitTestCase.assertNotNull(semicolon);
10020 JUnitTestCase.assertTrue(semicolon.isSynthetic);
9947 } 10021 }
9948 10022
9949 void test_expectedToken_semicolonMissingAfterExpression() { 10023 void test_expectedToken_semicolonMissingAfterExpression() {
9950 ParserTestCase.parseStatement("x", [ParserErrorCode.EXPECTED_TOKEN]); 10024 ParserTestCase.parseStatement("x", [ParserErrorCode.EXPECTED_TOKEN]);
9951 } 10025 }
9952 10026
10027 void test_expectedToken_semicolonMissingAfterImport() {
10028 CompilationUnit unit = ParserTestCase.parseCompilationUnit("import '' class A {}", [ParserErrorCode.EXPECTED_TOKEN]);
10029 ImportDirective directive = unit.directives[0] as ImportDirective;
10030 Token semicolon = directive.semicolon;
10031 JUnitTestCase.assertNotNull(semicolon);
10032 JUnitTestCase.assertTrue(semicolon.isSynthetic);
10033 }
10034
9953 void test_expectedToken_whileMissingInDoStatement() { 10035 void test_expectedToken_whileMissingInDoStatement() {
9954 ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN] ); 10036 ParserTestCase.parseStatement("do {} (x);", [ParserErrorCode.EXPECTED_TOKEN] );
9955 } 10037 }
9956 10038
9957 void test_expectedTypeName_is() { 10039 void test_expectedTypeName_is() {
9958 ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]) ; 10040 ParserTestCase.parseExpression("x is", [ParserErrorCode.EXPECTED_TYPE_NAME]) ;
9959 } 10041 }
9960 10042
9961 void test_exportDirectiveAfterPartDirective() { 10043 void test_exportDirectiveAfterPartDirective() {
9962 ParserTestCase.parseCompilationUnit("part 'a.dart'; export 'b.dart';", [Pars erErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); 10044 ParserTestCase.parseCompilationUnit("part 'a.dart'; export 'b.dart';", [Pars erErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
9963 } 10045 }
9964 10046
9965 void test_externalAfterConst() { 10047 void test_externalAfterConst() {
9966 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const external C( );", [ParserErrorCode.EXTERNAL_AFTER_CONST]); 10048 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const external C( );", [ParserErrorCode.EXTERNAL_AFTER_CONST]);
9967 } 10049 }
9968 10050
9969 void test_externalAfterFactory() { 10051 void test_externalAfterFactory() {
9970 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); 10052 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory external C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]);
9971 } 10053 }
9972 10054
9973 void test_externalAfterStatic() { 10055 void test_externalAfterStatic() {
9974 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static external i nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); 10056 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static external i nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]);
9975 } 10057 }
9976 10058
9977 void test_externalClass() { 10059 void test_externalClass() {
9978 ParserTestCase.parseCompilationUnit("external class C {}", [ParserErrorCode. EXTERNAL_CLASS]); 10060 ParserTestCase.parseCompilationUnit("external class C {}", [ParserErrorCode. EXTERNAL_CLASS]);
9979 } 10061 }
9980 10062
9981 void test_externalConstructorWithBody_factory() { 10063 void test_externalConstructorWithBody_factory() {
9982 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); 10064 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external factory C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
9983 } 10065 }
9984 10066
9985 void test_externalConstructorWithBody_named() { 10067 void test_externalConstructorWithBody_named() {
9986 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external C.c() {} ", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); 10068 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external C.c() {} ", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]);
9987 } 10069 }
9988 10070
9989 void test_externalField_const() { 10071 void test_externalField_const() {
9990 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]); 10072 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external const A f;", [ParserErrorCode.EXTERNAL_FIELD]);
9991 } 10073 }
9992 10074
9993 void test_externalField_final() { 10075 void test_externalField_final() {
9994 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]); 10076 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external final A f;", [ParserErrorCode.EXTERNAL_FIELD]);
9995 } 10077 }
9996 10078
9997 void test_externalField_static() { 10079 void test_externalField_static() {
9998 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]); 10080 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external static A f;", [ParserErrorCode.EXTERNAL_FIELD]);
9999 } 10081 }
10000 10082
10001 void test_externalField_typed() { 10083 void test_externalField_typed() {
10002 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external A f;", [ ParserErrorCode.EXTERNAL_FIELD]); 10084 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external A f;", [ ParserErrorCode.EXTERNAL_FIELD]);
10003 } 10085 }
10004 10086
10005 void test_externalField_untyped() { 10087 void test_externalField_untyped() {
10006 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]); 10088 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external var f;", [ParserErrorCode.EXTERNAL_FIELD]);
10007 } 10089 }
10008 10090
10009 void test_externalGetterWithBody() { 10091 void test_externalGetterWithBody() {
10010 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); 10092 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external int get x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]);
10011 } 10093 }
10012 10094
10013 void test_externalMethodWithBody() { 10095 void test_externalMethodWithBody() {
10014 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); 10096 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external m() {}", [ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]);
10015 } 10097 }
10016 10098
10017 void test_externalOperatorWithBody() { 10099 void test_externalOperatorWithBody() {
10018 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); 10100 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external operator +(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]);
10019 } 10101 }
10020 10102
10021 void test_externalSetterWithBody() { 10103 void test_externalSetterWithBody() {
10022 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "external set x(in t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); 10104 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "external set x(in t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]);
10023 } 10105 }
10024 10106
10025 void test_externalTypedef() { 10107 void test_externalTypedef() {
10026 ParserTestCase.parseCompilationUnit("external typedef F();", [ParserErrorCod e.EXTERNAL_TYPEDEF]); 10108 ParserTestCase.parseCompilationUnit("external typedef F();", [ParserErrorCod e.EXTERNAL_TYPEDEF]);
10027 } 10109 }
10028 10110
10029 void test_factoryTopLevelDeclaration_class() { 10111 void test_factoryTopLevelDeclaration_class() {
10030 ParserTestCase.parseCompilationUnit("factory class C {}", [ParserErrorCode.F ACTORY_TOP_LEVEL_DECLARATION]); 10112 ParserTestCase.parseCompilationUnit("factory class C {}", [ParserErrorCode.F ACTORY_TOP_LEVEL_DECLARATION]);
10031 } 10113 }
10032 10114
10033 void test_factoryTopLevelDeclaration_typedef() { 10115 void test_factoryTopLevelDeclaration_typedef() {
10034 ParserTestCase.parseCompilationUnit("factory typedef F();", [ParserErrorCode .FACTORY_TOP_LEVEL_DECLARATION]); 10116 ParserTestCase.parseCompilationUnit("factory typedef F();", [ParserErrorCode .FACTORY_TOP_LEVEL_DECLARATION]);
10035 } 10117 }
10036 10118
10037 void test_factoryWithoutBody() { 10119 void test_factoryWithoutBody() {
10038 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory C();", [P arserErrorCode.FACTORY_WITHOUT_BODY]); 10120 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory C();", [P arserErrorCode.FACTORY_WITHOUT_BODY]);
10039 } 10121 }
10040 10122
10041 void test_fieldInitializerOutsideConstructor() { 10123 void test_fieldInitializerOutsideConstructor() {
10042 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); 10124 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void m(this.x);", [ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]);
10043 } 10125 }
10044 10126
10045 void test_finalAndVar() { 10127 void test_finalAndVar() {
10046 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final var x;", [P arserErrorCode.FINAL_AND_VAR]); 10128 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final var x;", [P arserErrorCode.FINAL_AND_VAR]);
10047 } 10129 }
10048 10130
10049 void test_finalClass() { 10131 void test_finalClass() {
10050 ParserTestCase.parseCompilationUnit("final class C {}", [ParserErrorCode.FIN AL_CLASS]); 10132 ParserTestCase.parseCompilationUnit("final class C {}", [ParserErrorCode.FIN AL_CLASS]);
10051 } 10133 }
10052 10134
10053 void test_finalConstructor() { 10135 void test_finalConstructor() {
10054 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final C() {}", [P arserErrorCode.FINAL_CONSTRUCTOR]); 10136 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final C() {}", [P arserErrorCode.FINAL_CONSTRUCTOR]);
10055 } 10137 }
10056 10138
10057 void test_finalMethod() { 10139 void test_finalMethod() {
10058 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final int m() {}" , [ParserErrorCode.FINAL_METHOD]); 10140 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final int m() {}" , [ParserErrorCode.FINAL_METHOD]);
10059 } 10141 }
10060 10142
10061 void test_finalTypedef() { 10143 void test_finalTypedef() {
10062 ParserTestCase.parseCompilationUnit("final typedef F();", [ParserErrorCode.F INAL_TYPEDEF]); 10144 ParserTestCase.parseCompilationUnit("final typedef F();", [ParserErrorCode.F INAL_TYPEDEF]);
10063 } 10145 }
10064 10146
10065 void test_functionTypedParameter_const() { 10147 void test_functionTypedParameter_const() {
10066 ParserTestCase.parseCompilationUnit("void f(const x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]); 10148 ParserTestCase.parseCompilationUnit("void f(const x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]);
10067 } 10149 }
10068 10150
10069 void test_functionTypedParameter_final() { 10151 void test_functionTypedParameter_final() {
10070 ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]); 10152 ParserTestCase.parseCompilationUnit("void f(final x()) {}", [ParserErrorCode .FUNCTION_TYPED_PARAMETER_VAR]);
10071 } 10153 }
10072 10154
10073 void test_functionTypedParameter_var() { 10155 void test_functionTypedParameter_var() {
10074 ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.F UNCTION_TYPED_PARAMETER_VAR]); 10156 ParserTestCase.parseCompilationUnit("void f(var x()) {}", [ParserErrorCode.F UNCTION_TYPED_PARAMETER_VAR]);
10075 } 10157 }
10076 10158
10077 void test_getterInFunction_block() { 10159 void test_getterInFunction_block() {
10078 ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTE R_IN_FUNCTION]); 10160 ParserTestCase.parseStatement("get x { return _x; }", [ParserErrorCode.GETTE R_IN_FUNCTION]);
10079 } 10161 }
10080 10162
10081 void test_getterInFunction_expression() { 10163 void test_getterInFunction_expression() {
10082 ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUN CTION]); 10164 ParserTestCase.parseStatement("get x => _x;", [ParserErrorCode.GETTER_IN_FUN CTION]);
10083 } 10165 }
10084 10166
10085 void test_getterWithParameters() { 10167 void test_getterWithParameters() {
10086 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]); 10168 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int get x() {}", [ParserErrorCode.GETTER_WITH_PARAMETERS]);
10169 }
10170
10171 void test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal() {
10172 ParserTestCase.parseExpression("0--", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]);
10173 }
10174
10175 void test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal() {
10176 ParserTestCase.parseExpression("0++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_TO _NON_ASSIGNABLE]);
10177 }
10178
10179 void test_illegalAssignmentToNonAssignable_postfix_plusPlus_parethesized() {
10180 ParserTestCase.parseExpression("(x)++", [ParserErrorCode.ILLEGAL_ASSIGNMENT_ TO_NON_ASSIGNABLE]);
10181 }
10182
10183 void test_illegalAssignmentToNonAssignable_primarySelectorPostfix() {
10184 ParserTestCase.parseExpression("x(y)(z)++", [ParserErrorCode.ILLEGAL_ASSIGNM ENT_TO_NON_ASSIGNABLE]);
10087 } 10185 }
10088 10186
10089 void test_illegalAssignmentToNonAssignable_superAssigned() { 10187 void test_illegalAssignmentToNonAssignable_superAssigned() {
10090 // TODO(brianwilkerson) When the test fail_illegalAssignmentToNonAssignable_ superAssigned starts 10188 // TODO(brianwilkerson) When the test fail_illegalAssignmentToNonAssignable_ superAssigned starts
10091 // to pass, remove this test (there should only be one error generated, but we're keeping this 10189 // to pass, remove this test (there should only be one error generated, but we're keeping this
10092 // test until that time so that we can catch other forms of regressions). 10190 // test until that time so that we can catch other forms of regressions).
10093 ParserTestCase.parseExpression("super = x;", [ 10191 ParserTestCase.parseExpression("super = x;", [
10094 ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR, 10192 ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR,
10095 ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); 10193 ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]);
10096 } 10194 }
10097 10195
10098 void test_implementsBeforeExtends() { 10196 void test_implementsBeforeExtends() {
10099 ParserTestCase.parseCompilationUnit("class A implements B extends C {}", [Pa rserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); 10197 ParserTestCase.parseCompilationUnit("class A implements B extends C {}", [Pa rserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]);
10100 } 10198 }
10101 10199
10102 void test_implementsBeforeWith() { 10200 void test_implementsBeforeWith() {
10103 ParserTestCase.parseCompilationUnit("class A extends B implements C with D { }", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); 10201 ParserTestCase.parseCompilationUnit("class A extends B implements C with D { }", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]);
10104 } 10202 }
10105 10203
10106 void test_importDirectiveAfterPartDirective() { 10204 void test_importDirectiveAfterPartDirective() {
10107 ParserTestCase.parseCompilationUnit("part 'a.dart'; import 'b.dart';", [Pars erErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); 10205 ParserTestCase.parseCompilationUnit("part 'a.dart'; import 'b.dart';", [Pars erErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]);
10108 } 10206 }
10109 10207
10110 void test_initializedVariableInForEach() { 10208 void test_initializedVariableInForEach() {
10111 ParserTestCase.parse5("parseForStatement", "for (int a = 0 in foo) {}", [Par serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); 10209 ParserTestCase.parse4("parseForStatement", "for (int a = 0 in foo) {}", [Par serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]);
10112 } 10210 }
10113 10211
10114 void test_invalidCodePoint() { 10212 void test_invalidCodePoint() {
10115 ParserTestCase.parse5("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN VALID_CODE_POINT]); 10213 ParserTestCase.parse4("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN VALID_CODE_POINT]);
10116 } 10214 }
10117 10215
10118 void test_invalidHexEscape_invalidDigit() { 10216 void test_invalidHexEscape_invalidDigit() {
10119 ParserTestCase.parse5("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV ALID_HEX_ESCAPE]); 10217 ParserTestCase.parse4("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV ALID_HEX_ESCAPE]);
10120 } 10218 }
10121 10219
10122 void test_invalidHexEscape_tooFewDigits() { 10220 void test_invalidHexEscape_tooFewDigits() {
10123 ParserTestCase.parse5("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL ID_HEX_ESCAPE]); 10221 ParserTestCase.parse4("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL ID_HEX_ESCAPE]);
10124 } 10222 }
10125 10223
10126 void test_invalidInterpolationIdentifier_startWithDigit() { 10224 void test_invalidInterpolationIdentifier_startWithDigit() {
10127 ParserTestCase.parse5("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSIN G_IDENTIFIER]); 10225 ParserTestCase.parse4("parseStringLiteral", "'\$1'", [ParserErrorCode.MISSIN G_IDENTIFIER]);
10128 } 10226 }
10129 10227
10130 void test_invalidOperator() { 10228 void test_invalidOperator() {
10131 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void operator === (x) {}", [ParserErrorCode.INVALID_OPERATOR]); 10229 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void operator === (x) {}", [ParserErrorCode.INVALID_OPERATOR]);
10132 } 10230 }
10133 10231
10134 void test_invalidOperatorForSuper() { 10232 void test_invalidOperatorForSuper() {
10135 ParserTestCase.parse5("parseUnaryExpression", "++super", [ParserErrorCode.IN VALID_OPERATOR_FOR_SUPER]); 10233 ParserTestCase.parse4("parseUnaryExpression", "++super", [ParserErrorCode.IN VALID_OPERATOR_FOR_SUPER]);
10136 } 10234 }
10137 10235
10138 void test_invalidUnicodeEscape_incomplete_noDigits() { 10236 void test_invalidUnicodeEscape_incomplete_noDigits() {
10139 ParserTestCase.parse5("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL ID_UNICODE_ESCAPE]); 10237 ParserTestCase.parse4("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL ID_UNICODE_ESCAPE]);
10140 } 10238 }
10141 10239
10142 void test_invalidUnicodeEscape_incomplete_someDigits() { 10240 void test_invalidUnicodeEscape_incomplete_someDigits() {
10143 ParserTestCase.parse5("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]); 10241 ParserTestCase.parse4("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
10144 } 10242 }
10145 10243
10146 void test_invalidUnicodeEscape_invalidDigit() { 10244 void test_invalidUnicodeEscape_invalidDigit() {
10147 ParserTestCase.parse5("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]); 10245 ParserTestCase.parse4("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV ALID_UNICODE_ESCAPE]);
10148 } 10246 }
10149 10247
10150 void test_invalidUnicodeEscape_tooFewDigits_fixed() { 10248 void test_invalidUnicodeEscape_tooFewDigits_fixed() {
10151 ParserTestCase.parse5("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]); 10249 ParserTestCase.parse4("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
10152 } 10250 }
10153 10251
10154 void test_invalidUnicodeEscape_tooFewDigits_variable() { 10252 void test_invalidUnicodeEscape_tooFewDigits_variable() {
10155 ParserTestCase.parse5("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]); 10253 ParserTestCase.parse4("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA LID_UNICODE_ESCAPE]);
10156 } 10254 }
10157 10255
10158 void test_invalidUnicodeEscape_tooManyDigits_variable() { 10256 void test_invalidUnicodeEscape_tooManyDigits_variable() {
10159 ParserTestCase.parse5("parseStringLiteral", "'\\u{12345678}'", [ 10257 ParserTestCase.parse4("parseStringLiteral", "'\\u{12345678}'", [
10160 ParserErrorCode.INVALID_UNICODE_ESCAPE, 10258 ParserErrorCode.INVALID_UNICODE_ESCAPE,
10161 ParserErrorCode.INVALID_CODE_POINT]); 10259 ParserErrorCode.INVALID_CODE_POINT]);
10162 } 10260 }
10163 10261
10164 void test_libraryDirectiveNotFirst() { 10262 void test_libraryDirectiveNotFirst() {
10165 ParserTestCase.parseCompilationUnit("import 'x.dart'; library l;", [ParserEr rorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); 10263 ParserTestCase.parseCompilationUnit("import 'x.dart'; library l;", [ParserEr rorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
10166 } 10264 }
10167 10265
10168 void test_libraryDirectiveNotFirst_afterPart() { 10266 void test_libraryDirectiveNotFirst_afterPart() {
10169 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part 'a.dart';\n library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); 10267 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part 'a.dart';\n library l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]);
(...skipping 13 matching lines...) Expand all
10183 } 10281 }
10184 10282
10185 void test_localFunctionDeclarationModifier_static() { 10283 void test_localFunctionDeclarationModifier_static() {
10186 ParserTestCase.parseStatement("static f() {}", [ParserErrorCode.LOCAL_FUNCTI ON_DECLARATION_MODIFIER]); 10284 ParserTestCase.parseStatement("static f() {}", [ParserErrorCode.LOCAL_FUNCTI ON_DECLARATION_MODIFIER]);
10187 } 10285 }
10188 10286
10189 void test_missingAssignableSelector_identifiersAssigned() { 10287 void test_missingAssignableSelector_identifiersAssigned() {
10190 ParserTestCase.parseExpression("x.y = y;", []); 10288 ParserTestCase.parseExpression("x.y = y;", []);
10191 } 10289 }
10192 10290
10193 void test_missingAssignableSelector_postfix_minusMinus_literal() {
10194 ParserTestCase.parseExpression("0--", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
10195 }
10196
10197 void test_missingAssignableSelector_postfix_plusPlus_literal() {
10198 ParserTestCase.parseExpression("0++", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
10199 }
10200
10201 void test_missingAssignableSelector_prefix_minusMinus_literal() { 10291 void test_missingAssignableSelector_prefix_minusMinus_literal() {
10202 ParserTestCase.parseExpression("--0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]); 10292 ParserTestCase.parseExpression("--0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
10203 } 10293 }
10204 10294
10205 void test_missingAssignableSelector_prefix_plusPlus_literal() { 10295 void test_missingAssignableSelector_prefix_plusPlus_literal() {
10206 ParserTestCase.parseExpression("++0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]); 10296 ParserTestCase.parseExpression("++0", [ParserErrorCode.MISSING_ASSIGNABLE_SE LECTOR]);
10207 } 10297 }
10208 10298
10209 void test_missingAssignableSelector_primarySelectorPostfix() {
10210 ParserTestCase.parseExpression("x(y)(z)++", [ParserErrorCode.MISSING_ASSIGNA BLE_SELECTOR]);
10211 }
10212
10213 void test_missingAssignableSelector_selector() { 10299 void test_missingAssignableSelector_selector() {
10214 ParserTestCase.parseExpression("x(y)(z).a++", []); 10300 ParserTestCase.parseExpression("x(y)(z).a++", []);
10215 } 10301 }
10216 10302
10217 void test_missingAssignableSelector_superPrimaryExpression() { 10303 void test_missingAssignableSelector_superPrimaryExpression() {
10218 SuperExpression expression = ParserTestCase.parse5("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); 10304 SuperExpression expression = ParserTestCase.parse4("parsePrimaryExpression", "super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]);
10219 JUnitTestCase.assertNotNull(expression.keyword); 10305 JUnitTestCase.assertNotNull(expression.keyword);
10220 } 10306 }
10221 10307
10222 void test_missingAssignableSelector_superPropertyAccessAssigned() { 10308 void test_missingAssignableSelector_superPropertyAccessAssigned() {
10223 ParserTestCase.parseExpression("super.x = x;", []); 10309 ParserTestCase.parseExpression("super.x = x;", []);
10224 } 10310 }
10225 10311
10226 void test_missingCatchOrFinally() { 10312 void test_missingCatchOrFinally() {
10227 TryStatement statement = ParserTestCase.parse5("parseTryStatement", "try {}" , [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); 10313 TryStatement statement = ParserTestCase.parse4("parseTryStatement", "try {}" , [ParserErrorCode.MISSING_CATCH_OR_FINALLY]);
10228 JUnitTestCase.assertNotNull(statement); 10314 JUnitTestCase.assertNotNull(statement);
10229 } 10315 }
10230 10316
10231 void test_missingClassBody() { 10317 void test_missingClassBody() {
10232 ParserTestCase.parseCompilationUnit("class A class B {}", [ParserErrorCode.M ISSING_CLASS_BODY]); 10318 ParserTestCase.parseCompilationUnit("class A class B {}", [ParserErrorCode.M ISSING_CLASS_BODY]);
10233 } 10319 }
10234 10320
10235 void test_missingConstFinalVarOrType_static() { 10321 void test_missingConstFinalVarOrType_static() {
10236 ParserTestCase.parseCompilationUnit("class A { static f; }", [ParserErrorCod e.MISSING_CONST_FINAL_VAR_OR_TYPE]); 10322 ParserTestCase.parseCompilationUnit("class A { static f; }", [ParserErrorCod e.MISSING_CONST_FINAL_VAR_OR_TYPE]);
10237 } 10323 }
10238 10324
10239 void test_missingConstFinalVarOrType_topLevel() { 10325 void test_missingConstFinalVarOrType_topLevel() {
10240 ParserTestCase.parse4("parseFinalConstVarOrType", <Object> [false], "a;", [P arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); 10326 ParserTestCase.parse3("parseFinalConstVarOrType", <Object> [false], "a;", [P arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
10241 } 10327 }
10242 10328
10243 void test_missingExpressionInThrow_withCascade() { 10329 void test_missingExpressionInThrow_withCascade() {
10244 ParserTestCase.parse5("parseThrowExpression", "throw;", [ParserErrorCode.MIS SING_EXPRESSION_IN_THROW]); 10330 ParserTestCase.parse4("parseThrowExpression", "throw;", [ParserErrorCode.MIS SING_EXPRESSION_IN_THROW]);
10245 } 10331 }
10246 10332
10247 void test_missingExpressionInThrow_withoutCascade() { 10333 void test_missingExpressionInThrow_withoutCascade() {
10248 ParserTestCase.parse5("parseThrowExpressionWithoutCascade", "throw;", [Parse rErrorCode.MISSING_EXPRESSION_IN_THROW]); 10334 ParserTestCase.parse4("parseThrowExpressionWithoutCascade", "throw;", [Parse rErrorCode.MISSING_EXPRESSION_IN_THROW]);
10249 } 10335 }
10250 10336
10251 void test_missingFunctionBody_emptyNotAllowed() { 10337 void test_missingFunctionBody_emptyNotAllowed() {
10252 ParserTestCase.parse4("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], ";", [ParserErrorCode.MISSING_FUNCTION_BODY]); 10338 ParserTestCase.parse3("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], ";", [ParserErrorCode.MISSING_FUNCTION_BODY]);
10253 } 10339 }
10254 10340
10255 void test_missingFunctionBody_invalid() { 10341 void test_missingFunctionBody_invalid() {
10256 ParserTestCase.parse4("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BO DY]); 10342 ParserTestCase.parse3("parseFunctionBody", <Object> [false, ParserErrorCode. MISSING_FUNCTION_BODY, false], "return 0;", [ParserErrorCode.MISSING_FUNCTION_BO DY]);
10257 } 10343 }
10258 10344
10259 void test_missingFunctionParameters_local_void_block() { 10345 void test_missingFunctionParameters_local_void_block() {
10260 ParserTestCase.parseStatement("void f { return x;}", [ParserErrorCode.MISSIN G_FUNCTION_PARAMETERS]); 10346 ParserTestCase.parseStatement("void f { return x;}", [ParserErrorCode.MISSIN G_FUNCTION_PARAMETERS]);
10261 } 10347 }
10262 10348
10263 void test_missingFunctionParameters_local_void_expression() { 10349 void test_missingFunctionParameters_local_void_expression() {
10264 ParserTestCase.parseStatement("void f => x;", [ParserErrorCode.MISSING_FUNCT ION_PARAMETERS]); 10350 ParserTestCase.parseStatement("void f => x;", [ParserErrorCode.MISSING_FUNCT ION_PARAMETERS]);
10265 } 10351 }
10266 10352
10267 void test_missingFunctionParameters_topLevel_nonVoid_block() { 10353 void test_missingFunctionParameters_topLevel_nonVoid_block() {
10268 ParserTestCase.parseCompilationUnit("int f { return x;}", [ParserErrorCode.M ISSING_FUNCTION_PARAMETERS]); 10354 ParserTestCase.parseCompilationUnit("int f { return x;}", [ParserErrorCode.M ISSING_FUNCTION_PARAMETERS]);
10269 } 10355 }
10270 10356
10271 void test_missingFunctionParameters_topLevel_nonVoid_expression() { 10357 void test_missingFunctionParameters_topLevel_nonVoid_expression() {
10272 ParserTestCase.parseCompilationUnit("int f => x;", [ParserErrorCode.MISSING_ FUNCTION_PARAMETERS]); 10358 ParserTestCase.parseCompilationUnit("int f => x;", [ParserErrorCode.MISSING_ FUNCTION_PARAMETERS]);
10273 } 10359 }
10274 10360
10275 void test_missingFunctionParameters_topLevel_void_block() { 10361 void test_missingFunctionParameters_topLevel_void_block() {
10276 ParserTestCase.parseCompilationUnit("void f { return x;}", [ParserErrorCode. MISSING_FUNCTION_PARAMETERS]); 10362 ParserTestCase.parseCompilationUnit("void f { return x;}", [ParserErrorCode. MISSING_FUNCTION_PARAMETERS]);
10277 } 10363 }
10278 10364
10279 void test_missingFunctionParameters_topLevel_void_expression() { 10365 void test_missingFunctionParameters_topLevel_void_expression() {
10280 ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]); 10366 ParserTestCase.parseCompilationUnit("void f => x;", [ParserErrorCode.MISSING _FUNCTION_PARAMETERS]);
10281 } 10367 }
10282 10368
10283 void test_missingIdentifier_afterOperator() { 10369 void test_missingIdentifier_afterOperator() {
10284 ParserTestCase.parse5("parseMultiplicativeExpression", "1 *", [ParserErrorCo de.MISSING_IDENTIFIER]); 10370 ParserTestCase.parse4("parseMultiplicativeExpression", "1 *", [ParserErrorCo de.MISSING_IDENTIFIER]);
10285 } 10371 }
10286 10372
10287 void test_missingIdentifier_beforeClosingCurly() { 10373 void test_missingIdentifier_beforeClosingCurly() {
10288 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int}", [ 10374 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int}", [
10289 ParserErrorCode.MISSING_IDENTIFIER, 10375 ParserErrorCode.MISSING_IDENTIFIER,
10290 ParserErrorCode.EXPECTED_TOKEN]); 10376 ParserErrorCode.EXPECTED_TOKEN]);
10291 } 10377 }
10292 10378
10293 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { 10379 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
10294 ParserTestCase.parse5("parseFunctionDeclarationStatement", "A<T> () {}", [Pa rserErrorCode.MISSING_IDENTIFIER]); 10380 ParserTestCase.parse4("parseFunctionDeclarationStatement", "A<T> () {}", [Pa rserErrorCode.MISSING_IDENTIFIER]);
10295 } 10381 }
10296 10382
10297 void test_missingIdentifier_inSymbol_afterPeriod() { 10383 void test_missingIdentifier_inSymbol_afterPeriod() {
10298 ParserTestCase.parse5("parseSymbolLiteral", "#a.", [ParserErrorCode.MISSING_ IDENTIFIER]); 10384 ParserTestCase.parse4("parseSymbolLiteral", "#a.", [ParserErrorCode.MISSING_ IDENTIFIER]);
10299 } 10385 }
10300 10386
10301 void test_missingIdentifier_inSymbol_first() { 10387 void test_missingIdentifier_inSymbol_first() {
10302 ParserTestCase.parse5("parseSymbolLiteral", "#", [ParserErrorCode.MISSING_ID ENTIFIER]); 10388 ParserTestCase.parse4("parseSymbolLiteral", "#", [ParserErrorCode.MISSING_ID ENTIFIER]);
10303 } 10389 }
10304 10390
10305 void test_missingIdentifier_number() { 10391 void test_missingIdentifier_number() {
10306 SimpleIdentifier expression = ParserTestCase.parse5("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]); 10392 SimpleIdentifier expression = ParserTestCase.parse4("parseSimpleIdentifier", "1", [ParserErrorCode.MISSING_IDENTIFIER]);
10307 JUnitTestCase.assertTrue(expression.isSynthetic); 10393 JUnitTestCase.assertTrue(expression.isSynthetic);
10308 } 10394 }
10309 10395
10310 void test_missingKeywordOperator() { 10396 void test_missingKeywordOperator() {
10311 ParserTestCase.parse4("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]); 10397 ParserTestCase.parse3("parseOperator", <Object> [emptyCommentAndMetadata(), null, null], "+(x) {}", [ParserErrorCode.MISSING_KEYWORD_OPERATOR]);
10312 } 10398 }
10313 10399
10314 void test_missingKeywordOperator_parseClassMember() { 10400 void test_missingKeywordOperator_parseClassMember() {
10315 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "+() {}", [ParserE rrorCode.MISSING_KEYWORD_OPERATOR]); 10401 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "+() {}", [ParserE rrorCode.MISSING_KEYWORD_OPERATOR]);
10316 } 10402 }
10317 10403
10318 void test_missingKeywordOperator_parseClassMember_afterTypeName() { 10404 void test_missingKeywordOperator_parseClassMember_afterTypeName() {
10319 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "int +() {}", [Par serErrorCode.MISSING_KEYWORD_OPERATOR]); 10405 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "int +() {}", [Par serErrorCode.MISSING_KEYWORD_OPERATOR]);
10320 } 10406 }
10321 10407
10322 void test_missingKeywordOperator_parseClassMember_afterVoid() { 10408 void test_missingKeywordOperator_parseClassMember_afterVoid() {
10323 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void +() {}", [Pa rserErrorCode.MISSING_KEYWORD_OPERATOR]); 10409 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void +() {}", [Pa rserErrorCode.MISSING_KEYWORD_OPERATOR]);
10324 } 10410 }
10325 10411
10326 void test_missingNameInLibraryDirective() { 10412 void test_missingNameInLibraryDirective() {
10327 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [Pars erErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); 10413 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library;", [Pars erErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]);
10328 JUnitTestCase.assertNotNull(unit); 10414 JUnitTestCase.assertNotNull(unit);
10329 } 10415 }
10330 10416
10331 void test_missingNameInPartOfDirective() { 10417 void test_missingNameInPartOfDirective() {
10332 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [Pars erErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); 10418 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of;", [Pars erErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]);
10333 JUnitTestCase.assertNotNull(unit); 10419 JUnitTestCase.assertNotNull(unit);
10334 } 10420 }
10335 10421
10336 void test_missingStatement() { 10422 void test_missingStatement() {
10337 ParserTestCase.parseStatement("is", [ParserErrorCode.MISSING_STATEMENT]); 10423 ParserTestCase.parseStatement("is", [ParserErrorCode.MISSING_STATEMENT]);
10338 } 10424 }
10339 10425
10340 void test_missingStatement_afterVoid() { 10426 void test_missingStatement_afterVoid() {
10341 ParserTestCase.parseStatement("void;", [ParserErrorCode.MISSING_STATEMENT]); 10427 ParserTestCase.parseStatement("void;", [ParserErrorCode.MISSING_STATEMENT]);
10342 } 10428 }
10343 10429
10344 void test_missingTerminatorForParameterGroup_named() { 10430 void test_missingTerminatorForParameterGroup_named() {
10345 ParserTestCase.parse5("parseFormalParameterList", "(a, {b: 0)", [ParserError Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); 10431 ParserTestCase.parse4("parseFormalParameterList", "(a, {b: 0)", [ParserError Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
10346 } 10432 }
10347 10433
10348 void test_missingTerminatorForParameterGroup_optional() { 10434 void test_missingTerminatorForParameterGroup_optional() {
10349 ParserTestCase.parse5("parseFormalParameterList", "(a, [b = 0)", [ParserErro rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); 10435 ParserTestCase.parse4("parseFormalParameterList", "(a, [b = 0)", [ParserErro rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]);
10350 } 10436 }
10351 10437
10352 void test_missingTypedefParameters_nonVoid() { 10438 void test_missingTypedefParameters_nonVoid() {
10353 ParserTestCase.parseCompilationUnit("typedef int F;", [ParserErrorCode.MISSI NG_TYPEDEF_PARAMETERS]); 10439 ParserTestCase.parseCompilationUnit("typedef int F;", [ParserErrorCode.MISSI NG_TYPEDEF_PARAMETERS]);
10354 } 10440 }
10355 10441
10356 void test_missingTypedefParameters_typeParameters() { 10442 void test_missingTypedefParameters_typeParameters() {
10357 ParserTestCase.parseCompilationUnit("typedef F<E>;", [ParserErrorCode.MISSIN G_TYPEDEF_PARAMETERS]); 10443 ParserTestCase.parseCompilationUnit("typedef F<E>;", [ParserErrorCode.MISSIN G_TYPEDEF_PARAMETERS]);
10358 } 10444 }
10359 10445
10360 void test_missingTypedefParameters_void() { 10446 void test_missingTypedefParameters_void() {
10361 ParserTestCase.parseCompilationUnit("typedef void F;", [ParserErrorCode.MISS ING_TYPEDEF_PARAMETERS]); 10447 ParserTestCase.parseCompilationUnit("typedef void F;", [ParserErrorCode.MISS ING_TYPEDEF_PARAMETERS]);
10362 } 10448 }
10363 10449
10364 void test_missingVariableInForEach() { 10450 void test_missingVariableInForEach() {
10365 ParserTestCase.parse5("parseForStatement", "for (a < b in foo) {}", [ParserE rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); 10451 ParserTestCase.parse4("parseForStatement", "for (a < b in foo) {}", [ParserE rrorCode.MISSING_VARIABLE_IN_FOR_EACH]);
10366 } 10452 }
10367 10453
10368 void test_mixedParameterGroups_namedPositional() { 10454 void test_mixedParameterGroups_namedPositional() {
10369 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, [c])", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]); 10455 ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, [c])", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
10370 } 10456 }
10371 10457
10372 void test_mixedParameterGroups_positionalNamed() { 10458 void test_mixedParameterGroups_positionalNamed() {
10373 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], {c})", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]); 10459 ParserTestCase.parse4("parseFormalParameterList", "(a, [b], {c})", [ParserEr rorCode.MIXED_PARAMETER_GROUPS]);
10374 } 10460 }
10375 10461
10376 void test_multipleExtendsClauses() { 10462 void test_multipleExtendsClauses() {
10377 ParserTestCase.parseCompilationUnit("class A extends B extends C {}", [Parse rErrorCode.MULTIPLE_EXTENDS_CLAUSES]); 10463 ParserTestCase.parseCompilationUnit("class A extends B extends C {}", [Parse rErrorCode.MULTIPLE_EXTENDS_CLAUSES]);
10378 } 10464 }
10379 10465
10380 void test_multipleImplementsClauses() { 10466 void test_multipleImplementsClauses() {
10381 ParserTestCase.parseCompilationUnit("class A implements B implements C {}", [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES]); 10467 ParserTestCase.parseCompilationUnit("class A implements B implements C {}", [ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES]);
10382 } 10468 }
10383 10469
10384 void test_multipleLibraryDirectives() { 10470 void test_multipleLibraryDirectives() {
10385 ParserTestCase.parseCompilationUnit("library l; library m;", [ParserErrorCod e.MULTIPLE_LIBRARY_DIRECTIVES]); 10471 ParserTestCase.parseCompilationUnit("library l; library m;", [ParserErrorCod e.MULTIPLE_LIBRARY_DIRECTIVES]);
10386 } 10472 }
10387 10473
10388 void test_multipleNamedParameterGroups() { 10474 void test_multipleNamedParameterGroups() {
10389 ParserTestCase.parse5("parseFormalParameterList", "(a, {b}, {c})", [ParserEr rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); 10475 ParserTestCase.parse4("parseFormalParameterList", "(a, {b}, {c})", [ParserEr rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]);
10390 } 10476 }
10391 10477
10392 void test_multiplePartOfDirectives() { 10478 void test_multiplePartOfDirectives() {
10393 ParserTestCase.parseCompilationUnit("part of l; part of m;", [ParserErrorCod e.MULTIPLE_PART_OF_DIRECTIVES]); 10479 ParserTestCase.parseCompilationUnit("part of l; part of m;", [ParserErrorCod e.MULTIPLE_PART_OF_DIRECTIVES]);
10394 } 10480 }
10395 10481
10396 void test_multiplePositionalParameterGroups() { 10482 void test_multiplePositionalParameterGroups() {
10397 ParserTestCase.parse5("parseFormalParameterList", "(a, [b], [c])", [ParserEr rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); 10483 ParserTestCase.parse4("parseFormalParameterList", "(a, [b], [c])", [ParserEr rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]);
10398 } 10484 }
10399 10485
10400 void test_multipleVariablesInForEach() { 10486 void test_multipleVariablesInForEach() {
10401 ParserTestCase.parse5("parseForStatement", "for (int a, b in foo) {}", [Pars erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); 10487 ParserTestCase.parse4("parseForStatement", "for (int a, b in foo) {}", [Pars erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]);
10402 } 10488 }
10403 10489
10404 void test_multipleWithClauses() { 10490 void test_multipleWithClauses() {
10405 ParserTestCase.parseCompilationUnit("class A extends B with C with D {}", [P arserErrorCode.MULTIPLE_WITH_CLAUSES]); 10491 ParserTestCase.parseCompilationUnit("class A extends B with C with D {}", [P arserErrorCode.MULTIPLE_WITH_CLAUSES]);
10406 } 10492 }
10407 10493
10408 void test_namedParameterOutsideGroup() { 10494 void test_namedParameterOutsideGroup() {
10409 ParserTestCase.parse5("parseFormalParameterList", "(a, b : 0)", [ParserError Code.NAMED_PARAMETER_OUTSIDE_GROUP]); 10495 ParserTestCase.parse4("parseFormalParameterList", "(a, b : 0)", [ParserError Code.NAMED_PARAMETER_OUTSIDE_GROUP]);
10410 } 10496 }
10411 10497
10412 void test_nonConstructorFactory_field() { 10498 void test_nonConstructorFactory_field() {
10413 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); 10499 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int x;", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
10414 } 10500 }
10415 10501
10416 void test_nonConstructorFactory_method() { 10502 void test_nonConstructorFactory_method() {
10417 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "factory int m() { }", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); 10503 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "factory int m() { }", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]);
10418 } 10504 }
10419 10505
10420 void test_nonIdentifierLibraryName_library() { 10506 void test_nonIdentifierLibraryName_library() {
10421 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); 10507 CompilationUnit unit = ParserTestCase.parseCompilationUnit("library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
10422 JUnitTestCase.assertNotNull(unit); 10508 JUnitTestCase.assertNotNull(unit);
10423 } 10509 }
10424 10510
10425 void test_nonIdentifierLibraryName_partOf() { 10511 void test_nonIdentifierLibraryName_partOf() {
10426 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); 10512 CompilationUnit unit = ParserTestCase.parseCompilationUnit("part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]);
10427 JUnitTestCase.assertNotNull(unit); 10513 JUnitTestCase.assertNotNull(unit);
10428 } 10514 }
10429 10515
10430 void test_nonPartOfDirectiveInPart_after() { 10516 void test_nonPartOfDirectiveInPart_after() {
10431 ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]); 10517 ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]);
10432 } 10518 }
10433 10519
10434 void test_nonPartOfDirectiveInPart_before() { 10520 void test_nonPartOfDirectiveInPart_before() {
10435 ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]); 10521 ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", [ParserErro rCode.NON_PART_OF_DIRECTIVE_IN_PART]);
10436 } 10522 }
10437 10523
10438 void test_nonUserDefinableOperator() { 10524 void test_nonUserDefinableOperator() {
10439 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "operator +=(int x ) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); 10525 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "operator +=(int x ) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]);
10440 } 10526 }
10441 10527
10442 void test_optionalAfterNormalParameters_named() { 10528 void test_optionalAfterNormalParameters_named() {
10443 ParserTestCase.parseCompilationUnit("f({a}, b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]); 10529 ParserTestCase.parseCompilationUnit("f({a}, b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]);
10444 } 10530 }
10445 10531
10446 void test_optionalAfterNormalParameters_positional() { 10532 void test_optionalAfterNormalParameters_positional() {
10447 ParserTestCase.parseCompilationUnit("f([a], b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]); 10533 ParserTestCase.parseCompilationUnit("f([a], b) {}", [ParserErrorCode.NORMAL_ BEFORE_OPTIONAL_PARAMETERS]);
10448 } 10534 }
10449 10535
10450 void test_parseCascadeSection_missingIdentifier() { 10536 void test_parseCascadeSection_missingIdentifier() {
10451 MethodInvocation methodInvocation = ParserTestCase.parse5("parseCascadeSecti on", "..()", [ParserErrorCode.MISSING_IDENTIFIER]); 10537 MethodInvocation methodInvocation = ParserTestCase.parse4("parseCascadeSecti on", "..()", [ParserErrorCode.MISSING_IDENTIFIER]);
10452 JUnitTestCase.assertNull(methodInvocation.target); 10538 JUnitTestCase.assertNull(methodInvocation.target);
10453 JUnitTestCase.assertEquals("", methodInvocation.methodName.name); 10539 JUnitTestCase.assertEquals("", methodInvocation.methodName.name);
10454 EngineTestCase.assertSize(0, methodInvocation.argumentList.arguments); 10540 EngineTestCase.assertSize(0, methodInvocation.argumentList.arguments);
10455 } 10541 }
10456 10542
10457 void test_positionalAfterNamedArgument() { 10543 void test_positionalAfterNamedArgument() {
10458 ParserTestCase.parse5("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS ITIONAL_AFTER_NAMED_ARGUMENT]); 10544 ParserTestCase.parse4("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS ITIONAL_AFTER_NAMED_ARGUMENT]);
10459 } 10545 }
10460 10546
10461 void test_positionalParameterOutsideGroup() { 10547 void test_positionalParameterOutsideGroup() {
10462 ParserTestCase.parse5("parseFormalParameterList", "(a, b = 0)", [ParserError Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); 10548 ParserTestCase.parse4("parseFormalParameterList", "(a, b = 0)", [ParserError Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]);
10463 } 10549 }
10464 10550
10465 void test_redirectionInNonFactoryConstructor() { 10551 void test_redirectionInNonFactoryConstructor() {
10466 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "C() = D;", [Parse rErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR]); 10552 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "C() = D;", [Parse rErrorCode.REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR]);
10467 } 10553 }
10468 10554
10469 void test_setterInFunction_block() { 10555 void test_setterInFunction_block() {
10470 ParserTestCase.parseStatement("set x(v) {_x = v;}", [ParserErrorCode.SETTER_ IN_FUNCTION]); 10556 ParserTestCase.parseStatement("set x(v) {_x = v;}", [ParserErrorCode.SETTER_ IN_FUNCTION]);
10471 } 10557 }
10472 10558
10473 void test_setterInFunction_expression() { 10559 void test_setterInFunction_expression() {
10474 ParserTestCase.parseStatement("set x(v) => _x = v;", [ParserErrorCode.SETTER _IN_FUNCTION]); 10560 ParserTestCase.parseStatement("set x(v) => _x = v;", [ParserErrorCode.SETTER _IN_FUNCTION]);
10475 } 10561 }
10476 10562
10477 void test_staticAfterConst() { 10563 void test_staticAfterConst() {
10478 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]); 10564 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "final static int f;", [ParserErrorCode.STATIC_AFTER_FINAL]);
10479 } 10565 }
10480 10566
10481 void test_staticAfterFinal() { 10567 void test_staticAfterFinal() {
10482 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]); 10568 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "const static int f;", [ParserErrorCode.STATIC_AFTER_CONST]);
10483 } 10569 }
10484 10570
10485 void test_staticAfterVar() { 10571 void test_staticAfterVar() {
10486 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var static f;", [ ParserErrorCode.STATIC_AFTER_VAR]); 10572 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var static f;", [ ParserErrorCode.STATIC_AFTER_VAR]);
10487 } 10573 }
10488 10574
10489 void test_staticConstructor() { 10575 void test_staticConstructor() {
10490 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]); 10576 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static C.m() {}", [ParserErrorCode.STATIC_CONSTRUCTOR]);
10491 } 10577 }
10492 10578
10493 void test_staticGetterWithoutBody() { 10579 void test_staticGetterWithoutBody() {
10494 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static get m;", [ ParserErrorCode.STATIC_GETTER_WITHOUT_BODY]); 10580 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static get m;", [ ParserErrorCode.STATIC_GETTER_WITHOUT_BODY]);
10495 } 10581 }
10496 10582
10497 void test_staticOperator_noReturnType() { 10583 void test_staticOperator_noReturnType() {
10498 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static operator + (int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); 10584 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static operator + (int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
10499 } 10585 }
10500 10586
10501 void test_staticOperator_returnType() { 10587 void test_staticOperator_returnType() {
10502 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static int operat or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); 10588 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static int operat or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]);
10503 } 10589 }
10504 10590
10505 void test_staticSetterWithoutBody() { 10591 void test_staticSetterWithoutBody() {
10506 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "static set m(x);" , [ParserErrorCode.STATIC_SETTER_WITHOUT_BODY]); 10592 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "static set m(x);" , [ParserErrorCode.STATIC_SETTER_WITHOUT_BODY]);
10507 } 10593 }
10508 10594
10509 void test_staticTopLevelDeclaration_class() { 10595 void test_staticTopLevelDeclaration_class() {
10510 ParserTestCase.parseCompilationUnit("static class C {}", [ParserErrorCode.ST ATIC_TOP_LEVEL_DECLARATION]); 10596 ParserTestCase.parseCompilationUnit("static class C {}", [ParserErrorCode.ST ATIC_TOP_LEVEL_DECLARATION]);
10511 } 10597 }
10512 10598
10513 void test_staticTopLevelDeclaration_function() { 10599 void test_staticTopLevelDeclaration_function() {
10514 ParserTestCase.parseCompilationUnit("static f() {}", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]); 10600 ParserTestCase.parseCompilationUnit("static f() {}", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]);
10515 } 10601 }
10516 10602
10517 void test_staticTopLevelDeclaration_typedef() { 10603 void test_staticTopLevelDeclaration_typedef() {
10518 ParserTestCase.parseCompilationUnit("static typedef F();", [ParserErrorCode. STATIC_TOP_LEVEL_DECLARATION]); 10604 ParserTestCase.parseCompilationUnit("static typedef F();", [ParserErrorCode. STATIC_TOP_LEVEL_DECLARATION]);
10519 } 10605 }
10520 10606
10521 void test_staticTopLevelDeclaration_variable() { 10607 void test_staticTopLevelDeclaration_variable() {
10522 ParserTestCase.parseCompilationUnit("static var x;", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]); 10608 ParserTestCase.parseCompilationUnit("static var x;", [ParserErrorCode.STATIC _TOP_LEVEL_DECLARATION]);
10523 } 10609 }
10524 10610
10525 void test_switchHasCaseAfterDefaultCase() { 10611 void test_switchHasCaseAfterDefaultCase() {
10526 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]); 10612 ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1;}", [ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
10527 } 10613 }
10528 10614
10529 void test_switchHasCaseAfterDefaultCase_repeated() { 10615 void test_switchHasCaseAfterDefaultCase_repeated() {
10530 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1; case 2: return 2;}", [ 10616 ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0 ; case 1: return 1; case 2: return 2;}", [
10531 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, 10617 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE,
10532 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]); 10618 ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE]);
10533 } 10619 }
10534 10620
10535 void test_switchHasMultipleDefaultCases() { 10621 void test_switchHasMultipleDefaultCases() {
10536 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]); 10622 ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1;}", [ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
10537 } 10623 }
10538 10624
10539 void test_switchHasMultipleDefaultCases_repeated() { 10625 void test_switchHasMultipleDefaultCases_repeated() {
10540 ParserTestCase.parse5("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1; default: return 2;}", [ 10626 ParserTestCase.parse4("parseSwitchStatement", "switch (a) {default: return 0 ; default: return 1; default: return 2;}", [
10541 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, 10627 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES,
10542 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]); 10628 ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES]);
10543 } 10629 }
10544 10630
10545 void test_topLevelOperator_withoutType() { 10631 void test_topLevelOperator_withoutType() {
10546 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL _OPERATOR]); 10632 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_LEVEL _OPERATOR]);
10547 } 10633 }
10548 10634
10549 void test_topLevelOperator_withType() { 10635 void test_topLevelOperator_withType() {
10550 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "bool operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]); 10636 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "bool operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]);
10551 } 10637 }
10552 10638
10553 void test_topLevelOperator_withVoid() { 10639 void test_topLevelOperator_withVoid() {
10554 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]); 10640 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void operator +(bool x, bool y) => x | y;", [ParserErrorCode.TOP_ LEVEL_OPERATOR]);
10555 } 10641 }
10556 10642
10557 void test_unexpectedTerminatorForParameterGroup_named() { 10643 void test_unexpectedTerminatorForParameterGroup_named() {
10558 ParserTestCase.parse5("parseFormalParameterList", "(a, b})", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); 10644 ParserTestCase.parse4("parseFormalParameterList", "(a, b})", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
10559 } 10645 }
10560 10646
10561 void test_unexpectedTerminatorForParameterGroup_optional() { 10647 void test_unexpectedTerminatorForParameterGroup_optional() {
10562 ParserTestCase.parse5("parseFormalParameterList", "(a, b])", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); 10648 ParserTestCase.parse4("parseFormalParameterList", "(a, b])", [ParserErrorCod e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]);
10563 } 10649 }
10564 10650
10565 void test_unexpectedToken_semicolonBetweenClassMembers() { 10651 void test_unexpectedToken_semicolonBetweenClassMembers() {
10566 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]) ; 10652 ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN]) ;
10567 } 10653 }
10568 10654
10569 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { 10655 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() {
10570 ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEX PECTED_TOKEN]); 10656 ParserTestCase.parseCompilationUnit("int x; ; int y;", [ParserErrorCode.UNEX PECTED_TOKEN]);
10571 } 10657 }
10572 10658
10573 void test_useOfUnaryPlusOperator() { 10659 void test_useOfUnaryPlusOperator() {
10574 SimpleIdentifier expression = ParserTestCase.parse5("parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]); 10660 SimpleIdentifier expression = ParserTestCase.parse4("parseUnaryExpression", "+x", [ParserErrorCode.MISSING_IDENTIFIER]);
10575 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression); 10661 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression);
10576 JUnitTestCase.assertTrue(expression.isSynthetic); 10662 JUnitTestCase.assertTrue(expression.isSynthetic);
10577 } 10663 }
10578 10664
10579 void test_varAndType_field() { 10665 void test_varAndType_field() {
10580 ParserTestCase.parseCompilationUnit("class C { var int x; }", [ParserErrorCo de.VAR_AND_TYPE]); 10666 ParserTestCase.parseCompilationUnit("class C { var int x; }", [ParserErrorCo de.VAR_AND_TYPE]);
10581 } 10667 }
10582 10668
10583 void test_varAndType_topLevelVariable() { 10669 void test_varAndType_topLevelVariable() {
10584 ParserTestCase.parseCompilationUnit("var int x;", [ParserErrorCode.VAR_AND_T YPE]); 10670 ParserTestCase.parseCompilationUnit("var int x;", [ParserErrorCode.VAR_AND_T YPE]);
10585 } 10671 }
10586 10672
10587 void test_varAsTypeName_as() { 10673 void test_varAsTypeName_as() {
10588 ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME ]); 10674 ParserTestCase.parseExpression("x as var", [ParserErrorCode.VAR_AS_TYPE_NAME ]);
10589 } 10675 }
10590 10676
10591 void test_varClass() { 10677 void test_varClass() {
10592 ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_C LASS]); 10678 ParserTestCase.parseCompilationUnit("var class C {}", [ParserErrorCode.VAR_C LASS]);
10593 } 10679 }
10594 10680
10595 void test_varReturnType() { 10681 void test_varReturnType() {
10596 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "var m() {}", [Par serErrorCode.VAR_RETURN_TYPE]); 10682 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "var m() {}", [Par serErrorCode.VAR_RETURN_TYPE]);
10597 } 10683 }
10598 10684
10599 void test_varTypedef() { 10685 void test_varTypedef() {
10600 ParserTestCase.parseCompilationUnit("var typedef F();", [ParserErrorCode.VAR _TYPEDEF]); 10686 ParserTestCase.parseCompilationUnit("var typedef F();", [ParserErrorCode.VAR _TYPEDEF]);
10601 } 10687 }
10602 10688
10603 void test_voidParameter() { 10689 void test_voidParameter() {
10604 ParserTestCase.parse5("parseNormalFormalParameter", "void a)", [ParserErrorC ode.VOID_PARAMETER]); 10690 ParserTestCase.parse4("parseNormalFormalParameter", "void a)", [ParserErrorC ode.VOID_PARAMETER]);
10605 } 10691 }
10606 10692
10607 void test_voidVariable_parseClassMember_initializer() { 10693 void test_voidVariable_parseClassMember_initializer() {
10608 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x = 0;", [Pa rserErrorCode.VOID_VARIABLE]); 10694 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x = 0;", [Pa rserErrorCode.VOID_VARIABLE]);
10609 } 10695 }
10610 10696
10611 void test_voidVariable_parseClassMember_noInitializer() { 10697 void test_voidVariable_parseClassMember_noInitializer() {
10612 ParserTestCase.parse4("parseClassMember", <Object> ["C"], "void x;", [Parser ErrorCode.VOID_VARIABLE]); 10698 ParserTestCase.parse3("parseClassMember", <Object> ["C"], "void x;", [Parser ErrorCode.VOID_VARIABLE]);
10613 } 10699 }
10614 10700
10615 void test_voidVariable_parseCompilationUnit_initializer() { 10701 void test_voidVariable_parseCompilationUnit_initializer() {
10616 ParserTestCase.parseCompilationUnit("void x = 0;", [ParserErrorCode.VOID_VAR IABLE]); 10702 ParserTestCase.parseCompilationUnit("void x = 0;", [ParserErrorCode.VOID_VAR IABLE]);
10617 } 10703 }
10618 10704
10619 void test_voidVariable_parseCompilationUnit_noInitializer() { 10705 void test_voidVariable_parseCompilationUnit_noInitializer() {
10620 ParserTestCase.parseCompilationUnit("void x;", [ParserErrorCode.VOID_VARIABL E]); 10706 ParserTestCase.parseCompilationUnit("void x;", [ParserErrorCode.VOID_VARIABL E]);
10621 } 10707 }
10622 10708
10623 void test_voidVariable_parseCompilationUnitMember_initializer() { 10709 void test_voidVariable_parseCompilationUnitMember_initializer() {
10624 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a = 0;", [ParserErrorCode.VOID_VARIABLE]); 10710 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a = 0;", [ParserErrorCode.VOID_VARIABLE]);
10625 } 10711 }
10626 10712
10627 void test_voidVariable_parseCompilationUnitMember_noInitializer() { 10713 void test_voidVariable_parseCompilationUnitMember_noInitializer() {
10628 ParserTestCase.parse4("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a;", [ParserErrorCode.VOID_VARIABLE]); 10714 ParserTestCase.parse3("parseCompilationUnitMember", <Object> [emptyCommentAn dMetadata()], "void a;", [ParserErrorCode.VOID_VARIABLE]);
10629 } 10715 }
10630 10716
10631 void test_voidVariable_statement_initializer() { 10717 void test_voidVariable_statement_initializer() {
10632 ParserTestCase.parseStatement("void x = 0;", [ 10718 ParserTestCase.parseStatement("void x = 0;", [
10633 ParserErrorCode.VOID_VARIABLE, 10719 ParserErrorCode.VOID_VARIABLE,
10634 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); 10720 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
10635 } 10721 }
10636 10722
10637 void test_voidVariable_statement_noInitializer() { 10723 void test_voidVariable_statement_noInitializer() {
10638 ParserTestCase.parseStatement("void x;", [ 10724 ParserTestCase.parseStatement("void x;", [
10639 ParserErrorCode.VOID_VARIABLE, 10725 ParserErrorCode.VOID_VARIABLE,
10640 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); 10726 ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]);
10641 } 10727 }
10642 10728
10643 void test_withBeforeExtends() { 10729 void test_withBeforeExtends() {
10644 ParserTestCase.parseCompilationUnit("class A with B extends C {}", [ParserEr rorCode.WITH_BEFORE_EXTENDS]); 10730 ParserTestCase.parseCompilationUnit("class A with B extends C {}", [ParserEr rorCode.WITH_BEFORE_EXTENDS]);
10645 } 10731 }
10646 10732
10647 void test_withWithoutExtends() { 10733 void test_withWithoutExtends() {
10648 ParserTestCase.parse4("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); 10734 ParserTestCase.parse3("parseClassDeclaration", <Object> [emptyCommentAndMeta data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]);
10649 } 10735 }
10650 10736
10651 void test_wrongSeparatorForNamedParameter() { 10737 void test_wrongSeparatorForNamedParameter() {
10652 ParserTestCase.parse5("parseFormalParameterList", "(a, {b = 0})", [ParserErr orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); 10738 ParserTestCase.parse4("parseFormalParameterList", "(a, {b = 0})", [ParserErr orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]);
10653 } 10739 }
10654 10740
10655 void test_wrongSeparatorForPositionalParameter() { 10741 void test_wrongSeparatorForPositionalParameter() {
10656 ParserTestCase.parse5("parseFormalParameterList", "(a, [b : 0])", [ParserErr orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); 10742 ParserTestCase.parse4("parseFormalParameterList", "(a, [b : 0])", [ParserErr orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]);
10657 } 10743 }
10658 10744
10659 void test_wrongTerminatorForParameterGroup_named() { 10745 void test_wrongTerminatorForParameterGroup_named() {
10660 ParserTestCase.parse5("parseFormalParameterList", "(a, {b, c])", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); 10746 ParserTestCase.parse4("parseFormalParameterList", "(a, {b, c])", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
10661 } 10747 }
10662 10748
10663 void test_wrongTerminatorForParameterGroup_optional() { 10749 void test_wrongTerminatorForParameterGroup_optional() {
10664 ParserTestCase.parse5("parseFormalParameterList", "(a, [b, c})", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); 10750 ParserTestCase.parse4("parseFormalParameterList", "(a, [b, c})", [ParserErro rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]);
10665 } 10751 }
10666 10752
10667 static dartSuite() { 10753 static dartSuite() {
10668 _ut.group('ErrorParserTest', () { 10754 _ut.group('ErrorParserTest', () {
10669 _ut.test('test_abstractClassMember_constructor', () { 10755 _ut.test('test_abstractClassMember_constructor', () {
10670 final __test = new ErrorParserTest(); 10756 final __test = new ErrorParserTest();
10671 runJUnitTest(__test, __test.test_abstractClassMember_constructor); 10757 runJUnitTest(__test, __test.test_abstractClassMember_constructor);
10672 }); 10758 });
10673 _ut.test('test_abstractClassMember_field', () { 10759 _ut.test('test_abstractClassMember_field', () {
10674 final __test = new ErrorParserTest(); 10760 final __test = new ErrorParserTest();
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
10923 runJUnitTest(__test, __test.test_expectedToken_commaMissingInArgumentLis t); 11009 runJUnitTest(__test, __test.test_expectedToken_commaMissingInArgumentLis t);
10924 }); 11010 });
10925 _ut.test('test_expectedToken_parseStatement_afterVoid', () { 11011 _ut.test('test_expectedToken_parseStatement_afterVoid', () {
10926 final __test = new ErrorParserTest(); 11012 final __test = new ErrorParserTest();
10927 runJUnitTest(__test, __test.test_expectedToken_parseStatement_afterVoid) ; 11013 runJUnitTest(__test, __test.test_expectedToken_parseStatement_afterVoid) ;
10928 }); 11014 });
10929 _ut.test('test_expectedToken_semicolonAfterClass', () { 11015 _ut.test('test_expectedToken_semicolonAfterClass', () {
10930 final __test = new ErrorParserTest(); 11016 final __test = new ErrorParserTest();
10931 runJUnitTest(__test, __test.test_expectedToken_semicolonAfterClass); 11017 runJUnitTest(__test, __test.test_expectedToken_semicolonAfterClass);
10932 }); 11018 });
11019 _ut.test('test_expectedToken_semicolonMissingAfterExport', () {
11020 final __test = new ErrorParserTest();
11021 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterExpo rt);
11022 });
10933 _ut.test('test_expectedToken_semicolonMissingAfterExpression', () { 11023 _ut.test('test_expectedToken_semicolonMissingAfterExpression', () {
10934 final __test = new ErrorParserTest(); 11024 final __test = new ErrorParserTest();
10935 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterExpr ession); 11025 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterExpr ession);
10936 }); 11026 });
11027 _ut.test('test_expectedToken_semicolonMissingAfterImport', () {
11028 final __test = new ErrorParserTest();
11029 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterImpo rt);
11030 });
10937 _ut.test('test_expectedToken_whileMissingInDoStatement', () { 11031 _ut.test('test_expectedToken_whileMissingInDoStatement', () {
10938 final __test = new ErrorParserTest(); 11032 final __test = new ErrorParserTest();
10939 runJUnitTest(__test, __test.test_expectedToken_whileMissingInDoStatement ); 11033 runJUnitTest(__test, __test.test_expectedToken_whileMissingInDoStatement );
10940 }); 11034 });
10941 _ut.test('test_expectedTypeName_is', () { 11035 _ut.test('test_expectedTypeName_is', () {
10942 final __test = new ErrorParserTest(); 11036 final __test = new ErrorParserTest();
10943 runJUnitTest(__test, __test.test_expectedTypeName_is); 11037 runJUnitTest(__test, __test.test_expectedTypeName_is);
10944 }); 11038 });
10945 _ut.test('test_exportDirectiveAfterPartDirective', () { 11039 _ut.test('test_exportDirectiveAfterPartDirective', () {
10946 final __test = new ErrorParserTest(); 11040 final __test = new ErrorParserTest();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
11063 runJUnitTest(__test, __test.test_getterInFunction_block); 11157 runJUnitTest(__test, __test.test_getterInFunction_block);
11064 }); 11158 });
11065 _ut.test('test_getterInFunction_expression', () { 11159 _ut.test('test_getterInFunction_expression', () {
11066 final __test = new ErrorParserTest(); 11160 final __test = new ErrorParserTest();
11067 runJUnitTest(__test, __test.test_getterInFunction_expression); 11161 runJUnitTest(__test, __test.test_getterInFunction_expression);
11068 }); 11162 });
11069 _ut.test('test_getterWithParameters', () { 11163 _ut.test('test_getterWithParameters', () {
11070 final __test = new ErrorParserTest(); 11164 final __test = new ErrorParserTest();
11071 runJUnitTest(__test, __test.test_getterWithParameters); 11165 runJUnitTest(__test, __test.test_getterWithParameters);
11072 }); 11166 });
11167 _ut.test('test_illegalAssignmentToNonAssignable_postfix_minusMinus_literal ', () {
11168 final __test = new ErrorParserTest();
11169 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_postfi x_minusMinus_literal);
11170 });
11171 _ut.test('test_illegalAssignmentToNonAssignable_postfix_plusPlus_literal', () {
11172 final __test = new ErrorParserTest();
11173 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_postfi x_plusPlus_literal);
11174 });
11175 _ut.test('test_illegalAssignmentToNonAssignable_postfix_plusPlus_parethesi zed', () {
11176 final __test = new ErrorParserTest();
11177 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_postfi x_plusPlus_parethesized);
11178 });
11179 _ut.test('test_illegalAssignmentToNonAssignable_primarySelectorPostfix', ( ) {
11180 final __test = new ErrorParserTest();
11181 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_primar ySelectorPostfix);
11182 });
11073 _ut.test('test_illegalAssignmentToNonAssignable_superAssigned', () { 11183 _ut.test('test_illegalAssignmentToNonAssignable_superAssigned', () {
11074 final __test = new ErrorParserTest(); 11184 final __test = new ErrorParserTest();
11075 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_superA ssigned); 11185 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_superA ssigned);
11076 }); 11186 });
11077 _ut.test('test_implementsBeforeExtends', () { 11187 _ut.test('test_implementsBeforeExtends', () {
11078 final __test = new ErrorParserTest(); 11188 final __test = new ErrorParserTest();
11079 runJUnitTest(__test, __test.test_implementsBeforeExtends); 11189 runJUnitTest(__test, __test.test_implementsBeforeExtends);
11080 }); 11190 });
11081 _ut.test('test_implementsBeforeWith', () { 11191 _ut.test('test_implementsBeforeWith', () {
11082 final __test = new ErrorParserTest(); 11192 final __test = new ErrorParserTest();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
11159 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_factor y); 11269 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_factor y);
11160 }); 11270 });
11161 _ut.test('test_localFunctionDeclarationModifier_static', () { 11271 _ut.test('test_localFunctionDeclarationModifier_static', () {
11162 final __test = new ErrorParserTest(); 11272 final __test = new ErrorParserTest();
11163 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_static ); 11273 runJUnitTest(__test, __test.test_localFunctionDeclarationModifier_static );
11164 }); 11274 });
11165 _ut.test('test_missingAssignableSelector_identifiersAssigned', () { 11275 _ut.test('test_missingAssignableSelector_identifiersAssigned', () {
11166 final __test = new ErrorParserTest(); 11276 final __test = new ErrorParserTest();
11167 runJUnitTest(__test, __test.test_missingAssignableSelector_identifiersAs signed); 11277 runJUnitTest(__test, __test.test_missingAssignableSelector_identifiersAs signed);
11168 }); 11278 });
11169 _ut.test('test_missingAssignableSelector_postfix_minusMinus_literal', () {
11170 final __test = new ErrorParserTest();
11171 runJUnitTest(__test, __test.test_missingAssignableSelector_postfix_minus Minus_literal);
11172 });
11173 _ut.test('test_missingAssignableSelector_postfix_plusPlus_literal', () {
11174 final __test = new ErrorParserTest();
11175 runJUnitTest(__test, __test.test_missingAssignableSelector_postfix_plusP lus_literal);
11176 });
11177 _ut.test('test_missingAssignableSelector_prefix_minusMinus_literal', () { 11279 _ut.test('test_missingAssignableSelector_prefix_minusMinus_literal', () {
11178 final __test = new ErrorParserTest(); 11280 final __test = new ErrorParserTest();
11179 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_minusM inus_literal); 11281 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_minusM inus_literal);
11180 }); 11282 });
11181 _ut.test('test_missingAssignableSelector_prefix_plusPlus_literal', () { 11283 _ut.test('test_missingAssignableSelector_prefix_plusPlus_literal', () {
11182 final __test = new ErrorParserTest(); 11284 final __test = new ErrorParserTest();
11183 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_plusPl us_literal); 11285 runJUnitTest(__test, __test.test_missingAssignableSelector_prefix_plusPl us_literal);
11184 }); 11286 });
11185 _ut.test('test_missingAssignableSelector_primarySelectorPostfix', () {
11186 final __test = new ErrorParserTest();
11187 runJUnitTest(__test, __test.test_missingAssignableSelector_primarySelect orPostfix);
11188 });
11189 _ut.test('test_missingAssignableSelector_selector', () { 11287 _ut.test('test_missingAssignableSelector_selector', () {
11190 final __test = new ErrorParserTest(); 11288 final __test = new ErrorParserTest();
11191 runJUnitTest(__test, __test.test_missingAssignableSelector_selector); 11289 runJUnitTest(__test, __test.test_missingAssignableSelector_selector);
11192 }); 11290 });
11193 _ut.test('test_missingAssignableSelector_superPrimaryExpression', () { 11291 _ut.test('test_missingAssignableSelector_superPrimaryExpression', () {
11194 final __test = new ErrorParserTest(); 11292 final __test = new ErrorParserTest();
11195 runJUnitTest(__test, __test.test_missingAssignableSelector_superPrimaryE xpression); 11293 runJUnitTest(__test, __test.test_missingAssignableSelector_superPrimaryE xpression);
11196 }); 11294 });
11197 _ut.test('test_missingAssignableSelector_superPropertyAccessAssigned', () { 11295 _ut.test('test_missingAssignableSelector_superPropertyAccessAssigned', () {
11198 final __test = new ErrorParserTest(); 11296 final __test = new ErrorParserTest();
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
11669 'advance_0': new MethodTrampoline(0, (Parser target) => target.advance()), 11767 'advance_0': new MethodTrampoline(0, (Parser target) => target.advance()),
11670 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg 2, arg3, arg4) => target.appendScalarValue(arg0, arg1, arg2, arg3, arg4)), 11768 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg 2, arg3, arg4) => target.appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
11671 'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.computeStringValue(arg0, arg1, arg2)), 11769 'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar g2) => target.computeStringValue(arg0, arg1, arg2)),
11672 'convertToFunctionDeclaration_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.convertToFunctionDeclaration(arg0)), 11770 'convertToFunctionDeclaration_1': new MethodTrampoline(1, (Parser target, arg0 ) => target.convertToFunctionDeclaration(arg0)),
11673 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe t) => target.couldBeStartOfCompilationUnitMember()), 11771 'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(0, (Parser targe t) => target.couldBeStartOfCompilationUnitMember()),
11674 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ et.createSyntheticIdentifier()), 11772 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ et.createSyntheticIdentifier()),
11675 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t arget.createSyntheticStringLiteral()), 11773 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t arget.createSyntheticStringLiteral()),
11676 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.createSyntheticToken(arg0)), 11774 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.createSyntheticToken(arg0)),
11677 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target. ensureAssignable(arg0)), 11775 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target. ensureAssignable(arg0)),
11678 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg 0)), 11776 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg 0)),
11777 'expectSemicolon_0': new MethodTrampoline(0, (Parser target) => target.expectS emicolon()),
11679 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f indRange(arg0, arg1)), 11778 'findRange_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.f indRange(arg0, arg1)),
11680 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.getCodeBlockRanges(arg0)), 11779 'getCodeBlockRanges_1': new MethodTrampoline(1, (Parser target, arg0) => targe t.getCodeBlockRanges(arg0)),
11681 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn dToken(arg0)), 11780 'getEndToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.getEn dToken(arg0)),
11682 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe t.hasReturnTypeInTypeAlias()), 11781 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe t.hasReturnTypeInTypeAlias()),
11683 'injectToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.injec tToken(arg0)), 11782 'injectToken_1': new MethodTrampoline(1, (Parser target, arg0) => target.injec tToken(arg0)),
11684 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i sFunctionDeclaration()), 11783 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i sFunctionDeclaration()),
11685 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.isFunctionExpression(arg0)), 11784 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar get.isFunctionExpression(arg0)),
11686 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD igit(arg0)), 11785 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD igit(arg0)),
11687 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isInitializedVariableDeclaration()), 11786 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => target.isInitializedVariableDeclaration()),
11688 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. isLinkText(arg0, arg1)), 11787 'isLinkText_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target. isLinkText(arg0, arg1)),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
11809 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), 11908 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelFunction(arg0)),
11810 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), 11909 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ et, arg0) => target.validateModifiersForTopLevelVariable(arg0)),
11811 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),}; 11910 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0) => target.validateModifiersForTypedef(arg0)),};
11812 11911
11813 11912
11814 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) { 11913 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj ects, Token tokenStream) {
11815 parser.currentToken = tokenStream; 11914 parser.currentToken = tokenStream;
11816 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} ']; 11915 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length} '];
11817 return method.invoke(parser, objects); 11916 return method.invoke(parser, objects);
11818 } 11917 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698