Index: editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/ASTFactory.java |
=================================================================== |
--- editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/ASTFactory.java (revision 15397) |
+++ editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/ast/ASTFactory.java (working copy) |
@@ -219,30 +219,40 @@ |
elseExpression); |
} |
- public static ConstructorDeclaration constructorDeclaration(Keyword keyword, |
- Identifier returnType, String name, FormalParameterList parameters, |
- List<ConstructorInitializer> initializers) { |
- return new ConstructorDeclaration(null, null, token(Keyword.EXTERNAL), keyword == null ? null |
- : token(keyword), returnType, name == null ? null : token(TokenType.PERIOD), name == null |
- ? null : identifier(name), parameters, initializers == null || initializers.isEmpty() |
- ? null : token(TokenType.PERIOD), initializers == null |
- ? new ArrayList<ConstructorInitializer>() : initializers, emptyFunctionBody()); |
+ public static ConstructorDeclaration constructorDeclaration(Identifier returnType, String name, |
+ FormalParameterList parameters, List<ConstructorInitializer> initializers) { |
+ return new ConstructorDeclaration( |
+ null, |
+ null, |
+ token(Keyword.EXTERNAL), |
+ null, |
+ null, |
+ returnType, |
+ name == null ? null : token(TokenType.PERIOD), |
+ name == null ? null : identifier(name), |
+ parameters, |
+ initializers == null || initializers.isEmpty() ? null : token(TokenType.PERIOD), |
+ initializers == null ? new ArrayList<ConstructorInitializer>() : initializers, |
+ null, |
+ emptyFunctionBody()); |
} |
- public static ConstructorDeclaration constructorDeclaration(Keyword keyword, |
- Identifier returnType, String name, FormalParameterList parameters, |
+ public static ConstructorDeclaration constructorDeclaration(Keyword constKeyword, |
+ Keyword factoryKeyword, Identifier returnType, String name, FormalParameterList parameters, |
List<ConstructorInitializer> initializers, FunctionBody body) { |
return new ConstructorDeclaration( |
null, |
null, |
null, |
- keyword == null ? null : token(keyword), |
+ constKeyword == null ? null : token(constKeyword), |
+ factoryKeyword == null ? null : token(factoryKeyword), |
returnType, |
name == null ? null : token(TokenType.PERIOD), |
name == null ? null : identifier(name), |
parameters, |
initializers == null || initializers.isEmpty() ? null : token(TokenType.PERIOD), |
initializers == null ? new ArrayList<ConstructorInitializer>() : initializers, |
+ null, |
body); |
} |
@@ -256,6 +266,11 @@ |
expression); |
} |
+ public static ConstructorName constructorName(TypeName type, String name) { |
+ return new ConstructorName(type, name == null ? null : token(TokenType.PERIOD), name == null |
+ ? null : identifier(name)); |
+ } |
+ |
public static ContinueStatement continueStatement() { |
return new ContinueStatement(token(Keyword.CONTINUE), null, token(TokenType.SEMICOLON)); |
} |
@@ -517,10 +532,10 @@ |
TypeName type, String identifier, Expression... arguments) { |
return new InstanceCreationExpression( |
keyword == null ? null : token(keyword), |
- type, |
- identifier == null ? null : token(TokenType.PERIOD), |
- identifier == null ? null : identifier(identifier), |
- argumentList(arguments)); |
+ new ConstructorName( |
+ type, |
+ identifier == null ? null : token(TokenType.PERIOD), |
+ identifier == null ? null : identifier(identifier)), argumentList(arguments)); |
} |
public static IntegerLiteral integer(long value) { |
@@ -657,11 +672,8 @@ |
public static DefaultFormalParameter namedFormalParameter(NormalFormalParameter parameter, |
Expression expression) { |
- return new DefaultFormalParameter( |
- parameter, |
- ParameterKind.NAMED, |
- expression == null ? null : token(TokenType.COLON), |
- expression); |
+ return new DefaultFormalParameter(parameter, ParameterKind.NAMED, expression == null ? null |
+ : token(TokenType.COLON), expression); |
} |
public static NullLiteral nullLiteral() { |
@@ -705,11 +717,8 @@ |
public static DefaultFormalParameter positionalFormalParameter(NormalFormalParameter parameter, |
Expression expression) { |
- return new DefaultFormalParameter( |
- parameter, |
- ParameterKind.POSITIONAL, |
- expression == null ? null : token(TokenType.EQ), |
- expression); |
+ return new DefaultFormalParameter(parameter, ParameterKind.POSITIONAL, expression == null |
+ ? null : token(TokenType.EQ), expression); |
} |
public static PostfixExpression postfixExpression(Expression expression, TokenType operator) { |
@@ -890,6 +899,13 @@ |
return new TypeArgumentList(token(TokenType.LT), list(typeNames), token(TokenType.GT)); |
} |
+ public static TypeName typeName(Identifier name, TypeName... arguments) { |
+ if (arguments.length == 0) { |
+ return new TypeName(name, null); |
+ } |
+ return new TypeName(name, typeArgumentList(arguments)); |
+ } |
+ |
public static TypeName typeName(String name, TypeName... arguments) { |
if (arguments.length == 0) { |
return new TypeName(identifier(name), null); |