| 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 library analyzer.src.generated.testing.ast_test_factory; | 5 library analyzer.src.generated.testing.ast_test_factory; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; | 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/dart/element/element.dart'; | 10 import 'package:analyzer/dart/element/element.dart'; |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 fieldList: variableDeclarationList(keyword, type, variables), | 477 fieldList: variableDeclarationList(keyword, type, variables), |
| 478 semicolon: TokenFactory.tokenFromType(TokenType.SEMICOLON)); | 478 semicolon: TokenFactory.tokenFromType(TokenType.SEMICOLON)); |
| 479 | 479 |
| 480 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, | 480 static FieldDeclaration fieldDeclaration2(bool isStatic, Keyword keyword, |
| 481 List<VariableDeclaration> variables) => | 481 List<VariableDeclaration> variables) => |
| 482 fieldDeclaration(isStatic, keyword, null, variables); | 482 fieldDeclaration(isStatic, keyword, null, variables); |
| 483 | 483 |
| 484 static FieldFormalParameter fieldFormalParameter( | 484 static FieldFormalParameter fieldFormalParameter( |
| 485 Keyword keyword, TypeAnnotation type, String identifier, | 485 Keyword keyword, TypeAnnotation type, String identifier, |
| 486 [FormalParameterList parameterList]) => | 486 [FormalParameterList parameterList]) => |
| 487 astFactory.fieldFormalParameter( | 487 astFactory.fieldFormalParameter2( |
| 488 null, | 488 keyword: |
| 489 null, | 489 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), |
| 490 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), | 490 type: type, |
| 491 type, | 491 thisKeyword: TokenFactory.tokenFromKeyword(Keyword.THIS), |
| 492 TokenFactory.tokenFromKeyword(Keyword.THIS), | 492 period: TokenFactory.tokenFromType(TokenType.PERIOD), |
| 493 TokenFactory.tokenFromType(TokenType.PERIOD), | 493 identifier: identifier3(identifier), |
| 494 identifier3(identifier), | 494 parameters: parameterList); |
| 495 null, | |
| 496 parameterList); | |
| 497 | 495 |
| 498 static FieldFormalParameter fieldFormalParameter2(String identifier) => | 496 static FieldFormalParameter fieldFormalParameter2(String identifier) => |
| 499 fieldFormalParameter(null, null, identifier); | 497 fieldFormalParameter(null, null, identifier); |
| 500 | 498 |
| 501 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, | 499 static ForEachStatement forEachStatement(DeclaredIdentifier loopVariable, |
| 502 Expression iterator, Statement body) => | 500 Expression iterator, Statement body) => |
| 503 astFactory.forEachStatementWithDeclaration( | 501 astFactory.forEachStatementWithDeclaration( |
| 504 null, | 502 null, |
| 505 TokenFactory.tokenFromKeyword(Keyword.FOR), | 503 TokenFactory.tokenFromKeyword(Keyword.FOR), |
| 506 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), | 504 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 static FunctionExpressionInvocation functionExpressionInvocation2( | 600 static FunctionExpressionInvocation functionExpressionInvocation2( |
| 603 Expression function, | 601 Expression function, |
| 604 [TypeArgumentList typeArguments, | 602 [TypeArgumentList typeArguments, |
| 605 List<Expression> arguments]) => | 603 List<Expression> arguments]) => |
| 606 astFactory.functionExpressionInvocation( | 604 astFactory.functionExpressionInvocation( |
| 607 function, typeArguments, argumentList(arguments)); | 605 function, typeArguments, argumentList(arguments)); |
| 608 | 606 |
| 609 static FunctionTypedFormalParameter functionTypedFormalParameter( | 607 static FunctionTypedFormalParameter functionTypedFormalParameter( |
| 610 TypeAnnotation returnType, String identifier, | 608 TypeAnnotation returnType, String identifier, |
| 611 [List<FormalParameter> parameters]) => | 609 [List<FormalParameter> parameters]) => |
| 612 astFactory.functionTypedFormalParameter(null, null, returnType, | 610 astFactory.functionTypedFormalParameter2( |
| 613 identifier3(identifier), null, formalParameterList(parameters)); | 611 returnType: returnType, |
| 612 identifier: identifier3(identifier), |
| 613 parameters: formalParameterList(parameters)); |
| 614 | 614 |
| 615 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => | 615 static HideCombinator hideCombinator(List<SimpleIdentifier> identifiers) => |
| 616 astFactory.hideCombinator( | 616 astFactory.hideCombinator( |
| 617 TokenFactory.tokenFromString("hide"), identifiers); | 617 TokenFactory.tokenFromString("hide"), identifiers); |
| 618 | 618 |
| 619 static HideCombinator hideCombinator2(List<String> identifiers) => | 619 static HideCombinator hideCombinator2(List<String> identifiers) => |
| 620 astFactory.hideCombinator( | 620 astFactory.hideCombinator( |
| 621 TokenFactory.tokenFromString("hide"), identifierList(identifiers)); | 621 TokenFactory.tokenFromString("hide"), identifierList(identifiers)); |
| 622 | 622 |
| 623 static PrefixedIdentifier identifier( | 623 static PrefixedIdentifier identifier( |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1058 static ShowCombinator showCombinator2(List<String> identifiers) => | 1058 static ShowCombinator showCombinator2(List<String> identifiers) => |
| 1059 astFactory.showCombinator( | 1059 astFactory.showCombinator( |
| 1060 TokenFactory.tokenFromString("show"), identifierList(identifiers)); | 1060 TokenFactory.tokenFromString("show"), identifierList(identifiers)); |
| 1061 | 1061 |
| 1062 static SimpleFormalParameter simpleFormalParameter( | 1062 static SimpleFormalParameter simpleFormalParameter( |
| 1063 Keyword keyword, String parameterName) => | 1063 Keyword keyword, String parameterName) => |
| 1064 simpleFormalParameter2(keyword, null, parameterName); | 1064 simpleFormalParameter2(keyword, null, parameterName); |
| 1065 | 1065 |
| 1066 static SimpleFormalParameter simpleFormalParameter2( | 1066 static SimpleFormalParameter simpleFormalParameter2( |
| 1067 Keyword keyword, TypeAnnotation type, String parameterName) => | 1067 Keyword keyword, TypeAnnotation type, String parameterName) => |
| 1068 astFactory.simpleFormalParameter( | 1068 astFactory.simpleFormalParameter2( |
| 1069 null, | 1069 keyword: |
| 1070 null, | 1070 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), |
| 1071 keyword == null ? null : TokenFactory.tokenFromKeyword(keyword), | 1071 type: type, |
| 1072 type, | 1072 identifier: identifier3(parameterName)); |
| 1073 identifier3(parameterName)); | |
| 1074 | 1073 |
| 1075 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => | 1074 static SimpleFormalParameter simpleFormalParameter3(String parameterName) => |
| 1076 simpleFormalParameter2(null, null, parameterName); | 1075 simpleFormalParameter2(null, null, parameterName); |
| 1077 | 1076 |
| 1078 static SimpleFormalParameter simpleFormalParameter4( | 1077 static SimpleFormalParameter simpleFormalParameter4( |
| 1079 TypeAnnotation type, String parameterName) => | 1078 TypeAnnotation type, String parameterName) => |
| 1080 simpleFormalParameter2(null, type, parameterName); | 1079 simpleFormalParameter2(null, type, parameterName); |
| 1081 | 1080 |
| 1082 static StringInterpolation string([List<InterpolationElement> elements]) => | 1081 static StringInterpolation string([List<InterpolationElement> elements]) => |
| 1083 astFactory.stringInterpolation(elements); | 1082 astFactory.stringInterpolation(elements); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 expression, | 1314 expression, |
| 1316 TokenFactory.tokenFromType(TokenType.SEMICOLON)); | 1315 TokenFactory.tokenFromType(TokenType.SEMICOLON)); |
| 1317 | 1316 |
| 1318 static YieldStatement yieldStatement(Expression expression) => | 1317 static YieldStatement yieldStatement(Expression expression) => |
| 1319 astFactory.yieldStatement( | 1318 astFactory.yieldStatement( |
| 1320 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), | 1319 TokenFactory.tokenFromTypeAndString(TokenType.IDENTIFIER, "yield"), |
| 1321 null, | 1320 null, |
| 1322 expression, | 1321 expression, |
| 1323 TokenFactory.tokenFromType(TokenType.SEMICOLON)); | 1322 TokenFactory.tokenFromType(TokenType.SEMICOLON)); |
| 1324 } | 1323 } |
| OLD | NEW |