| OLD | NEW |
| 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.testing.ast_factory; | 8 library engine.testing.ast_factory; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 static IndexExpression cascadedIndexExpression(Expression index) => | 106 static IndexExpression cascadedIndexExpression(Expression index) => |
| 107 new IndexExpression.forCascade( | 107 new IndexExpression.forCascade( |
| 108 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), | 108 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), |
| 109 TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, | 109 TokenFactory.tokenFromType(TokenType.OPEN_SQUARE_BRACKET), index, |
| 110 TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET)); | 110 TokenFactory.tokenFromType(TokenType.CLOSE_SQUARE_BRACKET)); |
| 111 | 111 |
| 112 static MethodInvocation cascadedMethodInvocation(String methodName, | 112 static MethodInvocation cascadedMethodInvocation(String methodName, |
| 113 [List<Expression> arguments]) => new MethodInvocation(null, | 113 [List<Expression> arguments]) => new MethodInvocation(null, |
| 114 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), | 114 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), |
| 115 identifier3(methodName), argumentList(arguments)); | 115 identifier3(methodName), null, argumentList(arguments)); |
| 116 | 116 |
| 117 static PropertyAccess cascadedPropertyAccess(String propertyName) => | 117 static PropertyAccess cascadedPropertyAccess(String propertyName) => |
| 118 new PropertyAccess(null, | 118 new PropertyAccess(null, |
| 119 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), | 119 TokenFactory.tokenFromType(TokenType.PERIOD_PERIOD), |
| 120 identifier3(propertyName)); | 120 identifier3(propertyName)); |
| 121 | 121 |
| 122 static CascadeExpression cascadeExpression(Expression target, | 122 static CascadeExpression cascadeExpression(Expression target, |
| 123 [List<Expression> cascadeSections]) => | 123 [List<Expression> cascadeSections]) => |
| 124 new CascadeExpression(target, cascadeSections); | 124 new CascadeExpression(target, cascadeSections); |
| 125 | 125 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, | 355 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, |
| 356 List<VariableDeclaration> variables) => | 356 List<VariableDeclaration> variables) => |
| 357 fieldDeclaration(isStatic, keyword, null, variables); | 357 fieldDeclaration(isStatic, keyword, null, variables); |
| 358 | 358 |
| 359 static FieldFormalParameter fieldFormalParameter( | 359 static FieldFormalParameter fieldFormalParameter( |
| 360 Keyword keyword, TypeName type, String identifier, | 360 Keyword keyword, TypeName type, String identifier, |
| 361 [FormalParameterList parameterList]) => new FieldFormalParameter(null, | 361 [FormalParameterList parameterList]) => new FieldFormalParameter(null, |
| 362 null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), | 362 null, keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), |
| 363 type, TokenFactory.tokenFromKeyword(Keyword.THIS), | 363 type, TokenFactory.tokenFromKeyword(Keyword.THIS), |
| 364 TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(identifier), | 364 TokenFactory.tokenFromType(TokenType.PERIOD), identifier3(identifier), |
| 365 parameterList); | 365 null, parameterList); |
| 366 | 366 |
| 367 static FieldFormalParameter fieldFormalParameter2(String identifier) => | 367 static FieldFormalParameter fieldFormalParameter2(String identifier) => |
| 368 fieldFormalParameter(null, null, identifier); | 368 fieldFormalParameter(null, null, identifier); |
| 369 | 369 |
| 370 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, | 370 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, |
| 371 Expression iterator, Statement body) => | 371 Expression iterator, Statement body) => |
| 372 new ForEachStatement.withDeclaration(null, | 372 new ForEachStatement.withDeclaration(null, |
| 373 TokenFactory.tokenFromKeyword(Keyword.FOR), | 373 TokenFactory.tokenFromKeyword(Keyword.FOR), |
| 374 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), loopVariable, | 374 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), loopVariable, |
| 375 TokenFactory.tokenFromKeyword(Keyword.IN), iterator, | 375 TokenFactory.tokenFromKeyword(Keyword.IN), iterator, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), | 410 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), |
| 411 identifier3(name), functionExpression); | 411 identifier3(name), functionExpression); |
| 412 | 412 |
| 413 static FunctionDeclarationStatement functionDeclarationStatement( | 413 static FunctionDeclarationStatement functionDeclarationStatement( |
| 414 TypeName type, Keyword keyword, String name, | 414 TypeName type, Keyword keyword, String name, |
| 415 FunctionExpression functionExpression) => | 415 FunctionExpression functionExpression) => |
| 416 new FunctionDeclarationStatement( | 416 new FunctionDeclarationStatement( |
| 417 functionDeclaration(type, keyword, name, functionExpression)); | 417 functionDeclaration(type, keyword, name, functionExpression)); |
| 418 | 418 |
| 419 static FunctionExpression functionExpression() => | 419 static FunctionExpression functionExpression() => |
| 420 new FunctionExpression(formalParameterList(), blockFunctionBody2()); | 420 new FunctionExpression(null, formalParameterList(), blockFunctionBody2()); |
| 421 | 421 |
| 422 static FunctionExpression functionExpression2( | 422 static FunctionExpression functionExpression2( |
| 423 FormalParameterList parameters, FunctionBody body) => | 423 FormalParameterList parameters, FunctionBody body) => |
| 424 new FunctionExpression(parameters, body); | 424 new FunctionExpression(null, parameters, body); |
| 425 |
| 426 static FunctionExpression functionExpression3( |
| 427 TypeParameterList typeParameters, FormalParameterList parameters, |
| 428 FunctionBody body) => |
| 429 new FunctionExpression(typeParameters, parameters, body); |
| 425 | 430 |
| 426 static FunctionExpressionInvocation functionExpressionInvocation( | 431 static FunctionExpressionInvocation functionExpressionInvocation( |
| 427 Expression function, [List<Expression> arguments]) => | 432 Expression function, [List<Expression> arguments]) => |
| 428 new FunctionExpressionInvocation(function, argumentList(arguments)); | 433 functionExpressionInvocation2(function, null, arguments); |
| 434 |
| 435 static FunctionExpressionInvocation functionExpressionInvocation2( |
| 436 Expression function, |
| 437 [TypeArgumentList typeArguments, List<Expression> arguments]) => |
| 438 new FunctionExpressionInvocation( |
| 439 function, typeArguments, argumentList(arguments)); |
| 429 | 440 |
| 430 static FunctionTypedFormalParameter functionTypedFormalParameter( | 441 static FunctionTypedFormalParameter functionTypedFormalParameter( |
| 431 TypeName returnType, String identifier, | 442 TypeName returnType, String identifier, |
| 432 [List<FormalParameter> parameters]) => new FunctionTypedFormalParameter( | 443 [List<FormalParameter> parameters]) => new FunctionTypedFormalParameter( |
| 433 null, null, returnType, identifier3(identifier), | 444 null, null, returnType, identifier3(identifier), null, |
| 434 formalParameterList(parameters)); | 445 formalParameterList(parameters)); |
| 435 | 446 |
| 436 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => | 447 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => |
| 437 new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers); | 448 new HideCombinator(TokenFactory.tokenFromString("hide"), identifiers); |
| 438 | 449 |
| 439 static HideCombinator hideCombinator2(List<String> identifiers) => | 450 static HideCombinator hideCombinator2(List<String> identifiers) => |
| 440 new HideCombinator( | 451 new HideCombinator( |
| 441 TokenFactory.tokenFromString("hide"), identifierList(identifiers)); | 452 TokenFactory.tokenFromString("hide"), identifierList(identifiers)); |
| 442 | 453 |
| 443 static PrefixedIdentifier identifier( | 454 static PrefixedIdentifier identifier( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 614 |
| 604 static MethodDeclaration methodDeclaration(Keyword modifier, | 615 static MethodDeclaration methodDeclaration(Keyword modifier, |
| 605 TypeName returnType, Keyword property, Keyword operator, | 616 TypeName returnType, Keyword property, Keyword operator, |
| 606 SimpleIdentifier name, | 617 SimpleIdentifier name, |
| 607 FormalParameterList parameters) => new MethodDeclaration(null, null, | 618 FormalParameterList parameters) => new MethodDeclaration(null, null, |
| 608 TokenFactory.tokenFromKeyword(Keyword.EXTERNAL), | 619 TokenFactory.tokenFromKeyword(Keyword.EXTERNAL), |
| 609 modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), | 620 modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), |
| 610 returnType, | 621 returnType, |
| 611 property == null ? null : TokenFactory.tokenFromKeyword(property), | 622 property == null ? null : TokenFactory.tokenFromKeyword(property), |
| 612 operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, | 623 operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, |
| 613 parameters, emptyFunctionBody()); | 624 null, parameters, emptyFunctionBody()); |
| 614 | 625 |
| 615 static MethodDeclaration methodDeclaration2(Keyword modifier, | 626 static MethodDeclaration methodDeclaration2(Keyword modifier, |
| 616 TypeName returnType, Keyword property, Keyword operator, | 627 TypeName returnType, Keyword property, Keyword operator, |
| 617 SimpleIdentifier name, FormalParameterList parameters, | 628 SimpleIdentifier name, FormalParameterList parameters, |
| 618 FunctionBody body) => new MethodDeclaration(null, null, null, | 629 FunctionBody body) => new MethodDeclaration(null, null, null, |
| 619 modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), | 630 modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), |
| 620 returnType, | 631 returnType, |
| 621 property == null ? null : TokenFactory.tokenFromKeyword(property), | 632 property == null ? null : TokenFactory.tokenFromKeyword(property), |
| 622 operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, | 633 operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, |
| 623 parameters, body); | 634 null, parameters, body); |
| 635 |
| 636 static MethodDeclaration methodDeclaration3(Keyword modifier, |
| 637 TypeName returnType, Keyword property, Keyword operator, |
| 638 SimpleIdentifier name, TypeParameterList typeParameters, |
| 639 FormalParameterList parameters, |
| 640 FunctionBody body) => new MethodDeclaration(null, null, null, |
| 641 modifier == null ? null : TokenFactory.tokenFromKeyword(modifier), |
| 642 returnType, |
| 643 property == null ? null : TokenFactory.tokenFromKeyword(property), |
| 644 operator == null ? null : TokenFactory.tokenFromKeyword(operator), name, |
| 645 typeParameters, parameters, body); |
| 624 | 646 |
| 625 static MethodInvocation methodInvocation(Expression target, String methodName, | 647 static MethodInvocation methodInvocation(Expression target, String methodName, |
| 626 [List<Expression> arguments, | 648 [List<Expression> arguments, |
| 627 TokenType operator = TokenType.PERIOD]) => new MethodInvocation(target, | 649 TokenType operator = TokenType.PERIOD]) => new MethodInvocation(target, |
| 628 target == null ? null : TokenFactory.tokenFromType(operator), | 650 target == null ? null : TokenFactory.tokenFromType(operator), |
| 629 identifier3(methodName), argumentList(arguments)); | 651 identifier3(methodName), null, argumentList(arguments)); |
| 630 | 652 |
| 631 static MethodInvocation methodInvocation2(String methodName, | 653 static MethodInvocation methodInvocation2(String methodName, |
| 632 [List<Expression> arguments]) => | 654 [List<Expression> arguments]) => |
| 633 methodInvocation(null, methodName, arguments); | 655 methodInvocation(null, methodName, arguments); |
| 634 | 656 |
| 657 static MethodInvocation methodInvocation3( |
| 658 Expression target, String methodName, TypeArgumentList typeArguments, |
| 659 [List<Expression> arguments, |
| 660 TokenType operator = TokenType.PERIOD]) => new MethodInvocation(target, |
| 661 target == null ? null : TokenFactory.tokenFromType(operator), |
| 662 identifier3(methodName), typeArguments, argumentList(arguments)); |
| 663 |
| 635 static NamedExpression namedExpression(Label label, Expression expression) => | 664 static NamedExpression namedExpression(Label label, Expression expression) => |
| 636 new NamedExpression(label, expression); | 665 new NamedExpression(label, expression); |
| 637 | 666 |
| 638 static NamedExpression namedExpression2( | 667 static NamedExpression namedExpression2( |
| 639 String label, Expression expression) => | 668 String label, Expression expression) => |
| 640 namedExpression(label2(label), expression); | 669 namedExpression(label2(label), expression); |
| 641 | 670 |
| 642 static DefaultFormalParameter namedFormalParameter( | 671 static DefaultFormalParameter namedFormalParameter( |
| 643 NormalFormalParameter parameter, Expression expression) => | 672 NormalFormalParameter parameter, Expression expression) => |
| 644 new DefaultFormalParameter(parameter, ParameterKind.NAMED, | 673 new DefaultFormalParameter(parameter, ParameterKind.NAMED, |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 new YieldStatement( | 973 new YieldStatement( |
| 945 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), | 974 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), |
| 946 TokenFactory.tokenFromType(TokenType.STAR), expression, | 975 TokenFactory.tokenFromType(TokenType.STAR), expression, |
| 947 TokenFactory.tokenFromType(TokenType.SEMICOLON)); | 976 TokenFactory.tokenFromType(TokenType.SEMICOLON)); |
| 948 | 977 |
| 949 static YieldStatement yieldStatement( | 978 static YieldStatement yieldStatement( |
| 950 Expression expression) => new YieldStatement( | 979 Expression expression) => new YieldStatement( |
| 951 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), null, | 980 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), null, |
| 952 expression, TokenFactory.tokenFromType(TokenType.SEMICOLON)); | 981 expression, TokenFactory.tokenFromType(TokenType.SEMICOLON)); |
| 953 } | 982 } |
| OLD | NEW |