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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 1322513004: Reformat code to reduce churn (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_engine.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/parser.dart
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart
index 47a4bc144770d8b606154b3b2499efb0c0c90e0a..113da91847e6b132e5a0828d103377c01fb88867 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -89,11 +89,14 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
'parseWithClause_0':
new MethodTrampoline(0, (Parser target) => target.parseWithClause()),
'advance_0': new MethodTrampoline(0, (Parser target) => target._advance()),
- 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1,
- arg2, arg3,
- arg4) => target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
- 'computeStringValue_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._computeStringValue(arg0, arg1, arg2)),
+ 'appendScalarValue_5': new MethodTrampoline(
+ 5,
+ (Parser target, arg0, arg1, arg2, arg3, arg4) =>
+ target._appendScalarValue(arg0, arg1, arg2, arg3, arg4)),
+ 'computeStringValue_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._computeStringValue(arg0, arg1, arg2)),
'convertToFunctionDeclaration_1': new MethodTrampoline(
1, (Parser target, arg0) => target._convertToFunctionDeclaration(arg0)),
'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline(
@@ -159,8 +162,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
0, (Parser target) => target._parseAssertStatement()),
'parseAssignableExpression_1': new MethodTrampoline(
1, (Parser target, arg0) => target._parseAssignableExpression(arg0)),
- 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0,
- arg1) => target._parseAssignableSelector(arg0, arg1)),
+ 'parseAssignableSelector_2': new MethodTrampoline(
+ 2,
+ (Parser target, arg0, arg1) =>
+ target._parseAssignableSelector(arg0, arg1)),
'parseAwaitExpression_0': new MethodTrampoline(
0, (Parser target) => target._parseAwaitExpression()),
'parseBitwiseAndExpression_0': new MethodTrampoline(
@@ -175,8 +180,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
(Parser target, arg0, arg1) => target._parseClassDeclaration(arg0, arg1)),
'parseClassMembers_2': new MethodTrampoline(
2, (Parser target, arg0, arg1) => target._parseClassMembers(arg0, arg1)),
- 'parseClassTypeAlias_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._parseClassTypeAlias(arg0, arg1, arg2)),
+ 'parseClassTypeAlias_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._parseClassTypeAlias(arg0, arg1, arg2)),
'parseCombinator_0':
new MethodTrampoline(0, (Parser target) => target.parseCombinator()),
'parseCombinators_0':
@@ -191,9 +198,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
1, (Parser target, arg0) => target._parseCompilationUnitMember(arg0)),
'parseConstExpression_0': new MethodTrampoline(
0, (Parser target) => target._parseConstExpression()),
- 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1,
- arg2, arg3, arg4, arg5, arg6, arg7) =>
- target._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
+ 'parseConstructor_8': new MethodTrampoline(
+ 8,
+ (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) => target
+ ._parseConstructor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7)),
'parseConstructorFieldInitializer_0': new MethodTrampoline(
0, (Parser target) => target._parseConstructorFieldInitializer()),
'parseContinueStatement_0': new MethodTrampoline(
@@ -224,26 +232,36 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
1, (Parser target, arg0) => target._parseFormalParameter(arg0)),
'parseForStatement_0':
new MethodTrampoline(0, (Parser target) => target._parseForStatement()),
- 'parseFunctionBody_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._parseFunctionBody(arg0, arg1, arg2)),
- 'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0,
- arg1, arg2) => target._parseFunctionDeclaration(arg0, arg1, arg2)),
+ 'parseFunctionBody_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._parseFunctionBody(arg0, arg1, arg2)),
+ 'parseFunctionDeclaration_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._parseFunctionDeclaration(arg0, arg1, arg2)),
'parseFunctionDeclarationStatement_0': new MethodTrampoline(
0, (Parser target) => target._parseFunctionDeclarationStatement()),
- 'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(2,
+ 'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline(
+ 2,
(Parser target, arg0, arg1) =>
target._parseFunctionDeclarationStatementAfterReturnType(arg0, arg1)),
- 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0,
- arg1) => target._parseFunctionTypeAlias(arg0, arg1)),
- 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2,
- arg3) => target._parseGetter(arg0, arg1, arg2, arg3)),
+ 'parseFunctionTypeAlias_2': new MethodTrampoline(
+ 2,
+ (Parser target, arg0, arg1) =>
+ target._parseFunctionTypeAlias(arg0, arg1)),
+ 'parseGetter_4': new MethodTrampoline(
+ 4,
+ (Parser target, arg0, arg1, arg2, arg3) =>
+ target._parseGetter(arg0, arg1, arg2, arg3)),
'parseIdentifierList_0':
new MethodTrampoline(0, (Parser target) => target._parseIdentifierList()),
'parseIfStatement_0':
new MethodTrampoline(0, (Parser target) => target._parseIfStatement()),
'parseImportDirective_1': new MethodTrampoline(
1, (Parser target, arg0) => target._parseImportDirective(arg0)),
- 'parseInitializedIdentifierList_4': new MethodTrampoline(4,
+ 'parseInitializedIdentifierList_4': new MethodTrampoline(
+ 4,
(Parser target, arg0, arg1, arg2, arg3) =>
target._parseInitializedIdentifierList(arg0, arg1, arg2, arg3)),
'parseInstanceCreationExpression_1': new MethodTrampoline(1,
@@ -260,11 +278,13 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
0, (Parser target) => target._parseLogicalAndExpression()),
'parseMapLiteral_2': new MethodTrampoline(
2, (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)),
- 'parseMethodDeclarationAfterParameters_7': new MethodTrampoline(7,
- (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6) => target
- ._parseMethodDeclarationAfterParameters(
+ 'parseMethodDeclarationAfterParameters_7': new MethodTrampoline(
+ 7,
+ (Parser target, arg0, arg1, arg2, arg3, arg4, arg5, arg6) =>
+ target._parseMethodDeclarationAfterParameters(
arg0, arg1, arg2, arg3, arg4, arg5, arg6)),
- 'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(4,
+ 'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(
+ 4,
(Parser target, arg0, arg1, arg2, arg3) => target
._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)),
'parseModifiers_0':
@@ -277,8 +297,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
new MethodTrampoline(0, (Parser target) => target._parseNewExpression()),
'parseNonLabeledStatement_0': new MethodTrampoline(
0, (Parser target) => target._parseNonLabeledStatement()),
- 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._parseOperator(arg0, arg1, arg2)),
+ 'parseOperator_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._parseOperator(arg0, arg1, arg2)),
'parseOptionalReturnType_0': new MethodTrampoline(
0, (Parser target) => target._parseOptionalReturnType()),
'parsePartDirective_1': new MethodTrampoline(
@@ -295,8 +317,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
0, (Parser target) => target._parseRethrowExpression()),
'parseReturnStatement_0': new MethodTrampoline(
0, (Parser target) => target._parseReturnStatement()),
- 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2,
- arg3) => target._parseSetter(arg0, arg1, arg2, arg3)),
+ 'parseSetter_4': new MethodTrampoline(
+ 4,
+ (Parser target, arg0, arg1, arg2, arg3) =>
+ target._parseSetter(arg0, arg1, arg2, arg3)),
'parseShiftExpression_0': new MethodTrampoline(
0, (Parser target) => target._parseShiftExpression()),
'parseStatementList_0':
@@ -321,16 +345,20 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
0, (Parser target) => target._parseUnaryExpression()),
'parseVariableDeclaration_0': new MethodTrampoline(
0, (Parser target) => target._parseVariableDeclaration()),
- 'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(1,
+ 'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._parseVariableDeclarationListAfterMetadata(arg0)),
- 'parseVariableDeclarationListAfterType_3': new MethodTrampoline(3,
+ 'parseVariableDeclarationListAfterType_3': new MethodTrampoline(
+ 3,
(Parser target, arg0, arg1, arg2) =>
target._parseVariableDeclarationListAfterType(arg0, arg1, arg2)),
- 'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(1,
+ 'parseVariableDeclarationStatementAfterMetadata_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._parseVariableDeclarationStatementAfterMetadata(arg0)),
- 'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(3,
+ 'parseVariableDeclarationStatementAfterType_3': new MethodTrampoline(
+ 3,
(Parser target, arg0, arg1, arg2) =>
target._parseVariableDeclarationStatementAfterType(arg0, arg1, arg2)),
'parseWhileStatement_0':
@@ -342,12 +370,18 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
new MethodTrampoline(1, (Parser target, arg0) => target._peekAt(arg0)),
'reportError_1': new MethodTrampoline(
1, (Parser target, arg0) => target._reportError(arg0)),
- 'reportErrorForCurrentToken_2': new MethodTrampoline(2, (Parser target, arg0,
- arg1) => target._reportErrorForCurrentToken(arg0, arg1)),
- 'reportErrorForNode_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._reportErrorForNode(arg0, arg1, arg2)),
- 'reportErrorForToken_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._reportErrorForToken(arg0, arg1, arg2)),
+ 'reportErrorForCurrentToken_2': new MethodTrampoline(
+ 2,
+ (Parser target, arg0, arg1) =>
+ target._reportErrorForCurrentToken(arg0, arg1)),
+ 'reportErrorForNode_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._reportErrorForNode(arg0, arg1, arg2)),
+ 'reportErrorForToken_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._reportErrorForToken(arg0, arg1, arg2)),
'skipBlock_0':
new MethodTrampoline(0, (Parser target) => target._skipBlock()),
'skipFinalConstVarOrType_1': new MethodTrampoline(
@@ -380,8 +414,10 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
(Parser target, arg0, arg1) => target._tokenMatchesKeyword(arg0, arg1)),
'tokenMatchesString_2': new MethodTrampoline(
2, (Parser target, arg0, arg1) => target._tokenMatchesString(arg0, arg1)),
- 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1,
- arg2) => target._translateCharacter(arg0, arg1, arg2)),
+ 'translateCharacter_3': new MethodTrampoline(
+ 3,
+ (Parser target, arg0, arg1, arg2) =>
+ target._translateCharacter(arg0, arg1, arg2)),
'unlockErrorListener_0':
new MethodTrampoline(0, (Parser target) => target._unlockErrorListener()),
'validateFormalParameterList_1': new MethodTrampoline(
@@ -394,21 +430,26 @@ Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{
1, (Parser target, arg0) => target._validateModifiersForEnum(arg0)),
'validateModifiersForField_1': new MethodTrampoline(
1, (Parser target, arg0) => target._validateModifiersForField(arg0)),
- 'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(1,
+ 'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._validateModifiersForFunctionDeclarationStatement(arg0)),
- 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1,
+ 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._validateModifiersForGetterOrSetterOrMethod(arg0)),
'validateModifiersForOperator_1': new MethodTrampoline(
1, (Parser target, arg0) => target._validateModifiersForOperator(arg0)),
- 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1,
+ 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._validateModifiersForTopLevelDeclaration(arg0)),
- 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1,
+ 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._validateModifiersForTopLevelFunction(arg0)),
- 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1,
+ 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(
+ 1,
(Parser target, arg0) =>
target._validateModifiersForTopLevelVariable(arg0)),
'validateModifiersForTypedef_1': new MethodTrampoline(
@@ -2328,11 +2369,11 @@ class Parser {
commentAndMetadata, modifiers.externalKeyword, returnType);
} else if (_matchesIdentifier() &&
_peek().matchesAny([
- TokenType.OPEN_PAREN,
- TokenType.OPEN_CURLY_BRACKET,
- TokenType.FUNCTION,
- TokenType.LT
- ])) {
+ TokenType.OPEN_PAREN,
+ TokenType.OPEN_CURLY_BRACKET,
+ TokenType.FUNCTION,
+ TokenType.LT
+ ])) {
_validateModifiersForGetterOrSetterOrMethod(modifiers);
return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
modifiers.externalKeyword, modifiers.staticKeyword, returnType);
@@ -2347,8 +2388,10 @@ class Parser {
// We appear to have a variable declaration with a type of "void".
//
_reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
- return _parseInitializedIdentifierList(commentAndMetadata,
- modifiers.staticKeyword, _validateModifiersForField(modifiers),
+ return _parseInitializedIdentifierList(
+ commentAndMetadata,
+ modifiers.staticKeyword,
+ _validateModifiersForField(modifiers),
returnType);
}
}
@@ -2426,8 +2469,10 @@ class Parser {
List<VariableDeclaration> variables = new List<VariableDeclaration>();
variables.add(
new VariableDeclaration(_createSyntheticIdentifier(), null, null));
- return new FieldDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, null,
+ return new FieldDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ null,
new VariableDeclarationList(null, null, keyword, null, variables),
_expectSemicolon());
}
@@ -2441,9 +2486,17 @@ class Parser {
// to loose, so we'll treat it as a method declaration with a missing
// name, parameters and empty body.
//
- return new MethodDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, null, null, null, null, null,
- _createSyntheticIdentifier(), null, new FormalParameterList(
+ return new MethodDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ null,
+ null,
+ null,
+ null,
+ null,
+ _createSyntheticIdentifier(),
+ null,
+ new FormalParameterList(
null, new List<FormalParameter>(), null, null, null),
new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON)));
}
@@ -2451,9 +2504,14 @@ class Parser {
} else if (_tokenMatches(_peek(), TokenType.PERIOD) &&
_tokenMatchesIdentifier(_peekAt(2)) &&
_tokenMatches(_peekAt(3), TokenType.OPEN_PAREN)) {
- return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
- _validateModifiersForConstructor(modifiers), modifiers.factoryKeyword,
- parseSimpleIdentifier(), getAndAdvance(), parseSimpleIdentifier(),
+ return _parseConstructor(
+ commentAndMetadata,
+ modifiers.externalKeyword,
+ _validateModifiersForConstructor(modifiers),
+ modifiers.factoryKeyword,
+ parseSimpleIdentifier(),
+ getAndAdvance(),
+ parseSimpleIdentifier(),
parseFormalParameterList());
} else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) {
SimpleIdentifier methodName = parseSimpleIdentifier();
@@ -2461,15 +2519,26 @@ class Parser {
if (_matches(TokenType.COLON) ||
modifiers.factoryKeyword != null ||
methodName.name == className) {
- return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
+ return _parseConstructor(
+ commentAndMetadata,
+ modifiers.externalKeyword,
_validateModifiersForConstructor(modifiers),
- modifiers.factoryKeyword, methodName, null, null, parameters);
+ modifiers.factoryKeyword,
+ methodName,
+ null,
+ null,
+ parameters);
}
_validateModifiersForGetterOrSetterOrMethod(modifiers);
_validateFormalParameterList(parameters);
- return _parseMethodDeclarationAfterParameters(commentAndMetadata,
- modifiers.externalKeyword, modifiers.staticKeyword, null, methodName,
- null, parameters);
+ return _parseMethodDeclarationAfterParameters(
+ commentAndMetadata,
+ modifiers.externalKeyword,
+ modifiers.staticKeyword,
+ null,
+ methodName,
+ null,
+ parameters);
} else if (_peek()
.matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) {
if (modifiers.constKeyword == null &&
@@ -2514,8 +2583,10 @@ class Parser {
// class. At this point it consists of a type name, so we'll treat it as
// a field declaration with a missing field name and semicolon.
//
- return _parseInitializedIdentifierList(commentAndMetadata,
- modifiers.staticKeyword, _validateModifiersForField(modifiers),
+ return _parseInitializedIdentifierList(
+ commentAndMetadata,
+ modifiers.staticKeyword,
+ _validateModifiersForField(modifiers),
type);
}
if (_isOperator(_currentToken)) {
@@ -2536,8 +2607,10 @@ class Parser {
ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken);
try {
_lockErrorListener();
- return _parseInitializedIdentifierList(commentAndMetadata,
- modifiers.staticKeyword, _validateModifiersForField(modifiers),
+ return _parseInitializedIdentifierList(
+ commentAndMetadata,
+ modifiers.staticKeyword,
+ _validateModifiersForField(modifiers),
type);
} finally {
_unlockErrorListener();
@@ -2547,15 +2620,26 @@ class Parser {
FormalParameterList parameters = parseFormalParameterList();
if (methodName.name == className) {
_reportErrorForNode(ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, type);
- return _parseConstructor(commentAndMetadata, modifiers.externalKeyword,
+ return _parseConstructor(
+ commentAndMetadata,
+ modifiers.externalKeyword,
_validateModifiersForConstructor(modifiers),
- modifiers.factoryKeyword, methodName, null, null, parameters);
+ modifiers.factoryKeyword,
+ methodName,
+ null,
+ null,
+ parameters);
}
_validateModifiersForGetterOrSetterOrMethod(modifiers);
_validateFormalParameterList(parameters);
- return _parseMethodDeclarationAfterParameters(commentAndMetadata,
- modifiers.externalKeyword, modifiers.staticKeyword, type, methodName,
- null, parameters);
+ return _parseMethodDeclarationAfterParameters(
+ commentAndMetadata,
+ modifiers.externalKeyword,
+ modifiers.staticKeyword,
+ type,
+ methodName,
+ null,
+ parameters);
} else if (parseGenericMethods && _tokenMatches(_peek(), TokenType.LT)) {
return _parseMethodDeclarationAfterReturnType(commentAndMetadata,
modifiers.externalKeyword, modifiers.staticKeyword, type);
@@ -3192,13 +3276,24 @@ class Parser {
_reportErrorForToken(
ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword);
}
- return new FunctionTypedFormalParameter(commentAndMetadata.comment,
- commentAndMetadata.metadata, holder.type, identifier,
- typeParameters, parameters);
+ return new FunctionTypedFormalParameter(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ holder.type,
+ identifier,
+ typeParameters,
+ parameters);
} else {
- return new FieldFormalParameter(commentAndMetadata.comment,
- commentAndMetadata.metadata, holder.keyword, holder.type,
- thisKeyword, period, identifier, typeParameters, parameters);
+ return new FieldFormalParameter(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ holder.keyword,
+ holder.type,
+ thisKeyword,
+ period,
+ identifier,
+ typeParameters,
+ parameters);
}
} else if (typeParameters != null) {
// TODO(brianwilkerson) Report an error. It looks like a function-typed
@@ -3219,9 +3314,16 @@ class Parser {
// TODO(brianwilkerson) If there are type parameters but no parameters,
// should we create a synthetic empty parameter list here so we can
// capture the type parameters?
- return new FieldFormalParameter(commentAndMetadata.comment,
- commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword,
- period, identifier, null, null);
+ return new FieldFormalParameter(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ holder.keyword,
+ holder.type,
+ thisKeyword,
+ period,
+ identifier,
+ null,
+ null);
}
return new SimpleFormalParameter(commentAndMetadata.comment,
commentAndMetadata.metadata, holder.keyword, holder.type, identifier);
@@ -3508,9 +3610,14 @@ class Parser {
* captures the components of the given method declaration).
*/
FunctionDeclaration _convertToFunctionDeclaration(MethodDeclaration method) =>
- new FunctionDeclaration(method.documentationComment, method.metadata,
- method.externalKeyword, method.returnType, method.propertyKeyword,
- method.name, new FunctionExpression(
+ new FunctionDeclaration(
+ method.documentationComment,
+ method.metadata,
+ method.externalKeyword,
+ method.returnType,
+ method.propertyKeyword,
+ method.name,
+ new FunctionExpression(
method.typeParameters, method.parameters, method.body));
/**
@@ -4212,7 +4319,8 @@ class Parser {
Expression _parseAssignableExpression(bool primaryAllowed) {
if (_matchesKeyword(Keyword.SUPER)) {
return _parseAssignableSelector(
- new SuperExpression(getAndAdvance()), false, allowConditional: false);
+ new SuperExpression(getAndAdvance()), false,
+ allowConditional: false);
}
//
// A primary expression can start with an identifier. We resolve the
@@ -4233,8 +4341,11 @@ class Parser {
expression as SimpleIdentifier, typeArguments, argumentList);
} else if (expression is PrefixedIdentifier) {
PrefixedIdentifier identifier = expression as PrefixedIdentifier;
- expression = new MethodInvocation(identifier.prefix,
- identifier.period, identifier.identifier, typeArguments,
+ expression = new MethodInvocation(
+ identifier.prefix,
+ identifier.period,
+ identifier.identifier,
+ typeArguments,
argumentList);
} else if (expression is PropertyAccess) {
PropertyAccess access = expression as PropertyAccess;
@@ -4469,9 +4580,12 @@ class Parser {
}
if (expression is PropertyAccess) {
PropertyAccess propertyAccess = expression as PropertyAccess;
- expression = new MethodInvocation(propertyAccess.target,
- propertyAccess.operator, propertyAccess.propertyName,
- typeArguments, parseArgumentList());
+ expression = new MethodInvocation(
+ propertyAccess.target,
+ propertyAccess.operator,
+ propertyAccess.propertyName,
+ typeArguments,
+ parseArgumentList());
} else {
expression = new FunctionExpressionInvocation(
expression, typeArguments, parseArgumentList());
@@ -4600,9 +4714,18 @@ class Parser {
_reportErrorForCurrentToken(ParserErrorCode.MISSING_CLASS_BODY);
}
ClassDeclaration classDeclaration = new ClassDeclaration(
- commentAndMetadata.comment, commentAndMetadata.metadata,
- abstractKeyword, keyword, name, typeParameters, extendsClause,
- withClause, implementsClause, leftBracket, members, rightBracket);
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ abstractKeyword,
+ keyword,
+ name,
+ typeParameters,
+ extendsClause,
+ withClause,
+ implementsClause,
+ leftBracket,
+ members,
+ rightBracket);
classDeclaration.nativeClause = nativeClause;
return classDeclaration;
}
@@ -4692,9 +4815,17 @@ class Parser {
}
semicolon = _createSyntheticToken(TokenType.SEMICOLON);
}
- return new ClassTypeAlias(commentAndMetadata.comment,
- commentAndMetadata.metadata, classKeyword, className, typeParameters,
- equals, abstractKeyword, superclass, withClause, implementsClause,
+ return new ClassTypeAlias(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ classKeyword,
+ className,
+ typeParameters,
+ equals,
+ abstractKeyword,
+ superclass,
+ withClause,
+ implementsClause,
semicolon);
}
@@ -4924,10 +5055,10 @@ class Parser {
commentAndMetadata, modifiers.externalKeyword, returnType));
} else if (_matchesIdentifier() &&
_peek().matchesAny([
- TokenType.OPEN_PAREN,
- TokenType.OPEN_CURLY_BRACKET,
- TokenType.FUNCTION
- ])) {
+ TokenType.OPEN_PAREN,
+ TokenType.OPEN_CURLY_BRACKET,
+ TokenType.FUNCTION
+ ])) {
_validateModifiersForTopLevelFunction(modifiers);
return _parseFunctionDeclaration(
commentAndMetadata, modifiers.externalKeyword, returnType);
@@ -4942,7 +5073,8 @@ class Parser {
// We appear to have a variable declaration with a type of "void".
//
_reportErrorForNode(ParserErrorCode.VOID_VARIABLE, returnType);
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
commentAndMetadata.metadata,
_parseVariableDeclarationListAfterType(null,
_validateModifiersForTopLevelVariable(modifiers), null),
@@ -4978,7 +5110,8 @@ class Parser {
List<VariableDeclaration> variables = new List<VariableDeclaration>();
variables.add(
new VariableDeclaration(_createSyntheticIdentifier(), null, null));
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
commentAndMetadata.metadata,
new VariableDeclarationList(null, null, keyword, null, variables),
_expectSemicolon());
@@ -4997,8 +5130,10 @@ class Parser {
_reportErrorForCurrentToken(
ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE);
}
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ _parseVariableDeclarationListAfterType(
null, _validateModifiersForTopLevelVariable(modifiers), null),
_expect(TokenType.SEMICOLON));
}
@@ -5013,10 +5148,12 @@ class Parser {
return _convertToFunctionDeclaration(_parseOperator(
commentAndMetadata, modifiers.externalKeyword, returnType));
} else if (_matches(TokenType.AT)) {
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
- null, _validateModifiersForTopLevelVariable(modifiers),
- returnType), _expect(TokenType.SEMICOLON));
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ _parseVariableDeclarationListAfterType(null,
+ _validateModifiersForTopLevelVariable(modifiers), returnType),
+ _expect(TokenType.SEMICOLON));
} else if (!_matchesIdentifier()) {
// TODO(brianwilkerson) Generalize this error. We could also be parsing a
// top-level variable at this point.
@@ -5030,7 +5167,8 @@ class Parser {
List<VariableDeclaration> variables = new List<VariableDeclaration>();
variables.add(
new VariableDeclaration(_createSyntheticIdentifier(), null, null));
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
commentAndMetadata.metadata,
new VariableDeclarationList(null, null, null, returnType, variables),
semicolon);
@@ -5044,8 +5182,10 @@ class Parser {
return _parseFunctionDeclaration(
commentAndMetadata, modifiers.externalKeyword, returnType);
}
- return new TopLevelVariableDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, _parseVariableDeclarationListAfterType(
+ return new TopLevelVariableDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ _parseVariableDeclarationListAfterType(
null, _validateModifiersForTopLevelVariable(modifiers), returnType),
_expect(TokenType.SEMICOLON));
}
@@ -5071,9 +5211,14 @@ class Parser {
}
ConstructorDeclaration _parseConstructor(
- CommentAndMetadata commentAndMetadata, Token externalKeyword,
- Token constKeyword, Token factoryKeyword, SimpleIdentifier returnType,
- Token period, SimpleIdentifier name, FormalParameterList parameters) {
+ CommentAndMetadata commentAndMetadata,
+ Token externalKeyword,
+ Token constKeyword,
+ Token factoryKeyword,
+ SimpleIdentifier returnType,
+ Token period,
+ SimpleIdentifier name,
+ FormalParameterList parameters) {
bool bodyAllowed = externalKeyword == null;
Token separator = null;
List<ConstructorInitializer> initializers = null;
@@ -5141,10 +5286,20 @@ class Parser {
}
}
}
- return new ConstructorDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, constKeyword,
- factoryKeyword, returnType, period, name, parameters, separator,
- initializers, redirectedConstructor, body);
+ return new ConstructorDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ constKeyword,
+ factoryKeyword,
+ returnType,
+ period,
+ name,
+ parameters,
+ separator,
+ initializers,
+ redirectedConstructor,
+ body);
}
/**
@@ -5412,8 +5567,13 @@ class Parser {
rightBracket = _createSyntheticToken(TokenType.CLOSE_CURLY_BRACKET);
_reportErrorForCurrentToken(ParserErrorCode.MISSING_ENUM_BODY);
}
- return new EnumDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, keyword, name, leftBracket, constants,
+ return new EnumDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ keyword,
+ name,
+ leftBracket,
+ constants,
rightBracket);
}
@@ -5459,8 +5619,12 @@ class Parser {
StringLiteral libraryUri = _parseUri();
List<Combinator> combinators = _parseCombinators();
Token semicolon = _expectSemicolon();
- return new ExportDirective(commentAndMetadata.comment,
- commentAndMetadata.metadata, exportKeyword, libraryUri, combinators,
+ return new ExportDirective(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ exportKeyword,
+ libraryUri,
+ combinators,
semicolon);
}
@@ -5640,13 +5804,25 @@ class Parser {
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
Statement body = parseStatement2();
if (loopVariable == null) {
- return new ForEachStatement.withReference(awaitKeyword, forKeyword,
- leftParenthesis, identifier, inKeyword, iterator,
- rightParenthesis, body);
+ return new ForEachStatement.withReference(
+ awaitKeyword,
+ forKeyword,
+ leftParenthesis,
+ identifier,
+ inKeyword,
+ iterator,
+ rightParenthesis,
+ body);
}
- return new ForEachStatement.withDeclaration(awaitKeyword, forKeyword,
- leftParenthesis, loopVariable, inKeyword, iterator,
- rightParenthesis, body);
+ return new ForEachStatement.withDeclaration(
+ awaitKeyword,
+ forKeyword,
+ leftParenthesis,
+ loopVariable,
+ inKeyword,
+ iterator,
+ rightParenthesis,
+ body);
}
}
if (awaitKeyword != null) {
@@ -5665,9 +5841,17 @@ class Parser {
}
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN);
Statement body = parseStatement2();
- return new ForStatement(forKeyword, leftParenthesis, variableList,
- initialization, leftSeparator, condition, rightSeparator, updaters,
- rightParenthesis, body);
+ return new ForStatement(
+ forKeyword,
+ leftParenthesis,
+ variableList,
+ initialization,
+ leftSeparator,
+ condition,
+ rightSeparator,
+ updaters,
+ rightParenthesis,
+ body);
} finally {
_inLoop = wasInLoop;
}
@@ -5797,7 +5981,8 @@ class Parser {
* | returnType? getOrSet identifier formalParameterList functionBody
*/
FunctionDeclaration _parseFunctionDeclaration(
- CommentAndMetadata commentAndMetadata, Token externalKeyword,
+ CommentAndMetadata commentAndMetadata,
+ Token externalKeyword,
TypeName returnType) {
Token keyword = null;
bool isGetter = false;
@@ -5823,7 +6008,10 @@ class Parser {
_reportErrorForCurrentToken(
ParserErrorCode.MISSING_FUNCTION_PARAMETERS);
parameters = new FormalParameterList(
- _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+ _createSyntheticToken(TokenType.OPEN_PAREN),
+ null,
+ null,
+ null,
_createSyntheticToken(TokenType.CLOSE_PAREN));
}
} else if (_matches(TokenType.OPEN_PAREN)) {
@@ -5842,8 +6030,13 @@ class Parser {
// reportError(ParserErrorCode.UNEXPECTED_TOKEN, currentToken.getLexeme());
// advance();
// }
- return new FunctionDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, returnType, keyword, name,
+ return new FunctionDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ returnType,
+ keyword,
+ name,
new FunctionExpression(typeParameters, parameters, body));
}
@@ -5912,31 +6105,50 @@ class Parser {
if (_matches(TokenType.SEMICOLON) || _matches(TokenType.EOF)) {
_reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
FormalParameterList parameters = new FormalParameterList(
- _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+ _createSyntheticToken(TokenType.OPEN_PAREN),
+ null,
+ null,
+ null,
_createSyntheticToken(TokenType.CLOSE_PAREN));
Token semicolon = _expect(TokenType.SEMICOLON);
- return new FunctionTypeAlias(commentAndMetadata.comment,
- commentAndMetadata.metadata, keyword, returnType, name,
- typeParameters, parameters, semicolon);
+ return new FunctionTypeAlias(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ keyword,
+ returnType,
+ name,
+ typeParameters,
+ parameters,
+ semicolon);
} else if (!_matches(TokenType.OPEN_PAREN)) {
_reportErrorForCurrentToken(ParserErrorCode.MISSING_TYPEDEF_PARAMETERS);
// TODO(brianwilkerson) Recover from this error. At the very least we
// should skip to the start of the next valid compilation unit member,
// allowing for the possibility of finding the typedef parameters before
// that point.
- return new FunctionTypeAlias(commentAndMetadata.comment,
- commentAndMetadata.metadata, keyword, returnType, name,
- typeParameters, new FormalParameterList(
- _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
- _createSyntheticToken(TokenType.CLOSE_PAREN)),
+ return new FunctionTypeAlias(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ keyword,
+ returnType,
+ name,
+ typeParameters,
+ new FormalParameterList(_createSyntheticToken(TokenType.OPEN_PAREN),
+ null, null, null, _createSyntheticToken(TokenType.CLOSE_PAREN)),
_createSyntheticToken(TokenType.SEMICOLON));
}
FormalParameterList parameters = parseFormalParameterList();
_validateFormalParameterList(parameters);
Token semicolon = _expect(TokenType.SEMICOLON);
- return new FunctionTypeAlias(commentAndMetadata.comment,
- commentAndMetadata.metadata, keyword, returnType, name, typeParameters,
- parameters, semicolon);
+ return new FunctionTypeAlias(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ keyword,
+ returnType,
+ name,
+ typeParameters,
+ parameters,
+ semicolon);
}
/**
@@ -5965,13 +6177,23 @@ class Parser {
}
FunctionBody body = _parseFunctionBody(
externalKeyword != null || staticKeyword == null,
- ParserErrorCode.STATIC_GETTER_WITHOUT_BODY, false);
+ ParserErrorCode.STATIC_GETTER_WITHOUT_BODY,
+ false);
if (externalKeyword != null && body is! EmptyFunctionBody) {
_reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_GETTER_WITH_BODY);
}
- return new MethodDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
- propertyKeyword, null, name, null, null, body);
+ return new MethodDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ staticKeyword,
+ returnType,
+ propertyKeyword,
+ null,
+ name,
+ null,
+ null,
+ body);
}
/**
@@ -6053,9 +6275,16 @@ class Parser {
}
List<Combinator> combinators = _parseCombinators();
Token semicolon = _expectSemicolon();
- return new ImportDirective(commentAndMetadata.comment,
- commentAndMetadata.metadata, importKeyword, libraryUri, deferredToken,
- asToken, prefix, combinators, semicolon);
+ return new ImportDirective(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ importKeyword,
+ libraryUri,
+ deferredToken,
+ asToken,
+ prefix,
+ combinators,
+ semicolon);
}
/**
@@ -6078,12 +6307,17 @@ class Parser {
* identifier ('=' expression)?
*/
FieldDeclaration _parseInitializedIdentifierList(
- CommentAndMetadata commentAndMetadata, Token staticKeyword, Token keyword,
+ CommentAndMetadata commentAndMetadata,
+ Token staticKeyword,
+ Token keyword,
TypeName type) {
VariableDeclarationList fieldList =
_parseVariableDeclarationListAfterType(null, keyword, type);
- return new FieldDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, staticKeyword, fieldList,
+ return new FieldDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ staticKeyword,
+ fieldList,
_expect(TokenType.SEMICOLON));
}
@@ -6161,7 +6395,8 @@ class Parser {
// may be empty list literal
if (_matches(TokenType.INDEX)) {
BeginToken leftBracket = _createToken(
- _currentToken, TokenType.OPEN_SQUARE_BRACKET, isBegin: true);
+ _currentToken, TokenType.OPEN_SQUARE_BRACKET,
+ isBegin: true);
Token rightBracket =
new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1);
leftBracket.endToken = rightBracket;
@@ -6219,8 +6454,11 @@ class Parser {
return _parseListLiteral(modifier, typeArguments);
}
_reportErrorForCurrentToken(ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL);
- return new ListLiteral(modifier, typeArguments,
- _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET), null,
+ return new ListLiteral(
+ modifier,
+ typeArguments,
+ _createSyntheticToken(TokenType.OPEN_SQUARE_BRACKET),
+ null,
_createSyntheticToken(TokenType.CLOSE_SQUARE_BRACKET));
}
@@ -6290,12 +6528,17 @@ class Parser {
* | 'external'? functionSignature ';'
*/
MethodDeclaration _parseMethodDeclarationAfterParameters(
- CommentAndMetadata commentAndMetadata, Token externalKeyword,
- Token staticKeyword, TypeName returnType, SimpleIdentifier name,
- TypeParameterList typeParameters, FormalParameterList parameters) {
+ CommentAndMetadata commentAndMetadata,
+ Token externalKeyword,
+ Token staticKeyword,
+ TypeName returnType,
+ SimpleIdentifier name,
+ TypeParameterList typeParameters,
+ FormalParameterList parameters) {
FunctionBody body = _parseFunctionBody(
externalKeyword != null || staticKeyword == null,
- ParserErrorCode.MISSING_FUNCTION_BODY, false);
+ ParserErrorCode.MISSING_FUNCTION_BODY,
+ false);
if (externalKeyword != null) {
if (body is! EmptyFunctionBody) {
_reportErrorForNode(ParserErrorCode.EXTERNAL_METHOD_WITH_BODY, body);
@@ -6305,9 +6548,18 @@ class Parser {
_reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body);
}
}
- return new MethodDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
- null, null, name, typeParameters, parameters, body);
+ return new MethodDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ staticKeyword,
+ returnType,
+ null,
+ null,
+ name,
+ typeParameters,
+ parameters,
+ body);
}
/**
@@ -6323,8 +6575,10 @@ class Parser {
* | 'external'? functionSignature ';'
*/
MethodDeclaration _parseMethodDeclarationAfterReturnType(
- CommentAndMetadata commentAndMetadata, Token externalKeyword,
- Token staticKeyword, TypeName returnType) {
+ CommentAndMetadata commentAndMetadata,
+ Token externalKeyword,
+ Token staticKeyword,
+ TypeName returnType) {
SimpleIdentifier methodName = parseSimpleIdentifier();
TypeParameterList typeParameters = null;
if (parseGenericMethods && _matches(TokenType.LT)) {
@@ -6337,14 +6591,22 @@ class Parser {
_reportErrorForToken(
ParserErrorCode.MISSING_METHOD_PARAMETERS, _currentToken.previous);
parameters = new FormalParameterList(
- _createSyntheticToken(TokenType.OPEN_PAREN), null, null, null,
+ _createSyntheticToken(TokenType.OPEN_PAREN),
+ null,
+ null,
+ null,
_createSyntheticToken(TokenType.CLOSE_PAREN));
} else {
parameters = parseFormalParameterList();
}
_validateFormalParameterList(parameters);
- return _parseMethodDeclarationAfterParameters(commentAndMetadata,
- externalKeyword, staticKeyword, returnType, methodName, typeParameters,
+ return _parseMethodDeclarationAfterParameters(
+ commentAndMetadata,
+ externalKeyword,
+ staticKeyword,
+ returnType,
+ methodName,
+ typeParameters,
parameters);
}
@@ -6552,10 +6814,10 @@ class Parser {
TypeName returnType = parseReturnType();
if (_matchesIdentifier() &&
_peek().matchesAny([
- TokenType.OPEN_PAREN,
- TokenType.OPEN_CURLY_BRACKET,
- TokenType.FUNCTION
- ])) {
+ TokenType.OPEN_PAREN,
+ TokenType.OPEN_CURLY_BRACKET,
+ TokenType.FUNCTION
+ ])) {
return _parseFunctionDeclarationStatementAfterReturnType(
commentAndMetadata, returnType);
} else {
@@ -6699,9 +6961,18 @@ class Parser {
if (externalKeyword != null && body is! EmptyFunctionBody) {
_reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY);
}
- return new MethodDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, null, returnType, null,
- operatorKeyword, name, null, parameters, body);
+ return new MethodDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ null,
+ returnType,
+ null,
+ operatorKeyword,
+ name,
+ null,
+ parameters,
+ body);
}
/**
@@ -6746,8 +7017,12 @@ class Parser {
LibraryIdentifier libraryName = _parseLibraryName(
ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, ofKeyword);
Token semicolon = _expect(TokenType.SEMICOLON);
- return new PartOfDirective(commentAndMetadata.comment,
- commentAndMetadata.metadata, partKeyword, ofKeyword, libraryName,
+ return new PartOfDirective(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ partKeyword,
+ ofKeyword,
+ libraryName,
semicolon);
}
StringLiteral partUri = _parseUri();
@@ -6836,7 +7111,8 @@ class Parser {
// TODO(paulberry): verify with Gilad that "super" must be followed by
// unconditionalAssignableSelector in this case.
return _parseAssignableSelector(
- new SuperExpression(getAndAdvance()), false, allowConditional: false);
+ new SuperExpression(getAndAdvance()), false,
+ allowConditional: false);
} else if (_matchesKeyword(Keyword.NULL)) {
return new NullLiteral(getAndAdvance());
} else if (_matchesKeyword(Keyword.FALSE)) {
@@ -7039,13 +7315,23 @@ class Parser {
_validateFormalParameterList(parameters);
FunctionBody body = _parseFunctionBody(
externalKeyword != null || staticKeyword == null,
- ParserErrorCode.STATIC_SETTER_WITHOUT_BODY, false);
+ ParserErrorCode.STATIC_SETTER_WITHOUT_BODY,
+ false);
if (externalKeyword != null && body is! EmptyFunctionBody) {
_reportErrorForCurrentToken(ParserErrorCode.EXTERNAL_SETTER_WITH_BODY);
}
- return new MethodDeclaration(commentAndMetadata.comment,
- commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType,
- propertyKeyword, null, name, null, parameters, body);
+ return new MethodDeclaration(
+ commentAndMetadata.comment,
+ commentAndMetadata.metadata,
+ externalKeyword,
+ staticKeyword,
+ returnType,
+ propertyKeyword,
+ null,
+ name,
+ null,
+ parameters,
+ body);
}
/**
@@ -7195,7 +7481,8 @@ class Parser {
if (definedLabels.contains(label)) {
_reportErrorForToken(
ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT,
- identifier.token, [label]);
+ identifier.token,
+ [label]);
} else {
definedLabels.add(label);
}
@@ -7353,9 +7640,16 @@ class Parser {
rightParenthesis = _expect(TokenType.CLOSE_PAREN);
}
Block catchBody = parseBlock();
- catchClauses.add(new CatchClause(onKeyword, exceptionType, catchKeyword,
- leftParenthesis, exceptionParameter, comma, stackTraceParameter,
- rightParenthesis, catchBody));
+ catchClauses.add(new CatchClause(
+ onKeyword,
+ exceptionType,
+ catchKeyword,
+ leftParenthesis,
+ exceptionParameter,
+ comma,
+ stackTraceParameter,
+ rightParenthesis,
+ catchBody));
}
Token finallyKeyword = null;
if (_matchesKeyword(Keyword.FINALLY)) {
@@ -7468,8 +7762,10 @@ class Parser {
secondOperator.setNext(_currentToken);
firstOperator.setNext(secondOperator);
operator.previous.setNext(firstOperator);
- return new PrefixExpression(firstOperator, new PrefixExpression(
- secondOperator, new SuperExpression(getAndAdvance())));
+ return new PrefixExpression(
+ firstOperator,
+ new PrefixExpression(
+ secondOperator, new SuperExpression(getAndAdvance())));
} else {
// Invalid operator before 'super'
_reportErrorForCurrentToken(
@@ -7608,7 +7904,9 @@ class Parser {
return new VariableDeclarationList(
commentAndMetadata != null ? commentAndMetadata.comment : null,
commentAndMetadata != null ? commentAndMetadata.metadata : null,
- keyword, type, variables);
+ keyword,
+ type,
+ variables);
}
/**
@@ -7867,10 +8165,10 @@ class Parser {
// that should only occur at the beginning of a parameter list.
//
if (next.matchesAny([
- TokenType.AT,
- TokenType.OPEN_SQUARE_BRACKET,
- TokenType.OPEN_CURLY_BRACKET
- ]) ||
+ TokenType.AT,
+ TokenType.OPEN_SQUARE_BRACKET,
+ TokenType.OPEN_CURLY_BRACKET
+ ]) ||
_tokenMatchesKeyword(next, Keyword.VOID) ||
(_tokenMatchesIdentifier(next) &&
(next.next.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN])))) {
@@ -8350,20 +8648,15 @@ class Parser {
} else {
_appendScalarValue(
buffer,
- lexeme
- .substring(
- index,
- currentIndex + 1),
+ lexeme.substring(index, currentIndex + 1),
(((((Character.digit(firstDigit, 16) << 4) +
Character.digit(secondDigit, 16)) <<
4) +
Character.digit(thirdDigit, 16)) <<
4) +
- Character
- .digit(fourthDigit, 16),
+ Character.digit(fourthDigit, 16),
index,
- currentIndex +
- 3);
+ currentIndex + 3);
}
return currentIndex + 4;
}
@@ -8705,6 +8998,7 @@ class Parser {
}
}
}
+
/**
* A synthetic keyword token.
*/
@@ -8933,7 +9227,8 @@ class ParserErrorCode extends ErrorCode {
"Top-level declarations cannot be declared to be 'factory'");
static const ParserErrorCode FACTORY_WITH_INITIALIZERS =
- const ParserErrorCode('FACTORY_WITH_INITIALIZERS',
+ const ParserErrorCode(
+ 'FACTORY_WITH_INITIALIZERS',
"A 'factory' constructor cannot have initializers",
"Either remove the 'factory' keyword to make this a generative "
"constructor or remove the initializers.");
@@ -9202,7 +9497,8 @@ class ParserErrorCode extends ErrorCode {
"The part-of directive must be the only directive in a part");
static const ParserErrorCode NON_STRING_LITERAL_AS_URI =
- const ParserErrorCode('NON_STRING_LITERAL_AS_URI',
+ const ParserErrorCode(
+ 'NON_STRING_LITERAL_AS_URI',
"The URI must be a string literal",
"Enclose the URI in either single or double quotes.");
@@ -9365,7 +9661,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitAnnotation(Annotation node) {
Annotation toNode = this._toNode as Annotation;
- if (_and(_isEqualTokens(node.atSign, toNode.atSign),
+ if (_and(
+ _isEqualTokens(node.atSign, toNode.atSign),
_isEqualNodes(node.name, toNode.name),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.constructorName, toNode.constructorName),
@@ -9379,7 +9676,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitArgumentList(ArgumentList node) {
ArgumentList toNode = this._toNode as ArgumentList;
- return _and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+ return _and(
+ _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodeLists(node.arguments, toNode.arguments),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis));
}
@@ -9387,7 +9685,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitAsExpression(AsExpression node) {
AsExpression toNode = this._toNode as AsExpression;
- if (_and(_isEqualNodes(node.expression, toNode.expression),
+ if (_and(
+ _isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.asOperator, toNode.asOperator),
_isEqualNodes(node.type, toNode.type))) {
toNode.propagatedType = node.propagatedType;
@@ -9400,7 +9699,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitAssertStatement(AssertStatement node) {
AssertStatement toNode = this._toNode as AssertStatement;
- return _and(_isEqualTokens(node.assertKeyword, toNode.assertKeyword),
+ return _and(
+ _isEqualTokens(node.assertKeyword, toNode.assertKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.condition, toNode.condition),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -9410,7 +9710,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitAssignmentExpression(AssignmentExpression node) {
AssignmentExpression toNode = this._toNode as AssignmentExpression;
- if (_and(_isEqualNodes(node.leftHandSide, toNode.leftHandSide),
+ if (_and(
+ _isEqualNodes(node.leftHandSide, toNode.leftHandSide),
_isEqualTokens(node.operator, toNode.operator),
_isEqualNodes(node.rightHandSide, toNode.rightHandSide))) {
toNode.propagatedElement = node.propagatedElement;
@@ -9437,7 +9738,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitBinaryExpression(BinaryExpression node) {
BinaryExpression toNode = this._toNode as BinaryExpression;
- if (_and(_isEqualNodes(node.leftOperand, toNode.leftOperand),
+ if (_and(
+ _isEqualNodes(node.leftOperand, toNode.leftOperand),
_isEqualTokens(node.operator, toNode.operator),
_isEqualNodes(node.rightOperand, toNode.rightOperand))) {
toNode.propagatedElement = node.propagatedElement;
@@ -9452,7 +9754,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitBlock(Block node) {
Block toNode = this._toNode as Block;
- return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+ return _and(
+ _isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.statements, toNode.statements),
_isEqualTokens(node.rightBracket, toNode.rightBracket));
}
@@ -9478,7 +9781,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitBreakStatement(BreakStatement node) {
BreakStatement toNode = this._toNode as BreakStatement;
- if (_and(_isEqualTokens(node.breakKeyword, toNode.breakKeyword),
+ if (_and(
+ _isEqualTokens(node.breakKeyword, toNode.breakKeyword),
_isEqualNodes(node.label, toNode.label),
_isEqualTokens(node.semicolon, toNode.semicolon))) {
// TODO(paulberry): map node.target to toNode.target.
@@ -9502,7 +9806,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitCatchClause(CatchClause node) {
CatchClause toNode = this._toNode as CatchClause;
- return _and(_isEqualTokens(node.onKeyword, toNode.onKeyword),
+ return _and(
+ _isEqualTokens(node.onKeyword, toNode.onKeyword),
_isEqualNodes(node.exceptionType, toNode.exceptionType),
_isEqualTokens(node.catchKeyword, toNode.catchKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -9564,7 +9869,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitCompilationUnit(CompilationUnit node) {
CompilationUnit toNode = this._toNode as CompilationUnit;
- if (_and(_isEqualTokens(node.beginToken, toNode.beginToken),
+ if (_and(
+ _isEqualTokens(node.beginToken, toNode.beginToken),
_isEqualNodes(node.scriptTag, toNode.scriptTag),
_isEqualNodeLists(node.directives, toNode.directives),
_isEqualNodeLists(node.declarations, toNode.declarations),
@@ -9578,7 +9884,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitConditionalExpression(ConditionalExpression node) {
ConditionalExpression toNode = this._toNode as ConditionalExpression;
- if (_and(_isEqualNodes(node.condition, toNode.condition),
+ if (_and(
+ _isEqualNodes(node.condition, toNode.condition),
_isEqualTokens(node.question, toNode.question),
_isEqualNodes(node.thenExpression, toNode.thenExpression),
_isEqualTokens(node.colon, toNode.colon),
@@ -9617,7 +9924,8 @@ class ResolutionCopier implements AstVisitor<bool> {
bool visitConstructorFieldInitializer(ConstructorFieldInitializer node) {
ConstructorFieldInitializer toNode =
this._toNode as ConstructorFieldInitializer;
- return _and(_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
+ return _and(
+ _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.fieldName, toNode.fieldName),
_isEqualTokens(node.equals, toNode.equals),
@@ -9627,7 +9935,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitConstructorName(ConstructorName node) {
ConstructorName toNode = this._toNode as ConstructorName;
- if (_and(_isEqualNodes(node.type, toNode.type),
+ if (_and(
+ _isEqualNodes(node.type, toNode.type),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.name, toNode.name))) {
toNode.staticElement = node.staticElement;
@@ -9639,7 +9948,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitContinueStatement(ContinueStatement node) {
ContinueStatement toNode = this._toNode as ContinueStatement;
- if (_and(_isEqualTokens(node.continueKeyword, toNode.continueKeyword),
+ if (_and(
+ _isEqualTokens(node.continueKeyword, toNode.continueKeyword),
_isEqualNodes(node.label, toNode.label),
_isEqualTokens(node.semicolon, toNode.semicolon))) {
// TODO(paulberry): map node.target to toNode.target.
@@ -9662,7 +9972,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitDefaultFormalParameter(DefaultFormalParameter node) {
DefaultFormalParameter toNode = this._toNode as DefaultFormalParameter;
- return _and(_isEqualNodes(node.parameter, toNode.parameter),
+ return _and(
+ _isEqualNodes(node.parameter, toNode.parameter),
node.kind == toNode.kind,
_isEqualTokens(node.separator, toNode.separator),
_isEqualNodes(node.defaultValue, toNode.defaultValue));
@@ -9671,7 +9982,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitDoStatement(DoStatement node) {
DoStatement toNode = this._toNode as DoStatement;
- return _and(_isEqualTokens(node.doKeyword, toNode.doKeyword),
+ return _and(
+ _isEqualTokens(node.doKeyword, toNode.doKeyword),
_isEqualNodes(node.body, toNode.body),
_isEqualTokens(node.whileKeyword, toNode.whileKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
@@ -9792,7 +10104,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitForEachStatement(ForEachStatement node) {
ForEachStatement toNode = this._toNode as ForEachStatement;
- return _and(_isEqualTokens(node.forKeyword, toNode.forKeyword),
+ return _and(
+ _isEqualTokens(node.forKeyword, toNode.forKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.loopVariable, toNode.loopVariable),
_isEqualTokens(node.inKeyword, toNode.inKeyword),
@@ -9804,7 +10117,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitFormalParameterList(FormalParameterList node) {
FormalParameterList toNode = this._toNode as FormalParameterList;
- return _and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+ return _and(
+ _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodeLists(node.parameters, toNode.parameters),
_isEqualTokens(node.leftDelimiter, toNode.leftDelimiter),
_isEqualTokens(node.rightDelimiter, toNode.rightDelimiter),
@@ -9814,7 +10128,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitForStatement(ForStatement node) {
ForStatement toNode = this._toNode as ForStatement;
- return _and(_isEqualTokens(node.forKeyword, toNode.forKeyword),
+ return _and(
+ _isEqualTokens(node.forKeyword, toNode.forKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.variables, toNode.variables),
_isEqualNodes(node.initialization, toNode.initialization),
@@ -9910,7 +10225,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitIfStatement(IfStatement node) {
IfStatement toNode = this._toNode as IfStatement;
- return _and(_isEqualTokens(node.ifKeyword, toNode.ifKeyword),
+ return _and(
+ _isEqualTokens(node.ifKeyword, toNode.ifKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.condition, toNode.condition),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -9948,7 +10264,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitIndexExpression(IndexExpression node) {
IndexExpression toNode = this._toNode as IndexExpression;
- if (_and(_isEqualNodes(node.target, toNode.target),
+ if (_and(
+ _isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodes(node.index, toNode.index),
_isEqualTokens(node.rightBracket, toNode.rightBracket))) {
@@ -9966,7 +10283,8 @@ class ResolutionCopier implements AstVisitor<bool> {
bool visitInstanceCreationExpression(InstanceCreationExpression node) {
InstanceCreationExpression toNode =
this._toNode as InstanceCreationExpression;
- if (_and(_isEqualTokens(node.keyword, toNode.keyword),
+ if (_and(
+ _isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodes(node.constructorName, toNode.constructorName),
_isEqualNodes(node.argumentList, toNode.argumentList))) {
toNode.propagatedType = node.propagatedType;
@@ -9992,7 +10310,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitInterpolationExpression(InterpolationExpression node) {
InterpolationExpression toNode = this._toNode as InterpolationExpression;
- return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+ return _and(
+ _isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.rightBracket, toNode.rightBracket));
}
@@ -10007,7 +10326,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitIsExpression(IsExpression node) {
IsExpression toNode = this._toNode as IsExpression;
- if (_and(_isEqualNodes(node.expression, toNode.expression),
+ if (_and(
+ _isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.isOperator, toNode.isOperator),
_isEqualTokens(node.notOperator, toNode.notOperator),
_isEqualNodes(node.type, toNode.type))) {
@@ -10061,7 +10381,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitListLiteral(ListLiteral node) {
ListLiteral toNode = this._toNode as ListLiteral;
- if (_and(_isEqualTokens(node.constKeyword, toNode.constKeyword),
+ if (_and(
+ _isEqualTokens(node.constKeyword, toNode.constKeyword),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.elements, toNode.elements),
@@ -10076,7 +10397,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitMapLiteral(MapLiteral node) {
MapLiteral toNode = this._toNode as MapLiteral;
- if (_and(_isEqualTokens(node.constKeyword, toNode.constKeyword),
+ if (_and(
+ _isEqualTokens(node.constKeyword, toNode.constKeyword),
_isEqualNodes(node.typeArguments, toNode.typeArguments),
_isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.entries, toNode.entries),
@@ -10091,7 +10413,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitMapLiteralEntry(MapLiteralEntry node) {
MapLiteralEntry toNode = this._toNode as MapLiteralEntry;
- return _and(_isEqualNodes(node.key, toNode.key),
+ return _and(
+ _isEqualNodes(node.key, toNode.key),
_isEqualTokens(node.separator, toNode.separator),
_isEqualNodes(node.value, toNode.value));
}
@@ -10115,7 +10438,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitMethodInvocation(MethodInvocation node) {
MethodInvocation toNode = this._toNode as MethodInvocation;
- if (_and(_isEqualNodes(node.target, toNode.target),
+ if (_and(
+ _isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.operator, toNode.operator),
_isEqualNodes(node.methodName, toNode.methodName),
_isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10148,7 +10472,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitNativeFunctionBody(NativeFunctionBody node) {
NativeFunctionBody toNode = this._toNode as NativeFunctionBody;
- return _and(_isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
+ return _and(
+ _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword),
_isEqualNodes(node.stringLiteral, toNode.stringLiteral),
_isEqualTokens(node.semicolon, toNode.semicolon));
}
@@ -10167,7 +10492,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitParenthesizedExpression(ParenthesizedExpression node) {
ParenthesizedExpression toNode = this._toNode as ParenthesizedExpression;
- if (_and(_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
+ if (_and(
+ _isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis))) {
toNode.propagatedType = node.propagatedType;
@@ -10225,7 +10551,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitPrefixedIdentifier(PrefixedIdentifier node) {
PrefixedIdentifier toNode = this._toNode as PrefixedIdentifier;
- if (_and(_isEqualNodes(node.prefix, toNode.prefix),
+ if (_and(
+ _isEqualNodes(node.prefix, toNode.prefix),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.identifier, toNode.identifier))) {
toNode.propagatedType = node.propagatedType;
@@ -10252,7 +10579,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitPropertyAccess(PropertyAccess node) {
PropertyAccess toNode = this._toNode as PropertyAccess;
- if (_and(_isEqualNodes(node.target, toNode.target),
+ if (_and(
+ _isEqualNodes(node.target, toNode.target),
_isEqualTokens(node.operator, toNode.operator),
_isEqualNodes(node.propertyName, toNode.propertyName))) {
toNode.propagatedType = node.propagatedType;
@@ -10267,7 +10595,8 @@ class ResolutionCopier implements AstVisitor<bool> {
RedirectingConstructorInvocation node) {
RedirectingConstructorInvocation toNode =
this._toNode as RedirectingConstructorInvocation;
- if (_and(_isEqualTokens(node.thisKeyword, toNode.thisKeyword),
+ if (_and(
+ _isEqualTokens(node.thisKeyword, toNode.thisKeyword),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.constructorName, toNode.constructorName),
_isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10291,7 +10620,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitReturnStatement(ReturnStatement node) {
ReturnStatement toNode = this._toNode as ReturnStatement;
- return _and(_isEqualTokens(node.returnKeyword, toNode.returnKeyword),
+ return _and(
+ _isEqualTokens(node.returnKeyword, toNode.returnKeyword),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.semicolon, toNode.semicolon));
}
@@ -10361,7 +10691,8 @@ class ResolutionCopier implements AstVisitor<bool> {
bool visitSuperConstructorInvocation(SuperConstructorInvocation node) {
SuperConstructorInvocation toNode =
this._toNode as SuperConstructorInvocation;
- if (_and(_isEqualTokens(node.superKeyword, toNode.superKeyword),
+ if (_and(
+ _isEqualTokens(node.superKeyword, toNode.superKeyword),
_isEqualTokens(node.period, toNode.period),
_isEqualNodes(node.constructorName, toNode.constructorName),
_isEqualNodes(node.argumentList, toNode.argumentList))) {
@@ -10385,7 +10716,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitSwitchCase(SwitchCase node) {
SwitchCase toNode = this._toNode as SwitchCase;
- return _and(_isEqualNodeLists(node.labels, toNode.labels),
+ return _and(
+ _isEqualNodeLists(node.labels, toNode.labels),
_isEqualTokens(node.keyword, toNode.keyword),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.colon, toNode.colon),
@@ -10395,7 +10727,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitSwitchDefault(SwitchDefault node) {
SwitchDefault toNode = this._toNode as SwitchDefault;
- return _and(_isEqualNodeLists(node.labels, toNode.labels),
+ return _and(
+ _isEqualNodeLists(node.labels, toNode.labels),
_isEqualTokens(node.keyword, toNode.keyword),
_isEqualTokens(node.colon, toNode.colon),
_isEqualNodeLists(node.statements, toNode.statements));
@@ -10404,7 +10737,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitSwitchStatement(SwitchStatement node) {
SwitchStatement toNode = this._toNode as SwitchStatement;
- return _and(_isEqualTokens(node.switchKeyword, toNode.switchKeyword),
+ return _and(
+ _isEqualTokens(node.switchKeyword, toNode.switchKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -10462,7 +10796,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitTryStatement(TryStatement node) {
TryStatement toNode = this._toNode as TryStatement;
- return _and(_isEqualTokens(node.tryKeyword, toNode.tryKeyword),
+ return _and(
+ _isEqualTokens(node.tryKeyword, toNode.tryKeyword),
_isEqualNodes(node.body, toNode.body),
_isEqualNodeLists(node.catchClauses, toNode.catchClauses),
_isEqualTokens(node.finallyKeyword, toNode.finallyKeyword),
@@ -10472,7 +10807,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitTypeArgumentList(TypeArgumentList node) {
TypeArgumentList toNode = this._toNode as TypeArgumentList;
- return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+ return _and(
+ _isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.arguments, toNode.arguments),
_isEqualTokens(node.rightBracket, toNode.rightBracket));
}
@@ -10502,7 +10838,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitTypeParameterList(TypeParameterList node) {
TypeParameterList toNode = this._toNode as TypeParameterList;
- return _and(_isEqualTokens(node.leftBracket, toNode.leftBracket),
+ return _and(
+ _isEqualTokens(node.leftBracket, toNode.leftBracket),
_isEqualNodeLists(node.typeParameters, toNode.typeParameters),
_isEqualTokens(node.rightBracket, toNode.rightBracket));
}
@@ -10540,7 +10877,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitWhileStatement(WhileStatement node) {
WhileStatement toNode = this._toNode as WhileStatement;
- return _and(_isEqualTokens(node.whileKeyword, toNode.whileKeyword),
+ return _and(
+ _isEqualTokens(node.whileKeyword, toNode.whileKeyword),
_isEqualTokens(node.leftParenthesis, toNode.leftParenthesis),
_isEqualNodes(node.condition, toNode.condition),
_isEqualTokens(node.rightParenthesis, toNode.rightParenthesis),
@@ -10557,7 +10895,8 @@ class ResolutionCopier implements AstVisitor<bool> {
@override
bool visitYieldStatement(YieldStatement node) {
YieldStatement toNode = this._toNode as YieldStatement;
- return _and(_isEqualTokens(node.yieldKeyword, toNode.yieldKeyword),
+ return _and(
+ _isEqualTokens(node.yieldKeyword, toNode.yieldKeyword),
_isEqualNodes(node.expression, toNode.expression),
_isEqualTokens(node.semicolon, toNode.semicolon));
}
@@ -10565,9 +10904,18 @@ class ResolutionCopier implements AstVisitor<bool> {
/**
* Return `true` if all of the parameters are `true`.
*/
- bool _and(bool b1, bool b2, [bool b3 = true, bool b4 = true, bool b5 = true,
- bool b6 = true, bool b7 = true, bool b8 = true, bool b9 = true,
- bool b10 = true, bool b11 = true, bool b12 = true, bool b13 = true]) {
+ bool _and(bool b1, bool b2,
+ [bool b3 = true,
+ bool b4 = true,
+ bool b5 = true,
+ bool b6 = true,
+ bool b7 = true,
+ bool b8 = true,
+ bool b9 = true,
+ bool b10 = true,
+ bool b11 = true,
+ bool b12 = true,
+ bool b13 = true]) {
// TODO(brianwilkerson) Inline this method.
return b1 &&
b2 &&
« no previous file with comments | « pkg/analyzer/lib/src/generated/java_engine.dart ('k') | pkg/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698