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 ed1c3b1a7a5fd4d035cda1f04ad3fa4021dbe5fe..2ecf17e26bcb85697c2500a03cbfd138b647f8cb 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -22,603 +22,404 @@ import 'utilities_dart.dart'; |
Map<String, MethodTrampoline> methodTable_Parser = <String, MethodTrampoline>{ |
'parseCompilationUnit_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseCompilationUnit(arg0)), |
+ 1, (Parser target, arg0) => target.parseCompilationUnit(arg0)), |
'parseDirectives_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseDirectives(arg0)), |
+ 1, (Parser target, arg0) => target.parseDirectives(arg0)), |
'parseExpression_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseExpression(arg0)), |
+ 1, (Parser target, arg0) => target.parseExpression(arg0)), |
'parseStatement_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseStatement(arg0)), |
+ 1, (Parser target, arg0) => target.parseStatement(arg0)), |
'parseStatements_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseStatements(arg0)), |
- 'parseAnnotation_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseAnnotation()), |
- 'parseArgument_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseArgument()), |
- 'parseArgumentList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseArgumentList()), |
+ 1, (Parser target, arg0) => target.parseStatements(arg0)), |
+ 'parseAnnotation_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseAnnotation()), |
+ 'parseArgument_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseArgument()), |
+ 'parseArgumentList_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseArgumentList()), |
'parseBitwiseOrExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseBitwiseOrExpression()), |
- 'parseBlock_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseBlock()), |
+ 0, (Parser target) => target.parseBitwiseOrExpression()), |
+ 'parseBlock_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseBlock()), |
'parseClassMember_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target.parseClassMember(arg0)), |
+ 1, (Parser target, arg0) => target.parseClassMember(arg0)), |
'parseCompilationUnit_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseCompilationUnit2()), |
+ 0, (Parser target) => target.parseCompilationUnit2()), |
'parseConditionalExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseConditionalExpression()), |
- 'parseConstructorName_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseConstructorName()), |
- 'parseExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseExpression2()), |
+ 0, (Parser target) => target.parseConditionalExpression()), |
+ 'parseConstructorName_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseConstructorName()), |
+ 'parseExpression_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseExpression2()), |
'parseExpressionWithoutCascade_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseExpressionWithoutCascade()), |
- 'parseExtendsClause_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseExtendsClause()), |
+ 0, (Parser target) => target.parseExpressionWithoutCascade()), |
+ 'parseExtendsClause_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseExtendsClause()), |
'parseFormalParameterList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseFormalParameterList()), |
+ 0, (Parser target) => target.parseFormalParameterList()), |
'parseFunctionExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseFunctionExpression()), |
+ 0, (Parser target) => target.parseFunctionExpression()), |
'parseImplementsClause_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseImplementsClause()), |
- 'parseLabel_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseLabel()), |
+ 0, (Parser target) => target.parseImplementsClause()), |
+ 'parseLabel_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseLabel()), |
'parseLibraryIdentifier_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseLibraryIdentifier()), |
+ 0, (Parser target) => target.parseLibraryIdentifier()), |
'parseLogicalOrExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseLogicalOrExpression()), |
- 'parseMapLiteralEntry_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseMapLiteralEntry()), |
+ 0, (Parser target) => target.parseLogicalOrExpression()), |
+ 'parseMapLiteralEntry_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseMapLiteralEntry()), |
'parseNormalFormalParameter_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseNormalFormalParameter()), |
+ 0, (Parser target) => target.parseNormalFormalParameter()), |
'parsePrefixedIdentifier_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parsePrefixedIdentifier()), |
- 'parseReturnType_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseReturnType()), |
+ 0, (Parser target) => target.parsePrefixedIdentifier()), |
+ 'parseReturnType_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseReturnType()), |
'parseSimpleIdentifier_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseSimpleIdentifier()), |
- 'parseStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseStatement2()), |
- 'parseStringLiteral_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseStringLiteral()), |
+ 0, (Parser target) => target.parseSimpleIdentifier()), |
+ 'parseStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseStatement2()), |
+ 'parseStringLiteral_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseStringLiteral()), |
'parseTypeArgumentList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseTypeArgumentList()), |
- 'parseTypeName_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseTypeName()), |
- 'parseTypeParameter_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseTypeParameter()), |
+ 0, (Parser target) => target.parseTypeArgumentList()), |
+ 'parseTypeName_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseTypeName()), |
+ 'parseTypeParameter_0': |
+ new MethodTrampoline(0, (Parser target) => target.parseTypeParameter()), |
'parseTypeParameterList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseTypeParameterList()), |
- 'parseWithClause_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseWithClause()), |
+ 0, (Parser target) => target.parseTypeParameterList()), |
+ '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)), |
+ 1, (Parser target, arg0) => target._convertToFunctionDeclaration(arg0)), |
'couldBeStartOfCompilationUnitMember_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._couldBeStartOfCompilationUnitMember()), |
+ 0, (Parser target) => target._couldBeStartOfCompilationUnitMember()), |
'createSyntheticIdentifier_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._createSyntheticIdentifier()), |
+ 0, (Parser target) => target._createSyntheticIdentifier()), |
'createSyntheticKeyword_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._createSyntheticKeyword(arg0)), |
+ 1, (Parser target, arg0) => target._createSyntheticKeyword(arg0)), |
'createSyntheticStringLiteral_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._createSyntheticStringLiteral()), |
+ 0, (Parser target) => target._createSyntheticStringLiteral()), |
'createSyntheticToken_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._createSyntheticToken(arg0)), |
+ 1, (Parser target, arg0) => target._createSyntheticToken(arg0)), |
'ensureAssignable_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._ensureAssignable(arg0)), |
- 'expect_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._expect(arg0)), |
+ 1, (Parser target, arg0) => target._ensureAssignable(arg0)), |
+ 'expect_1': |
+ new MethodTrampoline(1, (Parser target, arg0) => target._expect(arg0)), |
'expectGt_0': new MethodTrampoline(0, (Parser target) => target._expectGt()), |
'expectKeyword_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._expectKeyword(arg0)), |
- 'expectSemicolon_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._expectSemicolon()), |
+ 1, (Parser target, arg0) => target._expectKeyword(arg0)), |
+ 'expectSemicolon_0': |
+ new MethodTrampoline(0, (Parser target) => target._expectSemicolon()), |
'findRange_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._findRange(arg0, arg1)), |
+ 2, (Parser target, arg0, arg1) => target._findRange(arg0, arg1)), |
'getCodeBlockRanges_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._getCodeBlockRanges(arg0)), |
+ 1, (Parser target, arg0) => target._getCodeBlockRanges(arg0)), |
'getEndToken_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._getEndToken(arg0)), |
+ 1, (Parser target, arg0) => target._getEndToken(arg0)), |
'injectToken_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._injectToken(arg0)), |
+ 1, (Parser target, arg0) => target._injectToken(arg0)), |
'isFunctionDeclaration_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._isFunctionDeclaration()), |
+ 0, (Parser target) => target._isFunctionDeclaration()), |
'isFunctionExpression_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._isFunctionExpression(arg0)), |
+ 1, (Parser target, arg0) => target._isFunctionExpression(arg0)), |
'isHexDigit_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._isHexDigit(arg0)), |
+ 1, (Parser target, arg0) => target._isHexDigit(arg0)), |
'isInitializedVariableDeclaration_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._isInitializedVariableDeclaration()), |
+ 0, (Parser target) => target._isInitializedVariableDeclaration()), |
'isLinkText_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._isLinkText(arg0, arg1)), |
+ 2, (Parser target, arg0, arg1) => target._isLinkText(arg0, arg1)), |
'isOperator_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._isOperator(arg0)), |
- 'isSwitchMember_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._isSwitchMember()), |
+ 1, (Parser target, arg0) => target._isOperator(arg0)), |
+ 'isSwitchMember_0': |
+ new MethodTrampoline(0, (Parser target) => target._isSwitchMember()), |
'isTypedIdentifier_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._isTypedIdentifier(arg0)), |
- 'lockErrorListener_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._lockErrorListener()), |
- 'matches_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._matches(arg0)), |
- 'matchesGt_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._matchesGt()), |
- 'matchesIdentifier_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._matchesIdentifier()), |
+ 1, (Parser target, arg0) => target._isTypedIdentifier(arg0)), |
+ 'lockErrorListener_0': |
+ new MethodTrampoline(0, (Parser target) => target._lockErrorListener()), |
+ 'matches_1': |
+ new MethodTrampoline(1, (Parser target, arg0) => target._matches(arg0)), |
+ 'matchesGt_0': |
+ new MethodTrampoline(0, (Parser target) => target._matchesGt()), |
+ 'matchesIdentifier_0': |
+ new MethodTrampoline(0, (Parser target) => target._matchesIdentifier()), |
'matchesKeyword_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._matchesKeyword(arg0)), |
+ 1, (Parser target, arg0) => target._matchesKeyword(arg0)), |
'matchesString_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._matchesString(arg0)), |
- 'optional_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._optional(arg0)), |
+ 1, (Parser target, arg0) => target._matchesString(arg0)), |
+ 'optional_1': |
+ new MethodTrampoline(1, (Parser target, arg0) => target._optional(arg0)), |
'parseAdditiveExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseAdditiveExpression()), |
+ 0, (Parser target) => target._parseAdditiveExpression()), |
'parseAssertStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseAssertStatement()), |
+ 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)), |
+ 1, (Parser target, arg0) => target._parseAssignableExpression(arg0)), |
+ 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, |
+ arg1) => target._parseAssignableSelector(arg0, arg1)), |
'parseAwaitExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseAwaitExpression()), |
+ 0, (Parser target) => target._parseAwaitExpression()), |
'parseBitwiseAndExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseBitwiseAndExpression()), |
+ 0, (Parser target) => target._parseBitwiseAndExpression()), |
'parseBitwiseXorExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseBitwiseXorExpression()), |
- 'parseBreakStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseBreakStatement()), |
- 'parseCascadeSection_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseCascadeSection()), |
- 'parseClassDeclaration_2': new MethodTrampoline( |
- 2, |
+ 0, (Parser target) => target._parseBitwiseXorExpression()), |
+ 'parseBreakStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseBreakStatement()), |
+ 'parseCascadeSection_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseCascadeSection()), |
+ 'parseClassDeclaration_2': new MethodTrampoline(2, |
(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)), |
- 'parseCombinator_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target.parseCombinator()), |
- 'parseCombinators_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseCombinators()), |
+ 2, (Parser target, arg0, arg1) => target._parseClassMembers(arg0, arg1)), |
+ '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': |
+ new MethodTrampoline(0, (Parser target) => target._parseCombinators()), |
'parseCommentAndMetadata_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseCommentAndMetadata()), |
- 'parseCommentReference_2': new MethodTrampoline( |
- 2, |
+ 0, (Parser target) => target._parseCommentAndMetadata()), |
+ 'parseCommentReference_2': new MethodTrampoline(2, |
(Parser target, arg0, arg1) => target._parseCommentReference(arg0, arg1)), |
'parseCommentReferences_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseCommentReferences(arg0)), |
+ 1, (Parser target, arg0) => target._parseCommentReferences(arg0)), |
'parseCompilationUnitMember_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseCompilationUnitMember(arg0)), |
+ 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)), |
+ 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)), |
'parseConstructorFieldInitializer_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseConstructorFieldInitializer()), |
+ 0, (Parser target) => target._parseConstructorFieldInitializer()), |
'parseContinueStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseContinueStatement()), |
+ 0, (Parser target) => target._parseContinueStatement()), |
'parseDirective_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseDirective(arg0)), |
- 'parseDirectives_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseDirectives()), |
+ 1, (Parser target, arg0) => target._parseDirective(arg0)), |
+ 'parseDirectives_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseDirectives()), |
'parseDocumentationComment_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseDocumentationComment()), |
- 'parseDoStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseDoStatement()), |
- 'parseEmptyStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseEmptyStatement()), |
+ 0, (Parser target) => target._parseDocumentationComment()), |
+ 'parseDoStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseDoStatement()), |
+ 'parseEmptyStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseEmptyStatement()), |
'parseEnumConstantDeclaration_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseEnumConstantDeclaration()), |
+ 0, (Parser target) => target._parseEnumConstantDeclaration()), |
'parseEnumDeclaration_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseEnumDeclaration(arg0)), |
+ 1, (Parser target, arg0) => target._parseEnumDeclaration(arg0)), |
'parseEqualityExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseEqualityExpression()), |
+ 0, (Parser target) => target._parseEqualityExpression()), |
'parseExportDirective_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseExportDirective(arg0)), |
- 'parseExpressionList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseExpressionList()), |
+ 1, (Parser target, arg0) => target._parseExportDirective(arg0)), |
+ 'parseExpressionList_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseExpressionList()), |
'parseFinalConstVarOrType_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)), |
+ 1, (Parser target, arg0) => target._parseFinalConstVarOrType(arg0)), |
'parseFormalParameter_1': new 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)), |
+ 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)), |
'parseFunctionDeclarationStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseFunctionDeclarationStatement()), |
- 'parseFunctionDeclarationStatementAfterReturnType_2': new MethodTrampoline( |
- 2, |
+ 0, (Parser target) => target._parseFunctionDeclarationStatement()), |
+ '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)), |
- 'parseIdentifierList_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseIdentifierList()), |
- 'parseIfStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseIfStatement()), |
+ '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, |
+ 1, (Parser target, arg0) => target._parseImportDirective(arg0)), |
+ 'parseInitializedIdentifierList_4': new MethodTrampoline(4, |
(Parser target, arg0, arg1, arg2, arg3) => |
target._parseInitializedIdentifierList(arg0, arg1, arg2, arg3)), |
- 'parseInstanceCreationExpression_1': new MethodTrampoline( |
- 1, |
+ 'parseInstanceCreationExpression_1': new MethodTrampoline(1, |
(Parser target, arg0) => target._parseInstanceCreationExpression(arg0)), |
'parseLibraryDirective_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseLibraryDirective(arg0)), |
+ 1, (Parser target, arg0) => target._parseLibraryDirective(arg0)), |
'parseLibraryName_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._parseLibraryName(arg0, arg1)), |
+ 2, (Parser target, arg0, arg1) => target._parseLibraryName(arg0, arg1)), |
'parseListLiteral_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._parseListLiteral(arg0, arg1)), |
+ 2, (Parser target, arg0, arg1) => target._parseListLiteral(arg0, arg1)), |
'parseListOrMapLiteral_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseListOrMapLiteral(arg0)), |
+ 1, (Parser target, arg0) => target._parseListOrMapLiteral(arg0)), |
'parseLogicalAndExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseLogicalAndExpression()), |
+ 0, (Parser target) => target._parseLogicalAndExpression()), |
'parseMapLiteral_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)), |
- 'parseMethodDeclarationAfterParameters_6': new MethodTrampoline( |
- 6, |
- (Parser target, arg0, arg1, arg2, arg3, arg4, arg5) => |
- target._parseMethodDeclarationAfterParameters( |
- arg0, |
- arg1, |
- arg2, |
- arg3, |
- arg4, |
- arg5)), |
- 'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline( |
- 4, |
- (Parser target, arg0, arg1, arg2, arg3) => |
- target._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)), |
- 'parseModifiers_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseModifiers()), |
+ 2, (Parser target, arg0, arg1) => target._parseMapLiteral(arg0, arg1)), |
+ 'parseMethodDeclarationAfterParameters_6': new MethodTrampoline(6, |
+ (Parser target, arg0, arg1, arg2, arg3, arg4, arg5) => target |
+ ._parseMethodDeclarationAfterParameters( |
+ arg0, arg1, arg2, arg3, arg4, arg5)), |
+ 'parseMethodDeclarationAfterReturnType_4': new MethodTrampoline(4, |
+ (Parser target, arg0, arg1, arg2, arg3) => target |
+ ._parseMethodDeclarationAfterReturnType(arg0, arg1, arg2, arg3)), |
+ 'parseModifiers_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseModifiers()), |
'parseMultiplicativeExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseMultiplicativeExpression()), |
- 'parseNativeClause_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseNativeClause()), |
- 'parseNewExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseNewExpression()), |
+ 0, (Parser target) => target._parseMultiplicativeExpression()), |
+ 'parseNativeClause_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseNativeClause()), |
+ 'parseNewExpression_0': |
+ 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)), |
+ 0, (Parser target) => target._parseNonLabeledStatement()), |
+ 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, |
+ arg2) => target._parseOperator(arg0, arg1, arg2)), |
'parseOptionalReturnType_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseOptionalReturnType()), |
+ 0, (Parser target) => target._parseOptionalReturnType()), |
'parsePartDirective_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parsePartDirective(arg0)), |
+ 1, (Parser target, arg0) => target._parsePartDirective(arg0)), |
'parsePostfixExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parsePostfixExpression()), |
+ 0, (Parser target) => target._parsePostfixExpression()), |
'parsePrimaryExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parsePrimaryExpression()), |
+ 0, (Parser target) => target._parsePrimaryExpression()), |
'parseRedirectingConstructorInvocation_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseRedirectingConstructorInvocation()), |
+ 0, (Parser target) => target._parseRedirectingConstructorInvocation()), |
'parseRelationalExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseRelationalExpression()), |
+ 0, (Parser target) => target._parseRelationalExpression()), |
'parseRethrowExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseRethrowExpression()), |
+ 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)), |
+ 0, (Parser target) => target._parseReturnStatement()), |
+ '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': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseStatementList()), |
+ 0, (Parser target) => target._parseShiftExpression()), |
+ 'parseStatementList_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseStatementList()), |
'parseStringInterpolation_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseStringInterpolation(arg0)), |
+ 1, (Parser target, arg0) => target._parseStringInterpolation(arg0)), |
'parseSuperConstructorInvocation_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseSuperConstructorInvocation()), |
+ 0, (Parser target) => target._parseSuperConstructorInvocation()), |
'parseSwitchStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseSwitchStatement()), |
- 'parseSymbolLiteral_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseSymbolLiteral()), |
+ 0, (Parser target) => target._parseSwitchStatement()), |
+ 'parseSymbolLiteral_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseSymbolLiteral()), |
'parseThrowExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseThrowExpression()), |
+ 0, (Parser target) => target._parseThrowExpression()), |
'parseThrowExpressionWithoutCascade_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseThrowExpressionWithoutCascade()), |
- 'parseTryStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseTryStatement()), |
+ 0, (Parser target) => target._parseThrowExpressionWithoutCascade()), |
+ 'parseTryStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseTryStatement()), |
'parseTypeAlias_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._parseTypeAlias(arg0)), |
+ 1, (Parser target, arg0) => target._parseTypeAlias(arg0)), |
'parseUnaryExpression_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseUnaryExpression()), |
+ 0, (Parser target) => target._parseUnaryExpression()), |
'parseVariableDeclaration_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseVariableDeclaration()), |
- 'parseVariableDeclarationListAfterMetadata_1': new MethodTrampoline( |
- 1, |
+ 0, (Parser target) => target._parseVariableDeclaration()), |
+ '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': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseWhileStatement()), |
- 'parseYieldStatement_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._parseYieldStatement()), |
+ 'parseWhileStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseWhileStatement()), |
+ 'parseYieldStatement_0': |
+ new MethodTrampoline(0, (Parser target) => target._parseYieldStatement()), |
'peek_0': new MethodTrampoline(0, (Parser target) => target._peek()), |
- 'peekAt_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._peekAt(arg0)), |
+ 'peekAt_1': |
+ 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)), |
- 'skipBlock_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._skipBlock()), |
+ 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)), |
+ 'skipBlock_0': |
+ new MethodTrampoline(0, (Parser target) => target._skipBlock()), |
'skipFinalConstVarOrType_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipFinalConstVarOrType(arg0)), |
+ 1, (Parser target, arg0) => target._skipFinalConstVarOrType(arg0)), |
'skipFormalParameterList_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipFormalParameterList(arg0)), |
+ 1, (Parser target, arg0) => target._skipFormalParameterList(arg0)), |
'skipPastMatchingToken_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipPastMatchingToken(arg0)), |
+ 1, (Parser target, arg0) => target._skipPastMatchingToken(arg0)), |
'skipPrefixedIdentifier_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipPrefixedIdentifier(arg0)), |
+ 1, (Parser target, arg0) => target._skipPrefixedIdentifier(arg0)), |
'skipReturnType_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipReturnType(arg0)), |
+ 1, (Parser target, arg0) => target._skipReturnType(arg0)), |
'skipSimpleIdentifier_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipSimpleIdentifier(arg0)), |
+ 1, (Parser target, arg0) => target._skipSimpleIdentifier(arg0)), |
'skipStringInterpolation_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipStringInterpolation(arg0)), |
+ 1, (Parser target, arg0) => target._skipStringInterpolation(arg0)), |
'skipStringLiteral_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipStringLiteral(arg0)), |
+ 1, (Parser target, arg0) => target._skipStringLiteral(arg0)), |
'skipTypeArgumentList_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipTypeArgumentList(arg0)), |
+ 1, (Parser target, arg0) => target._skipTypeArgumentList(arg0)), |
'skipTypeName_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipTypeName(arg0)), |
+ 1, (Parser target, arg0) => target._skipTypeName(arg0)), |
'skipTypeParameterList_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._skipTypeParameterList(arg0)), |
+ 1, (Parser target, arg0) => target._skipTypeParameterList(arg0)), |
'tokenMatches_2': new MethodTrampoline( |
- 2, |
- (Parser target, arg0, arg1) => target._tokenMatches(arg0, arg1)), |
+ 2, (Parser target, arg0, arg1) => target._tokenMatches(arg0, arg1)), |
'tokenMatchesIdentifier_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._tokenMatchesIdentifier(arg0)), |
- 'tokenMatchesKeyword_2': new MethodTrampoline( |
- 2, |
+ 1, (Parser target, arg0) => target._tokenMatchesIdentifier(arg0)), |
+ 'tokenMatchesKeyword_2': new MethodTrampoline(2, |
(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)), |
- 'unlockErrorListener_0': new MethodTrampoline( |
- 0, |
- (Parser target) => target._unlockErrorListener()), |
+ 2, (Parser target, arg0, arg1) => target._tokenMatchesString(arg0, arg1)), |
+ '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( |
- 1, |
- (Parser target, arg0) => target._validateFormalParameterList(arg0)), |
+ 1, (Parser target, arg0) => target._validateFormalParameterList(arg0)), |
'validateModifiersForClass_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForClass(arg0)), |
- 'validateModifiersForConstructor_1': new MethodTrampoline( |
- 1, |
+ 1, (Parser target, arg0) => target._validateModifiersForClass(arg0)), |
+ 'validateModifiersForConstructor_1': new MethodTrampoline(1, |
(Parser target, arg0) => target._validateModifiersForConstructor(arg0)), |
'validateModifiersForEnum_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForEnum(arg0)), |
+ 1, (Parser target, arg0) => target._validateModifiersForEnum(arg0)), |
'validateModifiersForField_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForField(arg0)), |
- 'validateModifiersForFunctionDeclarationStatement_1': new MethodTrampoline( |
- 1, |
+ 1, (Parser target, arg0) => target._validateModifiersForField(arg0)), |
+ '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, |
- (Parser target, arg0) => target._validateModifiersForTopLevelDeclaration(arg0)), |
- 'validateModifiersForTopLevelFunction_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForTopLevelFunction(arg0)), |
- 'validateModifiersForTopLevelVariable_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForTopLevelVariable(arg0)), |
+ 1, (Parser target, arg0) => target._validateModifiersForOperator(arg0)), |
+ 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, |
+ (Parser target, arg0) => |
+ target._validateModifiersForTopLevelDeclaration(arg0)), |
+ 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, |
+ (Parser target, arg0) => |
+ target._validateModifiersForTopLevelFunction(arg0)), |
+ 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, |
+ (Parser target, arg0) => |
+ target._validateModifiersForTopLevelVariable(arg0)), |
'validateModifiersForTypedef_1': new MethodTrampoline( |
- 1, |
- (Parser target, arg0) => target._validateModifiersForTypedef(arg0)), |
+ 1, (Parser target, arg0) => target._validateModifiersForTypedef(arg0)), |
}; |
-Object invokeParserMethodImpl(Parser parser, String methodName, |
- List<Object> objects, Token tokenStream) { |
+Object invokeParserMethodImpl( |
+ Parser parser, String methodName, List<Object> objects, Token tokenStream) { |
parser.currentToken = tokenStream; |
MethodTrampoline method = |
methodTable_Parser['${methodName}_${objects.length}']; |
@@ -1510,8 +1311,8 @@ class IncrementalParseDispatcher implements AstVisitor<AstNode> { |
} |
@override |
- AstNode |
- visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { |
+ AstNode visitRedirectingConstructorInvocation( |
+ RedirectingConstructorInvocation node) { |
if (identical(_oldNode, node.constructorName)) { |
return _parser.parseSimpleIdentifier(); |
} else if (identical(_oldNode, node.argumentList)) { |
@@ -1900,9 +1701,8 @@ class IncrementalParser { |
oldNode = |
new NodeLocator.con1(originalStart).searchWithin(originalStructure); |
} else { |
- oldNode = new NodeLocator.con2( |
- originalStart, |
- originalEnd).searchWithin(originalStructure); |
+ oldNode = new NodeLocator.con2(originalStart, originalEnd) |
+ .searchWithin(originalStructure); |
} |
// |
// Find the token at which parsing is to begin. |
@@ -2144,11 +1944,7 @@ class MethodTrampoline { |
return trampoline(target, arguments[0], arguments[1], arguments[2]); |
case 4: |
return trampoline( |
- target, |
- arguments[0], |
- arguments[1], |
- arguments[2], |
- arguments[3]); |
+ target, arguments[0], arguments[1], arguments[2], arguments[3]); |
default: |
throw new IllegalArgumentException("Not implemented for > 4 arguments"); |
} |
@@ -2465,8 +2261,7 @@ class Parser { |
argument = parseArgument(); |
arguments.add(argument); |
if (foundNamedArgument) { |
- bool blankArgument = |
- argument is SimpleIdentifier && |
+ bool blankArgument = argument is SimpleIdentifier && |
(argument as SimpleIdentifier).name.isEmpty; |
if (!generatedError && |
!(argument is NamedExpression && !blankArgument)) { |
@@ -2511,8 +2306,8 @@ class Parser { |
} |
while (_matches(TokenType.BAR)) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseBitwiseXorExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseBitwiseXorExpression()); |
} |
return expression; |
} |
@@ -2531,17 +2326,15 @@ class Parser { |
Token leftBracket = _expect(TokenType.OPEN_CURLY_BRACKET); |
List<Statement> statements = new List<Statement>(); |
Token statementStart = _currentToken; |
- while (!_matches(TokenType.EOF) && |
- !_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
+ while ( |
+ !_matches(TokenType.EOF) && !_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
Statement statement = parseStatement2(); |
if (statement != null) { |
statements.add(statement); |
} |
if (identical(_currentToken, statementStart)) { |
// Ensure that we are making progress and report an error if we're not. |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, |
[_currentToken.lexeme]); |
_advance(); |
} |
@@ -2571,34 +2364,26 @@ class Parser { |
TypeName returnType = parseReturnType(); |
if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseGetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- returnType); |
+ return _parseGetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, returnType); |
} else if (_matchesKeyword(Keyword.SET) && |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseSetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- returnType); |
+ return _parseSetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, returnType); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} else if (_matchesIdentifier() && |
- _peek().matchesAny( |
- [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { |
+ _peek().matchesAny([ |
+ TokenType.OPEN_PAREN, |
+ TokenType.OPEN_CURLY_BRACKET, |
+ TokenType.FUNCTION |
+ ])) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseMethodDeclarationAfterReturnType( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- returnType); |
+ return _parseMethodDeclarationAfterReturnType(commentAndMetadata, |
+ modifiers.externalKeyword, modifiers.staticKeyword, returnType); |
} else { |
// |
// We have found an error of some kind. Try to recover. |
@@ -2610,10 +2395,8 @@ 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); |
} |
} |
@@ -2624,37 +2407,26 @@ class Parser { |
// |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_EXECUTABLE, |
- _currentToken); |
+ ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken); |
return null; |
} |
} else if (_matchesKeyword(Keyword.GET) && |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseGetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- null); |
+ return _parseGetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, null); |
} else if (_matchesKeyword(Keyword.SET) && |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseSetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- null); |
+ return _parseSetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, null); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- null); |
+ commentAndMetadata, modifiers.externalKeyword, null); |
} else if (!_matchesIdentifier()) { |
// |
// Recover from an error. |
@@ -2679,9 +2451,7 @@ class Parser { |
// |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- null); |
+ commentAndMetadata, modifiers.externalKeyword, null); |
} |
Token keyword = modifiers.varKeyword; |
if (keyword == null) { |
@@ -2696,18 +2466,15 @@ class Parser { |
// |
_reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER); |
List<VariableDeclaration> variables = new List<VariableDeclaration>(); |
- variables.add( |
- new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null)); |
- return new FieldDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- null, |
+ variables.add(new VariableDeclaration( |
+ null, null, _createSyntheticIdentifier(), null, null)); |
+ return new FieldDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, null, |
new VariableDeclarationList(null, null, keyword, null, variables), |
_expectSemicolon()); |
} |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_CLASS_MEMBER, |
- _currentToken); |
+ ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken); |
if (commentAndMetadata.comment != null || |
!commentAndMetadata.metadata.isEmpty) { |
// |
@@ -2716,30 +2483,19 @@ 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(), |
- new FormalParameterList(null, new List<FormalParameter>(), null, null, null), |
+ return new MethodDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, null, null, null, null, null, |
+ _createSyntheticIdentifier(), new FormalParameterList( |
+ null, new List<FormalParameter>(), null, null, null), |
new EmptyFunctionBody(_createSyntheticToken(TokenType.SEMICOLON))); |
} |
return null; |
} 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(); |
@@ -2747,38 +2503,25 @@ 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, |
+ return _parseMethodDeclarationAfterParameters(commentAndMetadata, |
+ modifiers.externalKeyword, modifiers.staticKeyword, null, methodName, |
parameters); |
- } else if (_peek().matchesAny( |
- [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) { |
+ } else if (_peek() |
+ .matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) { |
if (modifiers.constKeyword == null && |
modifiers.finalKeyword == null && |
modifiers.varKeyword == null) { |
_reportErrorForCurrentToken( |
ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE); |
} |
- return _parseInitializedIdentifierList( |
- commentAndMetadata, |
- modifiers.staticKeyword, |
- _validateModifiersForField(modifiers), |
- null); |
+ return _parseInitializedIdentifierList(commentAndMetadata, |
+ modifiers.staticKeyword, _validateModifiersForField(modifiers), null); |
} else if (_matchesKeyword(Keyword.TYPEDEF)) { |
_reportErrorForCurrentToken(ParserErrorCode.TYPEDEF_IN_CLASS); |
// TODO(brianwilkerson) We don't currently have any way to capture the |
@@ -2789,25 +2532,17 @@ class Parser { |
TypeName type = parseTypeName(); |
if (_matchesKeyword(Keyword.GET) && _tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseGetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- type); |
+ return _parseGetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, type); |
} else if (_matchesKeyword(Keyword.SET) && |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForGetterOrSetterOrMethod(modifiers); |
- return _parseSetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- type); |
+ return _parseSetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, type); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- type); |
+ commentAndMetadata, modifiers.externalKeyword, type); |
} else if (!_matchesIdentifier()) { |
if (_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
// |
@@ -2815,10 +2550,8 @@ 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)) { |
@@ -2828,9 +2561,7 @@ class Parser { |
// |
_validateModifiersForOperator(modifiers); |
return _parseOperator( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- type); |
+ commentAndMetadata, modifiers.externalKeyword, type); |
} |
// |
// We appear to have found an incomplete declaration before another |
@@ -2838,14 +2569,11 @@ class Parser { |
// it as a field declaration with a missing field name and semicolon. |
// |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_CLASS_MEMBER, |
- _currentToken); |
+ ParserErrorCode.EXPECTED_CLASS_MEMBER, _currentToken); |
try { |
_lockErrorListener(); |
- return _parseInitializedIdentifierList( |
- commentAndMetadata, |
- modifiers.staticKeyword, |
- _validateModifiersForField(modifiers), |
+ return _parseInitializedIdentifierList(commentAndMetadata, |
+ modifiers.staticKeyword, _validateModifiersForField(modifiers), |
type); |
} finally { |
_unlockErrorListener(); |
@@ -2855,24 +2583,14 @@ 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, |
+ return _parseMethodDeclarationAfterParameters(commentAndMetadata, |
+ modifiers.externalKeyword, modifiers.staticKeyword, type, methodName, |
parameters); |
} else if (_tokenMatches(_peek(), TokenType.OPEN_CURLY_BRACKET)) { |
// We have found "TypeName identifier {", and are guessing that this is a |
@@ -2881,17 +2599,11 @@ class Parser { |
_reportErrorForCurrentToken(ParserErrorCode.MISSING_GET); |
_currentToken = _injectToken( |
new Parser_SyntheticKeywordToken(Keyword.GET, _currentToken.offset)); |
- return _parseGetter( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- modifiers.staticKeyword, |
- type); |
+ return _parseGetter(commentAndMetadata, modifiers.externalKeyword, |
+ modifiers.staticKeyword, type); |
} |
- return _parseInitializedIdentifierList( |
- commentAndMetadata, |
- modifiers.staticKeyword, |
- _validateModifiersForField(modifiers), |
- type); |
+ return _parseInitializedIdentifierList(commentAndMetadata, |
+ modifiers.staticKeyword, _validateModifiersForField(modifiers), type); |
} |
/** |
@@ -2972,9 +2684,9 @@ class Parser { |
while (!_matches(TokenType.EOF)) { |
CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata(); |
if ((_matchesKeyword(Keyword.IMPORT) || |
- _matchesKeyword(Keyword.EXPORT) || |
- _matchesKeyword(Keyword.LIBRARY) || |
- _matchesKeyword(Keyword.PART)) && |
+ _matchesKeyword(Keyword.EXPORT) || |
+ _matchesKeyword(Keyword.LIBRARY) || |
+ _matchesKeyword(Keyword.PART)) && |
!_tokenMatches(_peek(), TokenType.PERIOD) && |
!_tokenMatches(_peek(), TokenType.LT) && |
!_tokenMatches(_peek(), TokenType.OPEN_PAREN)) { |
@@ -2990,8 +2702,7 @@ class Parser { |
ParserErrorCode.MULTIPLE_LIBRARY_DIRECTIVES); |
} else { |
if (directives.length > 0) { |
- _reportErrorForToken( |
- ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, |
+ _reportErrorForToken(ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST, |
directive.libraryKeyword); |
} |
libraryDirectiveFound = true; |
@@ -3024,17 +2735,15 @@ class Parser { |
} |
} else { |
if (partOfDirectiveFound) { |
- _reportErrorForToken( |
- ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, |
+ _reportErrorForToken(ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART, |
directive.keyword); |
} |
} |
directives.add(directive); |
} else if (_matches(TokenType.SEMICOLON)) { |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
_advance(); |
} else { |
CompilationUnitMember member = |
@@ -3044,10 +2753,9 @@ class Parser { |
} |
} |
if (identical(_currentToken, memberStart)) { |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
_advance(); |
while (!_matches(TokenType.EOF) && |
!_couldBeStartOfCompilationUnitMember()) { |
@@ -3057,11 +2765,7 @@ class Parser { |
memberStart = _currentToken; |
} |
return new CompilationUnit( |
- firstToken, |
- scriptTag, |
- directives, |
- declarations, |
- _currentToken); |
+ firstToken, scriptTag, directives, declarations, _currentToken); |
} |
/** |
@@ -3084,11 +2788,7 @@ class Parser { |
Token colon = _expect(TokenType.COLON); |
Expression elseExpression = parseExpressionWithoutCascade(); |
return new ConditionalExpression( |
- condition, |
- question, |
- thenExpression, |
- colon, |
- elseExpression); |
+ condition, question, thenExpression, colon, elseExpression); |
} |
/** |
@@ -3211,9 +2911,7 @@ class Parser { |
Token operator = getAndAdvance(); |
_ensureAssignable(expression); |
expression = new AssignmentExpression( |
- expression, |
- operator, |
- parseExpressionWithoutCascade()); |
+ expression, operator, parseExpressionWithoutCascade()); |
} |
return expression; |
} |
@@ -3263,11 +2961,7 @@ class Parser { |
Token leftParenthesis = _expect(TokenType.OPEN_PAREN); |
if (_matches(TokenType.CLOSE_PAREN)) { |
return new FormalParameterList( |
- leftParenthesis, |
- null, |
- null, |
- null, |
- getAndAdvance()); |
+ leftParenthesis, null, null, null, getAndAdvance()); |
} |
// |
// Even though it is invalid to have default parameters outside of brackets, |
@@ -3299,11 +2993,9 @@ class Parser { |
// case. |
if (_getEndToken(leftParenthesis) != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [TokenType.COMMA.lexeme]); |
+ ParserErrorCode.EXPECTED_TOKEN, [TokenType.COMMA.lexeme]); |
} else { |
- _reportErrorForToken( |
- ParserErrorCode.MISSING_CLOSING_PARENTHESIS, |
+ _reportErrorForToken(ParserErrorCode.MISSING_CLOSING_PARENTHESIS, |
_currentToken.previous); |
break; |
} |
@@ -3349,8 +3041,7 @@ class Parser { |
currentParameters.add(parameter); |
if (kind == ParameterKind.REQUIRED && wasOptionalParameter) { |
_reportErrorForNode( |
- ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, |
- parameter); |
+ ParserErrorCode.NORMAL_BEFORE_OPTIONAL_PARAMETERS, parameter); |
} |
// |
// Handle the end of parameter groups. |
@@ -3363,14 +3054,14 @@ class Parser { |
if (leftSquareBracket == null) { |
if (leftCurlyBracket != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["}"]); |
+ ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]); |
rightCurlyBracket = rightSquareBracket; |
rightSquareBracket = null; |
} else { |
_reportErrorForCurrentToken( |
- ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["["]); |
+ ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, [ |
+ "[" |
+ ]); |
} |
} |
kind = ParameterKind.REQUIRED; |
@@ -3380,14 +3071,14 @@ class Parser { |
if (leftCurlyBracket == null) { |
if (leftSquareBracket != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["]"]); |
+ ParserErrorCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]); |
rightSquareBracket = rightCurlyBracket; |
rightCurlyBracket = null; |
} else { |
_reportErrorForCurrentToken( |
- ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["{"]); |
+ ParserErrorCode.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP, [ |
+ "{" |
+ ]); |
} |
} |
kind = ParameterKind.REQUIRED; |
@@ -3400,13 +3091,11 @@ class Parser { |
// |
if (leftSquareBracket != null && rightSquareBracket == null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["]"]); |
+ ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["]"]); |
} |
if (leftCurlyBracket != null && rightCurlyBracket == null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, |
- ["}"]); |
+ ParserErrorCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP, ["}"]); |
} |
// |
// Build the parameter list. |
@@ -3417,12 +3106,8 @@ class Parser { |
if (rightSquareBracket == null) { |
rightSquareBracket = rightCurlyBracket; |
} |
- return new FormalParameterList( |
- leftParenthesis, |
- parameters, |
- leftSquareBracket, |
- rightSquareBracket, |
- rightParenthesis); |
+ return new FormalParameterList(leftParenthesis, parameters, |
+ leftSquareBracket, rightSquareBracket, rightParenthesis); |
} |
/** |
@@ -3513,8 +3198,8 @@ class Parser { |
Expression expression = _parseLogicalAndExpression(); |
while (_matches(TokenType.BAR_BAR)) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseLogicalAndExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseLogicalAndExpression()); |
} |
return expression; |
} |
@@ -3572,55 +3257,33 @@ class Parser { |
if (thisKeyword == null) { |
if (holder.keyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, |
- holder.keyword); |
+ ParserErrorCode.FUNCTION_TYPED_PARAMETER_VAR, holder.keyword); |
} |
- return new FunctionTypedFormalParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- holder.type, |
- identifier, |
- parameters); |
+ return new FunctionTypedFormalParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, holder.type, identifier, parameters); |
} else { |
- return new FieldFormalParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- holder.keyword, |
- holder.type, |
- thisKeyword, |
- period, |
- identifier, |
- parameters); |
+ return new FieldFormalParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, holder.keyword, holder.type, |
+ thisKeyword, period, identifier, parameters); |
} |
} |
TypeName type = holder.type; |
if (type != null) { |
if (_tokenMatchesKeyword(type.name.beginToken, Keyword.VOID)) { |
_reportErrorForToken( |
- ParserErrorCode.VOID_PARAMETER, |
- type.name.beginToken); |
+ ParserErrorCode.VOID_PARAMETER, type.name.beginToken); |
} else if (holder.keyword != null && |
_tokenMatchesKeyword(holder.keyword, Keyword.VAR)) { |
_reportErrorForToken(ParserErrorCode.VAR_AND_TYPE, holder.keyword); |
} |
} |
if (thisKeyword != null) { |
- return new FieldFormalParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- holder.keyword, |
- holder.type, |
- thisKeyword, |
- period, |
- identifier, |
- null); |
+ return new FieldFormalParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, holder.keyword, holder.type, thisKeyword, |
+ period, identifier, null); |
} |
- return new SimpleFormalParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- holder.keyword, |
- holder.type, |
- identifier); |
+ return new SimpleFormalParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, holder.keyword, holder.type, identifier); |
} |
/** |
@@ -3751,10 +3414,8 @@ class Parser { |
_matches(TokenType.STRING_INTERPOLATION_IDENTIFIER)) { |
strings.add(_parseStringInterpolation(string)); |
} else { |
- strings.add( |
- new SimpleStringLiteral( |
- string, |
- _computeStringValue(string.lexeme, true, true))); |
+ strings.add(new SimpleStringLiteral( |
+ string, _computeStringValue(string.lexeme, true, true))); |
} |
} |
if (strings.length < 1) { |
@@ -3835,19 +3496,11 @@ class Parser { |
if (_matchesKeyword(Keyword.EXTENDS)) { |
Token keyword = getAndAdvance(); |
TypeName bound = parseTypeName(); |
- return new TypeParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- name, |
- keyword, |
- bound); |
+ return new TypeParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, name, keyword, bound); |
} |
- return new TypeParameter( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- name, |
- null, |
- null); |
+ return new TypeParameter(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, name, null, null); |
} |
/** |
@@ -3915,8 +3568,7 @@ class Parser { |
scalarValue > Character.MAX_CODE_POINT || |
(scalarValue >= 0xD800 && scalarValue <= 0xDFFF)) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.INVALID_CODE_POINT, |
- [escapeSequence]); |
+ ParserErrorCode.INVALID_CODE_POINT, [escapeSequence]); |
return; |
} |
if (scalarValue < Character.MAX_VALUE) { |
@@ -3988,14 +3640,9 @@ class Parser { |
* declaration |
*/ |
FunctionDeclaration _convertToFunctionDeclaration(MethodDeclaration method) => |
- new FunctionDeclaration( |
- method.documentationComment, |
- method.metadata, |
- method.externalKeyword, |
- method.returnType, |
- method.propertyKeyword, |
- method.name, |
- new FunctionExpression(method.parameters, method.body)); |
+ new FunctionDeclaration(method.documentationComment, method.metadata, |
+ method.externalKeyword, method.returnType, method.propertyKeyword, |
+ method.name, new FunctionExpression(method.parameters, method.body)); |
/** |
* Return `true` if the current token could be the start of a compilation unit member. This |
@@ -4006,9 +3653,9 @@ class Parser { |
*/ |
bool _couldBeStartOfCompilationUnitMember() { |
if ((_matchesKeyword(Keyword.IMPORT) || |
- _matchesKeyword(Keyword.EXPORT) || |
- _matchesKeyword(Keyword.LIBRARY) || |
- _matchesKeyword(Keyword.PART)) && |
+ _matchesKeyword(Keyword.EXPORT) || |
+ _matchesKeyword(Keyword.LIBRARY) || |
+ _matchesKeyword(Keyword.PART)) && |
!_tokenMatches(_peek(), TokenType.PERIOD) && |
!_tokenMatches(_peek(), TokenType.LT)) { |
// This looks like the start of a directive |
@@ -4059,11 +3706,8 @@ class Parser { |
// synthetic identifier. By creating SyntheticStringToken we can |
// distinguish a real identifier from synthetic. In the code completion |
// behavior will depend on a cursor position - before or on "is". |
- syntheticToken = _injectToken( |
- new SyntheticStringToken( |
- TokenType.IDENTIFIER, |
- _currentToken.lexeme, |
- _currentToken.offset)); |
+ syntheticToken = _injectToken(new SyntheticStringToken( |
+ TokenType.IDENTIFIER, _currentToken.lexeme, _currentToken.offset)); |
} else { |
syntheticToken = _createSyntheticToken(TokenType.IDENTIFIER); |
} |
@@ -4075,8 +3719,8 @@ class Parser { |
* |
* @return the synthetic token that was created |
*/ |
- Token _createSyntheticKeyword(Keyword keyword) => |
- _injectToken(new Parser_SyntheticKeywordToken(keyword, _currentToken.offset)); |
+ Token _createSyntheticKeyword(Keyword keyword) => _injectToken( |
+ new Parser_SyntheticKeywordToken(keyword, _currentToken.offset)); |
/** |
* Create a synthetic string literal. |
@@ -4154,19 +3798,15 @@ class Parser { |
if (type == TokenType.SEMICOLON) { |
if (_tokenMatches(_currentToken.next, TokenType.SEMICOLON)) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); |
_advance(); |
return getAndAdvance(); |
} |
- _reportErrorForToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- _currentToken.previous, |
- [type.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, |
+ _currentToken.previous, [type.lexeme]); |
} else { |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [type.lexeme]); |
+ ParserErrorCode.EXPECTED_TOKEN, [type.lexeme]); |
} |
return _currentToken; |
} |
@@ -4182,8 +3822,7 @@ class Parser { |
return getAndAdvance(); |
} |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [TokenType.GT.lexeme]); |
+ ParserErrorCode.EXPECTED_TOKEN, [TokenType.GT.lexeme]); |
return _currentToken; |
} |
@@ -4201,8 +3840,7 @@ class Parser { |
// Remove uses of this method in favor of matches? |
// Pass in the error code to use to report the error? |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [keyword.syntax]); |
+ ParserErrorCode.EXPECTED_TOKEN, [keyword.syntax]); |
return _currentToken; |
} |
@@ -4217,9 +3855,7 @@ class Parser { |
return getAndAdvance(); |
} else { |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- _currentToken.previous, |
- [";"]); |
+ ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, [";"]); |
return _createSyntheticToken(TokenType.SEMICOLON); |
} |
} |
@@ -4277,14 +3913,7 @@ class Parser { |
index = index + 1; |
} |
if (StringUtilities.startsWith6( |
- comment, |
- index, |
- 0x2A, |
- 0x20, |
- 0x20, |
- 0x20, |
- 0x20, |
- 0x20)) { |
+ comment, index, 0x2A, 0x20, 0x20, 0x20, 0x20, 0x20)) { |
int end = index + 6; |
while (end < length && |
comment.codeUnitAt(end) != 0xD && |
@@ -4398,8 +4027,8 @@ class Parser { |
if (afterParameters == null) { |
return false; |
} |
- if (afterParameters.matchesAny( |
- [TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { |
+ if (afterParameters |
+ .matchesAny([TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { |
return true; |
} |
String lexeme = afterParameters.lexeme; |
@@ -4412,10 +4041,9 @@ class Parser { |
* @param character the character being tested |
* @return `true` if the character is a valid hexadecimal digit |
*/ |
- bool _isHexDigit(int character) => |
- (0x30 <= character && character <= 0x39) || |
- (0x41 <= character && character <= 0x46) || |
- (0x61 <= character && character <= 0x66); |
+ bool _isHexDigit(int character) => (0x30 <= character && character <= 0x39) || |
+ (0x41 <= character && character <= 0x46) || |
+ (0x61 <= character && character <= 0x66); |
/** |
* Return `true` if the current token is the first token in an initialized variable |
@@ -4454,12 +4082,12 @@ class Parser { |
if (_matchesKeyword(Keyword.CONST)) { |
// Look to see whether we might be at the start of a list or map literal, |
// otherwise this should be the start of a variable declaration. |
- return !_peek().matchesAny( |
- [ |
- TokenType.LT, |
- TokenType.OPEN_CURLY_BRACKET, |
- TokenType.OPEN_SQUARE_BRACKET, |
- TokenType.INDEX]); |
+ return !_peek().matchesAny([ |
+ TokenType.LT, |
+ TokenType.OPEN_CURLY_BRACKET, |
+ TokenType.OPEN_SQUARE_BRACKET, |
+ TokenType.INDEX |
+ ]); |
} |
// We know that we have an identifier, and need to see whether it might be |
// a type name. |
@@ -4704,8 +4332,8 @@ class Parser { |
} |
while (_currentToken.type.isAdditiveOperator) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseMultiplicativeExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseMultiplicativeExpression()); |
} |
return expression; |
} |
@@ -4726,29 +4354,21 @@ class Parser { |
Expression expression = parseExpression2(); |
if (expression is AssignmentExpression) { |
_reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, |
- expression); |
+ ParserErrorCode.ASSERT_DOES_NOT_TAKE_ASSIGNMENT, expression); |
} else if (expression is CascadeExpression) { |
_reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, |
- expression); |
+ ParserErrorCode.ASSERT_DOES_NOT_TAKE_CASCADE, expression); |
} else if (expression is ThrowExpression) { |
_reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, |
- expression); |
+ ParserErrorCode.ASSERT_DOES_NOT_TAKE_THROW, expression); |
} else if (expression is RethrowExpression) { |
_reportErrorForNode( |
- ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, |
- expression); |
+ ParserErrorCode.ASSERT_DOES_NOT_TAKE_RETHROW, expression); |
} |
Token rightParen = _expect(TokenType.CLOSE_PAREN); |
Token semicolon = _expect(TokenType.SEMICOLON); |
return new AssertStatement( |
- keyword, |
- leftParen, |
- expression, |
- rightParen, |
- semicolon); |
+ keyword, leftParen, expression, rightParen, semicolon); |
} |
/** |
@@ -4768,8 +4388,7 @@ class Parser { |
Expression _parseAssignableExpression(bool primaryAllowed) { |
if (_matchesKeyword(Keyword.SUPER)) { |
return _parseAssignableSelector( |
- new SuperExpression(getAndAdvance()), |
- false); |
+ new SuperExpression(getAndAdvance()), false); |
} |
// |
// A primary expression can start with an identifier. We resolve the |
@@ -4782,22 +4401,16 @@ class Parser { |
while (_matches(TokenType.OPEN_PAREN)) { |
ArgumentList argumentList = parseArgumentList(); |
if (expression is SimpleIdentifier) { |
- expression = |
- new MethodInvocation(null, null, expression as SimpleIdentifier, argumentList); |
+ expression = new MethodInvocation( |
+ null, null, expression as SimpleIdentifier, argumentList); |
} else if (expression is PrefixedIdentifier) { |
PrefixedIdentifier identifier = expression as PrefixedIdentifier; |
- expression = new MethodInvocation( |
- identifier.prefix, |
- identifier.period, |
- identifier.identifier, |
- argumentList); |
+ expression = new MethodInvocation(identifier.prefix, |
+ identifier.period, identifier.identifier, argumentList); |
} else if (expression is PropertyAccess) { |
PropertyAccess access = expression as PropertyAccess; |
- expression = new MethodInvocation( |
- access.target, |
- access.operator, |
- access.propertyName, |
- argumentList); |
+ expression = new MethodInvocation(access.target, access.operator, |
+ access.propertyName, argumentList); |
} else { |
expression = |
new FunctionExpressionInvocation(expression, argumentList); |
@@ -4807,15 +4420,12 @@ class Parser { |
} |
} |
Expression selectorExpression = _parseAssignableSelector( |
- expression, |
- isOptional || (expression is PrefixedIdentifier)); |
+ expression, isOptional || (expression is PrefixedIdentifier)); |
if (identical(selectorExpression, expression)) { |
if (!isOptional && (expression is PrefixedIdentifier)) { |
PrefixedIdentifier identifier = expression as PrefixedIdentifier; |
expression = new PropertyAccess( |
- identifier.prefix, |
- identifier.period, |
- identifier.identifier); |
+ identifier.prefix, identifier.period, identifier.identifier); |
} |
return expression; |
} |
@@ -4847,10 +4457,7 @@ class Parser { |
Expression index = parseExpression2(); |
Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET); |
return new IndexExpression.forTarget( |
- prefix, |
- leftBracket, |
- index, |
- rightBracket); |
+ prefix, leftBracket, index, rightBracket); |
} finally { |
_inInitializer = wasInInitializer; |
} |
@@ -4931,8 +4538,8 @@ class Parser { |
} |
while (_matches(TokenType.CARET)) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseBitwiseAndExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseBitwiseAndExpression()); |
} |
return expression; |
} |
@@ -4990,17 +4597,16 @@ class Parser { |
try { |
Expression index = parseExpression2(); |
Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET); |
- expression = |
- new IndexExpression.forCascade(period, leftBracket, index, rightBracket); |
+ expression = new IndexExpression.forCascade( |
+ period, leftBracket, index, rightBracket); |
period = null; |
} finally { |
_inInitializer = wasInInitializer; |
} |
} else { |
- _reportErrorForToken( |
- ParserErrorCode.MISSING_IDENTIFIER, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.MISSING_IDENTIFIER, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
functionName = _createSyntheticIdentifier(); |
} |
assert((expression == null && functionName != null) || |
@@ -5008,17 +4614,14 @@ class Parser { |
if (_currentToken.type == TokenType.OPEN_PAREN) { |
while (_currentToken.type == TokenType.OPEN_PAREN) { |
if (functionName != null) { |
- expression = |
- new MethodInvocation(expression, period, functionName, parseArgumentList()); |
+ expression = new MethodInvocation( |
+ expression, period, functionName, parseArgumentList()); |
period = null; |
functionName = null; |
} else if (expression == null) { |
// It should not be possible to get here. |
- expression = new MethodInvocation( |
- expression, |
- period, |
- _createSyntheticIdentifier(), |
- parseArgumentList()); |
+ expression = new MethodInvocation(expression, period, |
+ _createSyntheticIdentifier(), parseArgumentList()); |
} else { |
expression = |
new FunctionExpressionInvocation(expression, parseArgumentList()); |
@@ -5039,14 +4642,12 @@ class Parser { |
while (_currentToken.type == TokenType.OPEN_PAREN) { |
if (expression is PropertyAccess) { |
PropertyAccess propertyAccess = expression as PropertyAccess; |
- expression = new MethodInvocation( |
- propertyAccess.target, |
- propertyAccess.operator, |
- propertyAccess.propertyName, |
+ expression = new MethodInvocation(propertyAccess.target, |
+ propertyAccess.operator, propertyAccess.propertyName, |
parseArgumentList()); |
} else { |
- expression = |
- new FunctionExpressionInvocation(expression, parseArgumentList()); |
+ expression = new FunctionExpressionInvocation( |
+ expression, parseArgumentList()); |
} |
} |
} |
@@ -5055,9 +4656,7 @@ class Parser { |
Token operator = getAndAdvance(); |
_ensureAssignable(expression); |
expression = new AssignmentExpression( |
- expression, |
- operator, |
- parseExpressionWithoutCascade()); |
+ expression, operator, parseExpressionWithoutCascade()); |
} |
return expression; |
} |
@@ -5076,9 +4675,8 @@ class Parser { |
* not given |
* @return the class declaration that was parsed |
*/ |
- CompilationUnitMember |
- _parseClassDeclaration(CommentAndMetadata commentAndMetadata, |
- Token abstractKeyword) { |
+ CompilationUnitMember _parseClassDeclaration( |
+ CommentAndMetadata commentAndMetadata, Token abstractKeyword) { |
Token keyword = _expectKeyword(Keyword.CLASS); |
if (_matchesIdentifier()) { |
Token next = _peek(); |
@@ -5086,15 +4684,11 @@ class Parser { |
next = _skipTypeParameterList(next); |
if (next != null && _tokenMatches(next, TokenType.EQ)) { |
return _parseClassTypeAlias( |
- commentAndMetadata, |
- abstractKeyword, |
- keyword); |
+ commentAndMetadata, abstractKeyword, keyword); |
} |
} else if (_tokenMatches(next, TokenType.EQ)) { |
return _parseClassTypeAlias( |
- commentAndMetadata, |
- abstractKeyword, |
- keyword); |
+ commentAndMetadata, abstractKeyword, keyword); |
} |
} |
SimpleIdentifier name = parseSimpleIdentifier(); |
@@ -5118,16 +4712,13 @@ class Parser { |
extendsClause = parseExtendsClause(); |
if (withClause != null) { |
_reportErrorForToken( |
- ParserErrorCode.WITH_BEFORE_EXTENDS, |
- withClause.withKeyword); |
+ ParserErrorCode.WITH_BEFORE_EXTENDS, withClause.withKeyword); |
} else if (implementsClause != null) { |
- _reportErrorForToken( |
- ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, |
+ _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS, |
implementsClause.implementsKeyword); |
} |
} else { |
- _reportErrorForToken( |
- ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, |
+ _reportErrorForToken(ParserErrorCode.MULTIPLE_EXTENDS_CLAUSES, |
extendsClause.extendsKeyword); |
parseExtendsClause(); |
} |
@@ -5135,14 +4726,12 @@ class Parser { |
if (withClause == null) { |
withClause = parseWithClause(); |
if (implementsClause != null) { |
- _reportErrorForToken( |
- ParserErrorCode.IMPLEMENTS_BEFORE_WITH, |
+ _reportErrorForToken(ParserErrorCode.IMPLEMENTS_BEFORE_WITH, |
implementsClause.implementsKeyword); |
} |
} else { |
_reportErrorForToken( |
- ParserErrorCode.MULTIPLE_WITH_CLAUSES, |
- withClause.withKeyword); |
+ ParserErrorCode.MULTIPLE_WITH_CLAUSES, withClause.withKeyword); |
parseWithClause(); |
// TODO(brianwilkerson) Should we merge the list of applied mixins |
// into a single list? |
@@ -5151,8 +4740,7 @@ class Parser { |
if (implementsClause == null) { |
implementsClause = parseImplementsClause(); |
} else { |
- _reportErrorForToken( |
- ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, |
+ _reportErrorForToken(ParserErrorCode.MULTIPLE_IMPLEMENTS_CLAUSES, |
implementsClause.implementsKeyword); |
parseImplementsClause(); |
// TODO(brianwilkerson) Should we merge the list of implemented |
@@ -5164,8 +4752,7 @@ class Parser { |
} |
if (withClause != null && extendsClause == null) { |
_reportErrorForToken( |
- ParserErrorCode.WITH_WITHOUT_EXTENDS, |
- withClause.withKeyword); |
+ ParserErrorCode.WITH_WITHOUT_EXTENDS, withClause.withKeyword); |
} |
// |
// Look for and skip over the extra-lingual 'native' specification. |
@@ -5190,18 +4777,9 @@ 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; |
} |
@@ -5225,12 +4803,12 @@ class Parser { |
while (!_matches(TokenType.EOF) && |
!_matches(TokenType.CLOSE_CURLY_BRACKET) && |
(closingBracket != null || |
- (!_matchesKeyword(Keyword.CLASS) && !_matchesKeyword(Keyword.TYPEDEF)))) { |
+ (!_matchesKeyword(Keyword.CLASS) && |
+ !_matchesKeyword(Keyword.TYPEDEF)))) { |
if (_matches(TokenType.SEMICOLON)) { |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
_advance(); |
} else { |
ClassMember member = parseClassMember(className); |
@@ -5239,10 +4817,9 @@ class Parser { |
} |
} |
if (identical(_currentToken, memberStart)) { |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
_advance(); |
} |
memberStart = _currentToken; |
@@ -5280,8 +4857,7 @@ class Parser { |
withClause = parseWithClause(); |
} else { |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [Keyword.WITH.syntax]); |
+ ParserErrorCode.EXPECTED_TOKEN, [Keyword.WITH.syntax]); |
} |
ImplementsClause implementsClause = null; |
if (_matchesKeyword(Keyword.IMPLEMENTS)) { |
@@ -5293,30 +4869,19 @@ class Parser { |
} else { |
if (_matches(TokenType.OPEN_CURLY_BRACKET)) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- [TokenType.SEMICOLON.lexeme]); |
+ ParserErrorCode.EXPECTED_TOKEN, [TokenType.SEMICOLON.lexeme]); |
Token leftBracket = getAndAdvance(); |
_parseClassMembers(className.name, _getEndToken(leftBracket)); |
_expect(TokenType.CLOSE_CURLY_BRACKET); |
} else { |
- _reportErrorForToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- _currentToken.previous, |
- [TokenType.SEMICOLON.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.EXPECTED_TOKEN, |
+ _currentToken.previous, [TokenType.SEMICOLON.lexeme]); |
} |
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); |
} |
@@ -5381,8 +4946,8 @@ class Parser { |
* @param sourceOffset the offset of the first character of the reference source |
* @return the comment reference that was parsed, or `null` if no reference could be found |
*/ |
- CommentReference _parseCommentReference(String referenceSource, |
- int sourceOffset) { |
+ CommentReference _parseCommentReference( |
+ String referenceSource, int sourceOffset) { |
// TODO(brianwilkerson) The errors are not getting the right offset/length |
// and are being duplicated. |
if (referenceSource.length == 0) { |
@@ -5393,9 +4958,7 @@ class Parser { |
try { |
BooleanErrorListener listener = new BooleanErrorListener(); |
Scanner scanner = new Scanner( |
- null, |
- new SubSequenceReader(referenceSource, sourceOffset), |
- listener); |
+ null, new SubSequenceReader(referenceSource, sourceOffset), listener); |
scanner.setSourceStart(1, 1); |
Token firstToken = scanner.tokenize(); |
if (listener.errorReported) { |
@@ -5413,10 +4976,8 @@ class Parser { |
Identifier identifier; |
if (_tokenMatches(secondToken, TokenType.PERIOD) && |
_tokenMatchesIdentifier(thirdToken)) { |
- identifier = new PrefixedIdentifier( |
- new SimpleIdentifier(firstToken), |
- secondToken, |
- new SimpleIdentifier(thirdToken)); |
+ identifier = new PrefixedIdentifier(new SimpleIdentifier(firstToken), |
+ secondToken, new SimpleIdentifier(thirdToken)); |
nextToken = thirdToken.next; |
} else { |
identifier = new SimpleIdentifier(firstToken); |
@@ -5457,8 +5018,8 @@ class Parser { |
* @param tokens the comment tokens representing the documentation comments to be parsed |
* @return the comment references that were parsed |
*/ |
- List<CommentReference> |
- _parseCommentReferences(List<DocumentationCommentToken> tokens) { |
+ List<CommentReference> _parseCommentReferences( |
+ List<DocumentationCommentToken> tokens) { |
List<CommentReference> references = new List<CommentReference>(); |
for (DocumentationCommentToken token in tokens) { |
String comment = token.lexeme; |
@@ -5478,8 +5039,7 @@ class Parser { |
// URI in the link text. |
} else { |
CommentReference reference = _parseCommentReference( |
- comment.substring(leftIndex + 1, rightIndex), |
- nameOffset); |
+ comment.substring(leftIndex + 1, rightIndex), nameOffset); |
if (reference != null) { |
references.add(reference); |
token.references.add(reference.beginToken); |
@@ -5490,16 +5050,16 @@ class Parser { |
// terminating ']' is not typed yet |
int charAfterLeft = comment.codeUnitAt(leftIndex + 1); |
if (Character.isLetterOrDigit(charAfterLeft)) { |
- int nameEnd = |
- StringUtilities.indexOfFirstNotLetterDigit(comment, leftIndex + 1); |
+ int nameEnd = StringUtilities.indexOfFirstNotLetterDigit( |
+ comment, leftIndex + 1); |
String name = comment.substring(leftIndex + 1, nameEnd); |
Token nameToken = |
new StringToken(TokenType.IDENTIFIER, name, nameOffset); |
references.add( |
new CommentReference(null, new SimpleIdentifier(nameToken))); |
} else { |
- Token nameToken = |
- new SyntheticStringToken(TokenType.IDENTIFIER, "", nameOffset); |
+ Token nameToken = new SyntheticStringToken( |
+ TokenType.IDENTIFIER, "", nameOffset); |
references.add( |
new CommentReference(null, new SimpleIdentifier(nameToken))); |
} |
@@ -5535,13 +5095,12 @@ class Parser { |
* @return the compilation unit member that was parsed, or `null` if what was parsed could |
* not be represented as a compilation unit member |
*/ |
- CompilationUnitMember |
- _parseCompilationUnitMember(CommentAndMetadata commentAndMetadata) { |
+ CompilationUnitMember _parseCompilationUnitMember( |
+ CommentAndMetadata commentAndMetadata) { |
Modifiers modifiers = _parseModifiers(); |
if (_matchesKeyword(Keyword.CLASS)) { |
return _parseClassDeclaration( |
- commentAndMetadata, |
- _validateModifiersForClass(modifiers)); |
+ commentAndMetadata, _validateModifiersForClass(modifiers)); |
} else if (_matchesKeyword(Keyword.TYPEDEF) && |
!_tokenMatches(_peek(), TokenType.PERIOD) && |
!_tokenMatches(_peek(), TokenType.LT) && |
@@ -5558,21 +5117,20 @@ class Parser { |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken); |
- return _convertToFunctionDeclaration( |
- _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType)); |
+ return _convertToFunctionDeclaration(_parseOperator( |
+ commentAndMetadata, modifiers.externalKeyword, returnType)); |
} else if (_matchesIdentifier() && |
- _peek().matchesAny( |
- [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { |
+ _peek().matchesAny([ |
+ TokenType.OPEN_PAREN, |
+ TokenType.OPEN_CURLY_BRACKET, |
+ TokenType.FUNCTION |
+ ])) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} else { |
// |
// We have found an error of some kind. Try to recover. |
@@ -5584,28 +5142,22 @@ 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), |
+ _parseVariableDeclarationListAfterType(null, |
+ _validateModifiersForTopLevelVariable(modifiers), null), |
_expect(TokenType.SEMICOLON)); |
} |
} |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_EXECUTABLE, |
- _currentToken); |
+ ParserErrorCode.EXPECTED_EXECUTABLE, _currentToken); |
return null; |
} |
} else if ((_matchesKeyword(Keyword.GET) || _matchesKeyword(Keyword.SET)) && |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- null); |
+ commentAndMetadata, modifiers.externalKeyword, null); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken); |
return _convertToFunctionDeclaration( |
@@ -5624,10 +5176,9 @@ class Parser { |
// |
_reportErrorForCurrentToken(ParserErrorCode.MISSING_IDENTIFIER); |
List<VariableDeclaration> variables = new List<VariableDeclaration>(); |
- variables.add( |
- new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null)); |
- return new TopLevelVariableDeclaration( |
- commentAndMetadata.comment, |
+ variables.add(new VariableDeclaration( |
+ null, null, _createSyntheticIdentifier(), null, null)); |
+ return new TopLevelVariableDeclaration(commentAndMetadata.comment, |
commentAndMetadata.metadata, |
new VariableDeclarationList(null, null, keyword, null, variables), |
_expectSemicolon()); |
@@ -5637,24 +5188,18 @@ class Parser { |
} else if (_tokenMatches(_peek(), TokenType.OPEN_PAREN)) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- null); |
- } else if (_peek().matchesAny( |
- [TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) { |
+ commentAndMetadata, modifiers.externalKeyword, null); |
+ } else if (_peek() |
+ .matchesAny([TokenType.EQ, TokenType.COMMA, TokenType.SEMICOLON])) { |
if (modifiers.constKeyword == null && |
modifiers.finalKeyword == null && |
modifiers.varKeyword == null) { |
_reportErrorForCurrentToken( |
ParserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE); |
} |
- return new TopLevelVariableDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- _parseVariableDeclarationListAfterType( |
- null, |
- _validateModifiersForTopLevelVariable(modifiers), |
- null), |
+ return new TopLevelVariableDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, _parseVariableDeclarationListAfterType( |
+ null, _validateModifiersForTopLevelVariable(modifiers), null), |
_expect(TokenType.SEMICOLON)); |
} |
TypeName returnType = parseReturnType(); |
@@ -5662,22 +5207,16 @@ class Parser { |
_tokenMatchesIdentifier(_peek())) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} else if (_matchesKeyword(Keyword.OPERATOR) && _isOperator(_peek())) { |
_reportErrorForToken(ParserErrorCode.TOP_LEVEL_OPERATOR, _currentToken); |
- return _convertToFunctionDeclaration( |
- _parseOperator(commentAndMetadata, modifiers.externalKeyword, returnType)); |
+ 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. |
@@ -5689,29 +5228,25 @@ class Parser { |
semicolon = _createSyntheticToken(TokenType.SEMICOLON); |
} |
List<VariableDeclaration> variables = new List<VariableDeclaration>(); |
- variables.add( |
- new VariableDeclaration(null, null, _createSyntheticIdentifier(), null, null)); |
- return new TopLevelVariableDeclaration( |
- commentAndMetadata.comment, |
+ variables.add(new VariableDeclaration( |
+ null, null, _createSyntheticIdentifier(), null, null)); |
+ return new TopLevelVariableDeclaration(commentAndMetadata.comment, |
commentAndMetadata.metadata, |
new VariableDeclarationList(null, null, null, returnType, variables), |
semicolon); |
} |
- if (_peek().matchesAny( |
- [TokenType.OPEN_PAREN, TokenType.FUNCTION, TokenType.OPEN_CURLY_BRACKET])) { |
+ if (_peek().matchesAny([ |
+ TokenType.OPEN_PAREN, |
+ TokenType.FUNCTION, |
+ TokenType.OPEN_CURLY_BRACKET |
+ ])) { |
_validateModifiersForTopLevelFunction(modifiers); |
return _parseFunctionDeclaration( |
- commentAndMetadata, |
- modifiers.externalKeyword, |
- returnType); |
+ commentAndMetadata, modifiers.externalKeyword, returnType); |
} |
- return new TopLevelVariableDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- _parseVariableDeclarationListAfterType( |
- null, |
- _validateModifiersForTopLevelVariable(modifiers), |
- returnType), |
+ return new TopLevelVariableDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, _parseVariableDeclarationListAfterType( |
+ null, _validateModifiersForTopLevelVariable(modifiers), returnType), |
_expect(TokenType.SEMICOLON)); |
} |
@@ -5739,8 +5274,8 @@ class Parser { |
return _parseInstanceCreationExpression(keyword); |
} |
- ConstructorDeclaration |
- _parseConstructor(CommentAndMetadata commentAndMetadata, Token externalKeyword, |
+ ConstructorDeclaration _parseConstructor( |
+ CommentAndMetadata commentAndMetadata, Token externalKeyword, |
Token constKeyword, Token factoryKeyword, SimpleIdentifier returnType, |
Token period, SimpleIdentifier name, FormalParameterList parameters) { |
bool bodyAllowed = externalKeyword == null; |
@@ -5772,8 +5307,7 @@ class Parser { |
} while (_optional(TokenType.COMMA)); |
if (factoryKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FACTORY_WITH_INITIALIZERS, |
- factoryKeyword); |
+ ParserErrorCode.FACTORY_WITH_INITIALIZERS, factoryKeyword); |
} |
} |
ConstructorName redirectedConstructor = null; |
@@ -5788,8 +5322,8 @@ class Parser { |
redirectedConstructor); |
} |
} else { |
- body = |
- _parseFunctionBody(true, ParserErrorCode.MISSING_FUNCTION_BODY, false); |
+ body = _parseFunctionBody( |
+ true, ParserErrorCode.MISSING_FUNCTION_BODY, false); |
if (constKeyword != null && |
factoryKeyword != null && |
externalKeyword == null) { |
@@ -5797,35 +5331,22 @@ class Parser { |
} else if (body is EmptyFunctionBody) { |
if (factoryKeyword != null && externalKeyword == null) { |
_reportErrorForToken( |
- ParserErrorCode.FACTORY_WITHOUT_BODY, |
- factoryKeyword); |
+ ParserErrorCode.FACTORY_WITHOUT_BODY, factoryKeyword); |
} |
} else { |
if (constKeyword != null) { |
_reportErrorForNode( |
- ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, |
- body); |
+ ParserErrorCode.CONST_CONSTRUCTOR_WITH_BODY, body); |
} else if (!bodyAllowed) { |
_reportErrorForNode( |
- ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, |
- body); |
+ ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY, body); |
} |
} |
} |
- 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); |
} |
/** |
@@ -5859,12 +5380,8 @@ class Parser { |
} else { |
_reportErrorForCurrentToken( |
ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER); |
- return new ConstructorFieldInitializer( |
- keyword, |
- period, |
- fieldName, |
- _createSyntheticToken(TokenType.EQ), |
- _createSyntheticIdentifier()); |
+ return new ConstructorFieldInitializer(keyword, period, fieldName, |
+ _createSyntheticToken(TokenType.EQ), _createSyntheticIdentifier()); |
} |
bool wasInInitializer = _inInitializer; |
_inInitializer = true; |
@@ -5883,11 +5400,7 @@ class Parser { |
expression = new CascadeExpression(expression, cascadeSections); |
} |
return new ConstructorFieldInitializer( |
- keyword, |
- period, |
- fieldName, |
- equals, |
- expression); |
+ keyword, period, fieldName, equals, expression); |
} finally { |
_inInitializer = wasInInitializer; |
} |
@@ -5907,8 +5420,7 @@ class Parser { |
Token continueKeyword = _expectKeyword(Keyword.CONTINUE); |
if (!_inLoop && !_inSwitch) { |
_reportErrorForToken( |
- ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, |
- continueKeyword); |
+ ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP, continueKeyword); |
} |
SimpleIdentifier label = null; |
if (_matchesIdentifier()) { |
@@ -5916,8 +5428,7 @@ class Parser { |
} |
if (_inSwitch && !_inLoop && label == null) { |
_reportErrorForToken( |
- ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, |
- continueKeyword); |
+ ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE, continueKeyword); |
} |
Token semicolon = _expect(TokenType.SEMICOLON); |
return new ContinueStatement(continueKeyword, label, semicolon); |
@@ -5976,9 +5487,9 @@ class Parser { |
while (!_matches(TokenType.EOF)) { |
CommentAndMetadata commentAndMetadata = _parseCommentAndMetadata(); |
if ((_matchesKeyword(Keyword.IMPORT) || |
- _matchesKeyword(Keyword.EXPORT) || |
- _matchesKeyword(Keyword.LIBRARY) || |
- _matchesKeyword(Keyword.PART)) && |
+ _matchesKeyword(Keyword.EXPORT) || |
+ _matchesKeyword(Keyword.LIBRARY) || |
+ _matchesKeyword(Keyword.PART)) && |
!_tokenMatches(_peek(), TokenType.PERIOD) && |
!_tokenMatches(_peek(), TokenType.LT) && |
!_tokenMatches(_peek(), TokenType.OPEN_PAREN)) { |
@@ -5989,20 +5500,12 @@ class Parser { |
while (!_matches(TokenType.EOF)) { |
_advance(); |
} |
- return new CompilationUnit( |
- firstToken, |
- scriptTag, |
- directives, |
- new List<CompilationUnitMember>(), |
- _currentToken); |
+ return new CompilationUnit(firstToken, scriptTag, directives, |
+ new List<CompilationUnitMember>(), _currentToken); |
} |
} |
- return new CompilationUnit( |
- firstToken, |
- scriptTag, |
- directives, |
- new List<CompilationUnitMember>(), |
- _currentToken); |
+ return new CompilationUnit(firstToken, scriptTag, directives, |
+ new List<CompilationUnitMember>(), _currentToken); |
} |
/** |
@@ -6018,8 +5521,7 @@ class Parser { |
*/ |
Comment _parseDocumentationComment() { |
List<DocumentationCommentToken> documentationTokens = |
- <DocumentationCommentToken>[ |
- ]; |
+ <DocumentationCommentToken>[]; |
CommentToken commentToken = _currentToken.precedingComments; |
while (commentToken != null) { |
if (commentToken is DocumentationCommentToken) { |
@@ -6042,8 +5544,7 @@ class Parser { |
List<CommentReference> references = |
_parseCommentReferences(documentationTokens); |
return Comment.createDocumentationCommentWithReferences( |
- documentationTokens, |
- references); |
+ documentationTokens, references); |
} |
/** |
@@ -6067,14 +5568,8 @@ class Parser { |
Expression condition = parseExpression2(); |
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN); |
Token semicolon = _expect(TokenType.SEMICOLON); |
- return new DoStatement( |
- doKeyword, |
- body, |
- whileKeyword, |
- leftParenthesis, |
- condition, |
- rightParenthesis, |
- semicolon); |
+ return new DoStatement(doKeyword, body, whileKeyword, leftParenthesis, |
+ condition, rightParenthesis, semicolon); |
} finally { |
_inLoop = wasInLoop; |
} |
@@ -6101,14 +5596,11 @@ class Parser { |
name = _createSyntheticIdentifier(); |
} |
if (commentAndMetadata.metadata.isNotEmpty) { |
- _reportErrorForNode( |
- ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT, |
+ _reportErrorForNode(ParserErrorCode.ANNOTATION_ON_ENUM_CONSTANT, |
commentAndMetadata.metadata[0]); |
} |
return new EnumConstantDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- name); |
+ commentAndMetadata.comment, commentAndMetadata.metadata, name); |
} |
/** |
@@ -6153,13 +5645,8 @@ 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); |
} |
@@ -6187,11 +5674,10 @@ class Parser { |
Token operator = getAndAdvance(); |
if (leftEqualityExpression) { |
_reportErrorForNode( |
- ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, |
- expression); |
+ ParserErrorCode.EQUALITY_CANNOT_BE_EQUALITY_OPERAND, expression); |
} |
- expression = |
- new BinaryExpression(expression, operator, _parseRelationalExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseRelationalExpression()); |
leftEqualityExpression = true; |
} |
return expression; |
@@ -6213,12 +5699,8 @@ 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); |
} |
@@ -6299,18 +5781,13 @@ class Parser { |
Expression defaultValue = parseExpression2(); |
if (kind == ParameterKind.NAMED) { |
_reportErrorForToken( |
- ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, |
- seperator); |
+ ParserErrorCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER, seperator); |
} else if (kind == ParameterKind.REQUIRED) { |
_reportErrorForNode( |
- ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, |
- parameter); |
+ ParserErrorCode.POSITIONAL_PARAMETER_OUTSIDE_GROUP, parameter); |
} |
return new DefaultFormalParameter( |
- parameter, |
- kind, |
- seperator, |
- defaultValue); |
+ parameter, kind, seperator, defaultValue); |
} else if (_matches(TokenType.COLON)) { |
Token seperator = getAndAdvance(); |
Expression defaultValue = parseExpression2(); |
@@ -6320,14 +5797,10 @@ class Parser { |
seperator); |
} else if (kind == ParameterKind.REQUIRED) { |
_reportErrorForNode( |
- ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, |
- parameter); |
+ ParserErrorCode.NAMED_PARAMETER_OUTSIDE_GROUP, parameter); |
} |
return new DefaultFormalParameter( |
- parameter, |
- kind, |
- seperator, |
- defaultValue); |
+ parameter, kind, seperator, defaultValue); |
} else if (kind != ParameterKind.REQUIRED) { |
return new DefaultFormalParameter(parameter, kind, null, null); |
} |
@@ -6374,12 +5847,8 @@ class Parser { |
SimpleIdentifier variableName = parseSimpleIdentifier(); |
variables.add( |
new VariableDeclaration(null, null, variableName, null, null)); |
- variableList = new VariableDeclarationList( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- null, |
- null, |
- variables); |
+ variableList = new VariableDeclarationList(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, null, null, variables); |
} else if (_isInitializedVariableDeclaration()) { |
variableList = |
_parseVariableDeclarationListAfterMetadata(commentAndMetadata); |
@@ -6400,8 +5869,9 @@ class Parser { |
NodeList<VariableDeclaration> variables = variableList.variables; |
if (variables.length > 1) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, |
- [variables.length.toString()]); |
+ ParserErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH, [ |
+ variables.length.toString() |
+ ]); |
} |
VariableDeclaration variable = variables[0]; |
if (variable.initializer != null) { |
@@ -6411,12 +5881,8 @@ class Parser { |
Token keyword = variableList.keyword; |
TypeName type = variableList.type; |
if (keyword != null || type != null) { |
- loopVariable = new DeclaredIdentifier( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- keyword, |
- type, |
- variable.name); |
+ loopVariable = new DeclaredIdentifier(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, keyword, type, variable.name); |
} else { |
if (!commentAndMetadata.metadata.isEmpty) { |
// TODO(jwren) metadata isn't allowed before the identifier in |
@@ -6431,31 +5897,18 @@ class Parser { |
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN); |
Statement body = parseStatement2(); |
if (loopVariable == null) { |
- return new ForEachStatement.con2( |
- awaitKeyword, |
- forKeyword, |
- leftParenthesis, |
- identifier, |
- inKeyword, |
- iterator, |
- rightParenthesis, |
- body); |
+ return new ForEachStatement.con2(awaitKeyword, forKeyword, |
+ leftParenthesis, identifier, inKeyword, iterator, |
+ rightParenthesis, body); |
} |
- return new ForEachStatement.con1( |
- awaitKeyword, |
- forKeyword, |
- leftParenthesis, |
- loopVariable, |
- inKeyword, |
- iterator, |
- rightParenthesis, |
- body); |
+ return new ForEachStatement.con1(awaitKeyword, forKeyword, |
+ leftParenthesis, loopVariable, inKeyword, iterator, |
+ rightParenthesis, body); |
} |
} |
if (awaitKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.INVALID_AWAIT_IN_FOR, |
- awaitKeyword); |
+ ParserErrorCode.INVALID_AWAIT_IN_FOR, awaitKeyword); |
} |
Token leftSeparator = _expect(TokenType.SEMICOLON); |
Expression condition = null; |
@@ -6469,17 +5922,9 @@ 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; |
} |
@@ -6504,8 +5949,8 @@ class Parser { |
* and therefore does not have a terminating semicolon |
* @return the function body that was parsed |
*/ |
- FunctionBody _parseFunctionBody(bool mayBeEmpty, |
- ParserErrorCode emptyErrorCode, bool inExpression) { |
+ FunctionBody _parseFunctionBody( |
+ bool mayBeEmpty, ParserErrorCode emptyErrorCode, bool inExpression) { |
bool wasInAsync = _inAsync; |
bool wasInGenerator = _inGenerator; |
bool wasInLoop = _inLoop; |
@@ -6527,9 +5972,7 @@ class Parser { |
stringLiteral = parseStringLiteral(); |
} |
return new NativeFunctionBody( |
- nativeToken, |
- stringLiteral, |
- _expect(TokenType.SEMICOLON)); |
+ nativeToken, stringLiteral, _expect(TokenType.SEMICOLON)); |
} |
Token keyword = null; |
Token star = null; |
@@ -6554,15 +5997,13 @@ class Parser { |
keyword = null; |
} else if (star != null) { |
_reportErrorForToken( |
- ParserErrorCode.INVALID_STAR_AFTER_ASYNC, |
- star); |
+ ParserErrorCode.INVALID_STAR_AFTER_ASYNC, star); |
} |
} |
Token functionDefinition = getAndAdvance(); |
if (_matchesKeyword(Keyword.RETURN)) { |
_reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- getAndAdvance()); |
+ ParserErrorCode.UNEXPECTED_TOKEN, getAndAdvance()); |
} |
Expression expression = parseExpression2(); |
Token semicolon = null; |
@@ -6574,16 +6015,12 @@ class Parser { |
_createSyntheticToken(TokenType.SEMICOLON)); |
} |
return new ExpressionFunctionBody( |
- keyword, |
- functionDefinition, |
- expression, |
- semicolon); |
+ keyword, functionDefinition, expression, semicolon); |
} else if (_matches(TokenType.OPEN_CURLY_BRACKET)) { |
if (keyword != null) { |
if (_tokenMatchesString(keyword, SYNC) && star == null) { |
_reportErrorForToken( |
- ParserErrorCode.MISSING_STAR_AFTER_SYNC, |
- keyword); |
+ ParserErrorCode.MISSING_STAR_AFTER_SYNC, keyword); |
} |
} |
if (!_parseFunctionBodies) { |
@@ -6622,9 +6059,9 @@ class Parser { |
* @param isStatement `true` if the function declaration is being parsed as a statement |
* @return the function declaration that was parsed |
*/ |
- FunctionDeclaration |
- _parseFunctionDeclaration(CommentAndMetadata commentAndMetadata, |
- Token externalKeyword, TypeName returnType) { |
+ FunctionDeclaration _parseFunctionDeclaration( |
+ CommentAndMetadata commentAndMetadata, Token externalKeyword, |
+ TypeName returnType) { |
Token keyword = null; |
bool isGetter = false; |
if (_matchesKeyword(Keyword.GET) && |
@@ -6651,8 +6088,8 @@ class Parser { |
} |
FunctionBody body; |
if (externalKeyword == null) { |
- body = |
- _parseFunctionBody(false, ParserErrorCode.MISSING_FUNCTION_BODY, false); |
+ body = _parseFunctionBody( |
+ false, ParserErrorCode.MISSING_FUNCTION_BODY, false); |
} else { |
body = new EmptyFunctionBody(_expect(TokenType.SEMICOLON)); |
} |
@@ -6661,13 +6098,8 @@ 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(parameters, body)); |
} |
@@ -6685,8 +6117,7 @@ class Parser { |
Modifiers modifiers = _parseModifiers(); |
_validateModifiersForFunctionDeclarationStatement(modifiers); |
return _parseFunctionDeclarationStatementAfterReturnType( |
- _parseCommentAndMetadata(), |
- _parseOptionalReturnType()); |
+ _parseCommentAndMetadata(), _parseOptionalReturnType()); |
} |
/** |
@@ -6702,21 +6133,18 @@ class Parser { |
* @param returnType the return type, or `null` if there is no return type |
* @return the function declaration statement that was parsed |
*/ |
- Statement |
- _parseFunctionDeclarationStatementAfterReturnType(CommentAndMetadata commentAndMetadata, |
- TypeName returnType) { |
+ Statement _parseFunctionDeclarationStatementAfterReturnType( |
+ CommentAndMetadata commentAndMetadata, TypeName returnType) { |
FunctionDeclaration declaration = |
_parseFunctionDeclaration(commentAndMetadata, null, returnType); |
Token propertyKeyword = declaration.propertyKeyword; |
if (propertyKeyword != null) { |
if ((propertyKeyword as KeywordToken).keyword == Keyword.GET) { |
_reportErrorForToken( |
- ParserErrorCode.GETTER_IN_FUNCTION, |
- propertyKeyword); |
+ ParserErrorCode.GETTER_IN_FUNCTION, propertyKeyword); |
} else { |
_reportErrorForToken( |
- ParserErrorCode.SETTER_IN_FUNCTION, |
- propertyKeyword); |
+ ParserErrorCode.SETTER_IN_FUNCTION, propertyKeyword); |
} |
} |
return new FunctionDeclarationStatement(declaration); |
@@ -6737,8 +6165,8 @@ class Parser { |
* @param keyword the token representing the 'typedef' keyword |
* @return the function type alias that was parsed |
*/ |
- FunctionTypeAlias |
- _parseFunctionTypeAlias(CommentAndMetadata commentAndMetadata, Token keyword) { |
+ FunctionTypeAlias _parseFunctionTypeAlias( |
+ CommentAndMetadata commentAndMetadata, Token keyword) { |
TypeName returnType = null; |
if (hasReturnTypeInTypeAlias) { |
returnType = parseReturnType(); |
@@ -6751,54 +6179,31 @@ 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, |
+ 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); |
} |
/** |
@@ -6832,22 +6237,13 @@ 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, |
- body); |
+ return new MethodDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, |
+ propertyKeyword, null, name, null, body); |
} |
/** |
@@ -6892,14 +6288,8 @@ class Parser { |
elseKeyword = getAndAdvance(); |
elseStatement = parseStatement2(); |
} |
- return new IfStatement( |
- ifKeyword, |
- leftParenthesis, |
- condition, |
- rightParenthesis, |
- thenStatement, |
- elseKeyword, |
- elseStatement); |
+ return new IfStatement(ifKeyword, leftParenthesis, condition, |
+ rightParenthesis, thenStatement, elseKeyword, elseStatement); |
} |
/** |
@@ -6931,16 +6321,9 @@ 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); |
} |
/** |
@@ -6966,16 +6349,13 @@ class Parser { |
* @param type the type that has already been parsed, or `null` if 'var' was provided |
* @return the getter that was parsed |
*/ |
- FieldDeclaration |
- _parseInitializedIdentifierList(CommentAndMetadata commentAndMetadata, |
- Token staticKeyword, Token keyword, TypeName type) { |
+ FieldDeclaration _parseInitializedIdentifierList( |
+ 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)); |
} |
@@ -6994,9 +6374,7 @@ class Parser { |
ConstructorName constructorName = parseConstructorName(); |
ArgumentList argumentList = parseArgumentList(); |
return new InstanceCreationExpression( |
- keyword, |
- constructorName, |
- argumentList); |
+ keyword, constructorName, argumentList); |
} |
/** |
@@ -7010,18 +6388,14 @@ class Parser { |
* @param commentAndMetadata the metadata to be associated with the directive |
* @return the library directive that was parsed |
*/ |
- LibraryDirective |
- _parseLibraryDirective(CommentAndMetadata commentAndMetadata) { |
+ LibraryDirective _parseLibraryDirective( |
+ CommentAndMetadata commentAndMetadata) { |
Token keyword = _expectKeyword(Keyword.LIBRARY); |
- LibraryIdentifier libraryName = |
- _parseLibraryName(ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE, keyword); |
+ LibraryIdentifier libraryName = _parseLibraryName( |
+ ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE, keyword); |
Token semicolon = _expect(TokenType.SEMICOLON); |
- return new LibraryDirective( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- keyword, |
- libraryName, |
- semicolon); |
+ return new LibraryDirective(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, keyword, libraryName, semicolon); |
} |
/** |
@@ -7037,8 +6411,8 @@ class Parser { |
* missing |
* @return the library name that was parsed |
*/ |
- LibraryIdentifier _parseLibraryName(ParserErrorCode missingNameError, |
- Token missingNameToken) { |
+ LibraryIdentifier _parseLibraryName( |
+ ParserErrorCode missingNameError, Token missingNameToken) { |
if (_matchesIdentifier()) { |
return parseLibraryIdentifier(); |
} else if (_matches(TokenType.STRING)) { |
@@ -7069,12 +6443,12 @@ class Parser { |
* are no type arguments |
* @return the list literal that was parsed |
*/ |
- ListLiteral _parseListLiteral(Token modifier, |
- TypeArgumentList typeArguments) { |
+ ListLiteral _parseListLiteral( |
+ Token modifier, TypeArgumentList typeArguments) { |
// may be empty list literal |
if (_matches(TokenType.INDEX)) { |
- BeginToken leftBracket = |
- _createToken(_currentToken, TokenType.OPEN_SQUARE_BRACKET, isBegin: true); |
+ BeginToken leftBracket = _createToken( |
+ _currentToken, TokenType.OPEN_SQUARE_BRACKET, isBegin: true); |
Token rightBracket = |
new Token(TokenType.CLOSE_SQUARE_BRACKET, _currentToken.offset + 1); |
leftBracket.endToken = rightBracket; |
@@ -7083,21 +6457,13 @@ class Parser { |
_currentToken.previous.setNext(leftBracket); |
_currentToken = _currentToken.next; |
return new ListLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- null, |
- rightBracket); |
+ modifier, typeArguments, leftBracket, null, rightBracket); |
} |
// open |
Token leftBracket = _expect(TokenType.OPEN_SQUARE_BRACKET); |
if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) { |
return new ListLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- null, |
- getAndAdvance()); |
+ modifier, typeArguments, leftBracket, null, getAndAdvance()); |
} |
bool wasInInitializer = _inInitializer; |
_inInitializer = false; |
@@ -7107,21 +6473,13 @@ class Parser { |
while (_optional(TokenType.COMMA)) { |
if (_matches(TokenType.CLOSE_SQUARE_BRACKET)) { |
return new ListLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- elements, |
- getAndAdvance()); |
+ modifier, typeArguments, leftBracket, elements, getAndAdvance()); |
} |
elements.add(parseExpression2()); |
} |
Token rightBracket = _expect(TokenType.CLOSE_SQUARE_BRACKET); |
return new ListLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- elements, |
- rightBracket); |
+ modifier, typeArguments, leftBracket, elements, rightBracket); |
} finally { |
_inInitializer = wasInInitializer; |
} |
@@ -7152,11 +6510,8 @@ 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)); |
} |
@@ -7174,8 +6529,8 @@ class Parser { |
Expression expression = _parseEqualityExpression(); |
while (_matches(TokenType.AMPERSAND_AMPERSAND)) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseEqualityExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseEqualityExpression()); |
} |
return expression; |
} |
@@ -7199,11 +6554,7 @@ class Parser { |
List<MapLiteralEntry> entries = new List<MapLiteralEntry>(); |
if (_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
return new MapLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- entries, |
- getAndAdvance()); |
+ modifier, typeArguments, leftBracket, entries, getAndAdvance()); |
} |
bool wasInInitializer = _inInitializer; |
_inInitializer = false; |
@@ -7212,21 +6563,13 @@ class Parser { |
while (_optional(TokenType.COMMA)) { |
if (_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
return new MapLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- entries, |
- getAndAdvance()); |
+ modifier, typeArguments, leftBracket, entries, getAndAdvance()); |
} |
entries.add(parseMapLiteralEntry()); |
} |
Token rightBracket = _expect(TokenType.CLOSE_CURLY_BRACKET); |
return new MapLiteral( |
- modifier, |
- typeArguments, |
- leftBracket, |
- entries, |
- rightBracket); |
+ modifier, typeArguments, leftBracket, entries, rightBracket); |
} finally { |
_inInitializer = wasInInitializer; |
} |
@@ -7250,14 +6593,13 @@ class Parser { |
* @param parameters the parameters to the method |
* @return the method declaration that was parsed |
*/ |
- MethodDeclaration |
- _parseMethodDeclarationAfterParameters(CommentAndMetadata commentAndMetadata, |
- Token externalKeyword, Token staticKeyword, TypeName returnType, |
- SimpleIdentifier name, FormalParameterList parameters) { |
+ MethodDeclaration _parseMethodDeclarationAfterParameters( |
+ CommentAndMetadata commentAndMetadata, Token externalKeyword, |
+ Token staticKeyword, TypeName returnType, SimpleIdentifier name, |
+ 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); |
@@ -7267,17 +6609,9 @@ class Parser { |
_reportErrorForNode(ParserErrorCode.ABSTRACT_STATIC_METHOD, body); |
} |
} |
- return new MethodDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- externalKeyword, |
- staticKeyword, |
- returnType, |
- null, |
- null, |
- name, |
- parameters, |
- body); |
+ return new MethodDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, |
+ null, null, name, parameters, body); |
} |
/** |
@@ -7296,33 +6630,25 @@ class Parser { |
* @param returnType the return type of the method |
* @return the method declaration that was parsed |
*/ |
- MethodDeclaration |
- _parseMethodDeclarationAfterReturnType(CommentAndMetadata commentAndMetadata, |
- Token externalKeyword, Token staticKeyword, TypeName returnType) { |
+ MethodDeclaration _parseMethodDeclarationAfterReturnType( |
+ CommentAndMetadata commentAndMetadata, Token externalKeyword, |
+ Token staticKeyword, TypeName returnType) { |
SimpleIdentifier methodName = parseSimpleIdentifier(); |
FormalParameterList parameters; |
if (!_matches(TokenType.OPEN_PAREN) && |
- (_matches(TokenType.OPEN_CURLY_BRACKET) || _matches(TokenType.FUNCTION))) { |
+ (_matches(TokenType.OPEN_CURLY_BRACKET) || |
+ _matches(TokenType.FUNCTION))) { |
_reportErrorForToken( |
- ParserErrorCode.MISSING_METHOD_PARAMETERS, |
- _currentToken.previous); |
+ 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, |
- parameters); |
+ return _parseMethodDeclarationAfterParameters(commentAndMetadata, |
+ externalKeyword, staticKeyword, returnType, methodName, parameters); |
} |
/** |
@@ -7350,8 +6676,7 @@ class Parser { |
if (_matchesKeyword(Keyword.ABSTRACT)) { |
if (modifiers.abstractKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.abstractKeyword = getAndAdvance(); |
@@ -7359,8 +6684,7 @@ class Parser { |
} else if (_matchesKeyword(Keyword.CONST)) { |
if (modifiers.constKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.constKeyword = getAndAdvance(); |
@@ -7370,8 +6694,7 @@ class Parser { |
!_tokenMatches(_peek(), TokenType.LT)) { |
if (modifiers.externalKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.externalKeyword = getAndAdvance(); |
@@ -7381,8 +6704,7 @@ class Parser { |
!_tokenMatches(_peek(), TokenType.LT)) { |
if (modifiers.factoryKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.factoryKeyword = getAndAdvance(); |
@@ -7390,8 +6712,7 @@ class Parser { |
} else if (_matchesKeyword(Keyword.FINAL)) { |
if (modifiers.finalKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.finalKeyword = getAndAdvance(); |
@@ -7401,8 +6722,7 @@ class Parser { |
!_tokenMatches(_peek(), TokenType.LT)) { |
if (modifiers.staticKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.staticKeyword = getAndAdvance(); |
@@ -7410,8 +6730,7 @@ class Parser { |
} else if (_matchesKeyword(Keyword.VAR)) { |
if (modifiers.varKeyword != null) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.DUPLICATED_MODIFIER, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.DUPLICATED_MODIFIER, [_currentToken.lexeme]); |
_advance(); |
} else { |
modifiers.varKeyword = getAndAdvance(); |
@@ -7510,8 +6829,7 @@ class Parser { |
Token afterString = _skipStringLiteral(_currentToken.next); |
if (afterString != null && afterString.type == TokenType.COLON) { |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} |
} |
return parseBlock(); |
@@ -7534,16 +6852,14 @@ class Parser { |
return _parseIfStatement(); |
} else if (keyword == Keyword.RETHROW) { |
return new ExpressionStatement( |
- _parseRethrowExpression(), |
- _expect(TokenType.SEMICOLON)); |
+ _parseRethrowExpression(), _expect(TokenType.SEMICOLON)); |
} else if (keyword == Keyword.RETURN) { |
return _parseReturnStatement(); |
} else if (keyword == Keyword.SWITCH) { |
return _parseSwitchStatement(); |
} else if (keyword == Keyword.THROW) { |
return new ExpressionStatement( |
- _parseThrowExpression(), |
- _expect(TokenType.SEMICOLON)); |
+ _parseThrowExpression(), _expect(TokenType.SEMICOLON)); |
} else if (keyword == Keyword.TRY) { |
return _parseTryStatement(); |
} else if (keyword == Keyword.WHILE) { |
@@ -7554,11 +6870,13 @@ class Parser { |
} else if (keyword == Keyword.VOID) { |
TypeName returnType = parseReturnType(); |
if (_matchesIdentifier() && |
- _peek().matchesAny( |
- [TokenType.OPEN_PAREN, TokenType.OPEN_CURLY_BRACKET, TokenType.FUNCTION])) { |
+ _peek().matchesAny([ |
+ TokenType.OPEN_PAREN, |
+ TokenType.OPEN_CURLY_BRACKET, |
+ TokenType.FUNCTION |
+ ])) { |
return _parseFunctionDeclarationStatementAfterReturnType( |
- commentAndMetadata, |
- returnType); |
+ commentAndMetadata, returnType); |
} else { |
// |
// We have found an error of some kind. Try to recover. |
@@ -7579,24 +6897,21 @@ class Parser { |
// block. Parse it as a variable declaration. |
// |
return _parseVariableDeclarationStatementAfterType( |
- commentAndMetadata, |
- null, |
- returnType); |
+ commentAndMetadata, null, returnType); |
} |
_reportErrorForCurrentToken(ParserErrorCode.MISSING_STATEMENT); |
// TODO(brianwilkerson) Recover from this error. |
return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON)); |
} |
} else if (keyword == Keyword.CONST) { |
- if (_peek().matchesAny( |
- [ |
- TokenType.LT, |
- TokenType.OPEN_CURLY_BRACKET, |
- TokenType.OPEN_SQUARE_BRACKET, |
- TokenType.INDEX])) { |
+ if (_peek().matchesAny([ |
+ TokenType.LT, |
+ TokenType.OPEN_CURLY_BRACKET, |
+ TokenType.OPEN_SQUARE_BRACKET, |
+ TokenType.INDEX |
+ ])) { |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} else if (_tokenMatches(_peek(), TokenType.IDENTIFIER)) { |
Token afterType = _skipTypeName(_peek()); |
if (afterType != null) { |
@@ -7605,8 +6920,7 @@ class Parser { |
_tokenMatches(afterType.next, TokenType.IDENTIFIER) && |
_tokenMatches(afterType.next.next, TokenType.OPEN_PAREN))) { |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} |
} |
} |
@@ -7619,8 +6933,7 @@ class Parser { |
keyword == Keyword.SUPER || |
keyword == Keyword.THIS) { |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} else { |
// |
// We have found an error of some kind. Try to recover. |
@@ -7635,16 +6948,14 @@ class Parser { |
return _parseForStatement(); |
} |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} else if (_matchesString(_AWAIT) && |
_tokenMatchesKeyword(_peek(), Keyword.FOR)) { |
Token awaitToken = _currentToken; |
Statement statement = _parseForStatement(); |
if (statement is! ForStatement) { |
_reportErrorForToken( |
- CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, |
- awaitToken); |
+ CompileTimeErrorCode.ASYNC_FOR_IN_WRONG_CONTEXT, awaitToken); |
} |
return statement; |
} else if (_matches(TokenType.SEMICOLON)) { |
@@ -7659,8 +6970,7 @@ class Parser { |
return new EmptyStatement(_createSyntheticToken(TokenType.SEMICOLON)); |
} else { |
return new ExpressionStatement( |
- parseExpression2(), |
- _expect(TokenType.SEMICOLON)); |
+ parseExpression2(), _expect(TokenType.SEMICOLON)); |
} |
} |
@@ -7689,24 +6999,22 @@ class Parser { |
operatorKeyword = getAndAdvance(); |
} else { |
_reportErrorForToken( |
- ParserErrorCode.MISSING_KEYWORD_OPERATOR, |
- _currentToken); |
+ ParserErrorCode.MISSING_KEYWORD_OPERATOR, _currentToken); |
operatorKeyword = _createSyntheticKeyword(Keyword.OPERATOR); |
} |
if (!_currentToken.isUserDefinableOperator) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.NON_USER_DEFINABLE_OPERATOR, [_currentToken.lexeme]); |
} |
SimpleIdentifier name = new SimpleIdentifier(getAndAdvance()); |
if (_matches(TokenType.EQ)) { |
Token previous = _currentToken.previous; |
if ((_tokenMatches(previous, TokenType.EQ_EQ) || |
- _tokenMatches(previous, TokenType.BANG_EQ)) && |
+ _tokenMatches(previous, TokenType.BANG_EQ)) && |
_currentToken.offset == previous.offset + 2) { |
- _reportErrorForCurrentToken( |
- ParserErrorCode.INVALID_OPERATOR, |
- ["${previous.lexeme}${_currentToken.lexeme}"]); |
+ _reportErrorForCurrentToken(ParserErrorCode.INVALID_OPERATOR, [ |
+ "${previous.lexeme}${_currentToken.lexeme}" |
+ ]); |
_advance(); |
} |
} |
@@ -7717,17 +7025,9 @@ 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, |
- parameters, |
- body); |
+ return new MethodDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, externalKeyword, null, returnType, null, |
+ operatorKeyword, name, parameters, body); |
} |
/** |
@@ -7742,7 +7042,8 @@ class Parser { |
!_matchesKeyword(Keyword.GET) && |
!_matchesKeyword(Keyword.SET) && |
!_matchesKeyword(Keyword.OPERATOR) && |
- (_tokenMatchesIdentifier(_peek()) || _tokenMatches(_peek(), TokenType.LT))) { |
+ (_tokenMatchesIdentifier(_peek()) || |
+ _tokenMatches(_peek(), TokenType.LT))) { |
return parseReturnType(); |
} else if (_matchesIdentifier() && |
_tokenMatches(_peek(), TokenType.PERIOD) && |
@@ -7773,25 +7074,16 @@ class Parser { |
if (_matchesString(_OF)) { |
Token ofKeyword = getAndAdvance(); |
LibraryIdentifier libraryName = _parseLibraryName( |
- ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE, |
- ofKeyword); |
+ 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(); |
Token semicolon = _expect(TokenType.SEMICOLON); |
- return new PartDirective( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- partKeyword, |
- partUri, |
- semicolon); |
+ return new PartDirective(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, partKeyword, partUri, semicolon); |
} |
/** |
@@ -7819,11 +7111,8 @@ class Parser { |
ArgumentList argumentList = parseArgumentList(); |
if (operand is PropertyAccess) { |
PropertyAccess access = operand as PropertyAccess; |
- operand = new MethodInvocation( |
- access.target, |
- access.operator, |
- access.propertyName, |
- argumentList); |
+ operand = new MethodInvocation(access.target, access.operator, |
+ access.propertyName, argumentList); |
} else { |
operand = new FunctionExpressionInvocation(operand, argumentList); |
} |
@@ -7875,8 +7164,7 @@ class Parser { |
return new ThisExpression(getAndAdvance()); |
} else if (_matchesKeyword(Keyword.SUPER)) { |
return _parseAssignableSelector( |
- new SuperExpression(getAndAdvance()), |
- false); |
+ new SuperExpression(getAndAdvance()), false); |
} else if (_matchesKeyword(Keyword.NULL)) { |
return new NullLiteral(getAndAdvance()); |
} else if (_matchesKeyword(Keyword.FALSE)) { |
@@ -7945,9 +7233,7 @@ class Parser { |
Expression expression = parseExpression2(); |
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN); |
return new ParenthesizedExpression( |
- leftParenthesis, |
- expression, |
- rightParenthesis); |
+ leftParenthesis, expression, rightParenthesis); |
} finally { |
_inInitializer = wasInInitializer; |
} |
@@ -7956,8 +7242,7 @@ class Parser { |
} else if (_matches(TokenType.QUESTION) && |
_tokenMatches(_peek(), TokenType.IDENTIFIER)) { |
_reportErrorForCurrentToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); |
_advance(); |
return _parsePrimaryExpression(); |
} else if (_matchesKeyword(Keyword.VOID)) { |
@@ -7967,8 +7252,7 @@ class Parser { |
// |
// TODO(brianwilkerson) Improve this error message. |
_reportErrorForCurrentToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- [_currentToken.lexeme]); |
+ ParserErrorCode.UNEXPECTED_TOKEN, [_currentToken.lexeme]); |
_advance(); |
return _parsePrimaryExpression(); |
} else if (_matches(TokenType.HASH)) { |
@@ -7999,10 +7283,7 @@ class Parser { |
} |
ArgumentList argumentList = parseArgumentList(); |
return new RedirectingConstructorInvocation( |
- keyword, |
- period, |
- constructorName, |
- argumentList); |
+ keyword, period, constructorName, argumentList); |
} |
/** |
@@ -8021,8 +7302,8 @@ class Parser { |
_currentToken.next.type.isRelationalOperator) { |
Expression expression = new SuperExpression(getAndAdvance()); |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, parseBitwiseOrExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, parseBitwiseOrExpression()); |
return expression; |
} |
Expression expression = parseBitwiseOrExpression(); |
@@ -8035,12 +7316,12 @@ class Parser { |
if (_matches(TokenType.BANG)) { |
notOperator = getAndAdvance(); |
} |
- expression = |
- new IsExpression(expression, isOperator, notOperator, parseTypeName()); |
+ expression = new IsExpression( |
+ expression, isOperator, notOperator, parseTypeName()); |
} else if (_currentToken.type.isRelationalOperator) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, parseBitwiseOrExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, parseBitwiseOrExpression()); |
} |
return expression; |
} |
@@ -8105,22 +7386,13 @@ 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, |
- parameters, |
- body); |
+ return new MethodDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, externalKeyword, staticKeyword, returnType, |
+ propertyKeyword, null, name, parameters, body); |
} |
/** |
@@ -8144,8 +7416,8 @@ class Parser { |
} |
while (_currentToken.type.isShiftOperator) { |
Token operator = getAndAdvance(); |
- expression = |
- new BinaryExpression(expression, operator, _parseAdditiveExpression()); |
+ expression = new BinaryExpression( |
+ expression, operator, _parseAdditiveExpression()); |
} |
return expression; |
} |
@@ -8168,10 +7440,9 @@ class Parser { |
!_isSwitchMember()) { |
statements.add(parseStatement2()); |
if (identical(_currentToken, statementStart)) { |
- _reportErrorForToken( |
- ParserErrorCode.UNEXPECTED_TOKEN, |
- _currentToken, |
- [_currentToken.lexeme]); |
+ _reportErrorForToken(ParserErrorCode.UNEXPECTED_TOKEN, _currentToken, [ |
+ _currentToken.lexeme |
+ ]); |
_advance(); |
} |
statementStart = _currentToken; |
@@ -8186,13 +7457,10 @@ class Parser { |
*/ |
StringInterpolation _parseStringInterpolation(Token string) { |
List<InterpolationElement> elements = new List<InterpolationElement>(); |
- bool hasMore = |
- _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || |
+ bool hasMore = _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || |
_matches(TokenType.STRING_INTERPOLATION_IDENTIFIER); |
- elements.add( |
- new InterpolationString( |
- string, |
- _computeStringValue(string.lexeme, true, !hasMore))); |
+ elements.add(new InterpolationString( |
+ string, _computeStringValue(string.lexeme, true, !hasMore))); |
while (hasMore) { |
if (_matches(TokenType.STRING_INTERPOLATION_EXPRESSION)) { |
Token openToken = getAndAdvance(); |
@@ -8220,10 +7488,8 @@ class Parser { |
string = getAndAdvance(); |
hasMore = _matches(TokenType.STRING_INTERPOLATION_EXPRESSION) || |
_matches(TokenType.STRING_INTERPOLATION_IDENTIFIER); |
- elements.add( |
- new InterpolationString( |
- string, |
- _computeStringValue(string.lexeme, false, !hasMore))); |
+ elements.add(new InterpolationString( |
+ string, _computeStringValue(string.lexeme, false, !hasMore))); |
} else { |
hasMore = false; |
} |
@@ -8251,10 +7517,7 @@ class Parser { |
} |
ArgumentList argumentList = parseArgumentList(); |
return new SuperConstructorInvocation( |
- keyword, |
- period, |
- constructorName, |
- argumentList); |
+ keyword, period, constructorName, argumentList); |
} |
/** |
@@ -8288,15 +7551,14 @@ class Parser { |
while (!_matches(TokenType.EOF) && |
!_matches(TokenType.CLOSE_CURLY_BRACKET)) { |
List<Label> labels = new List<Label>(); |
- while (_matchesIdentifier() && |
- _tokenMatches(_peek(), TokenType.COLON)) { |
+ while ( |
+ _matchesIdentifier() && _tokenMatches(_peek(), TokenType.COLON)) { |
SimpleIdentifier identifier = parseSimpleIdentifier(); |
String label = identifier.token.lexeme; |
if (definedLabels.contains(label)) { |
_reportErrorForToken( |
ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT, |
- identifier.token, |
- [label]); |
+ identifier.token, [label]); |
} else { |
definedLabels.add(label); |
} |
@@ -8307,13 +7569,8 @@ class Parser { |
Token caseKeyword = getAndAdvance(); |
Expression caseExpression = parseExpression2(); |
Token colon = _expect(TokenType.COLON); |
- members.add( |
- new SwitchCase( |
- labels, |
- caseKeyword, |
- caseExpression, |
- colon, |
- _parseStatementList())); |
+ members.add(new SwitchCase(labels, caseKeyword, caseExpression, colon, |
+ _parseStatementList())); |
if (defaultKeyword != null) { |
_reportErrorForToken( |
ParserErrorCode.SWITCH_HAS_CASE_AFTER_DEFAULT_CASE, |
@@ -8322,13 +7579,12 @@ class Parser { |
} else if (_matchesKeyword(Keyword.DEFAULT)) { |
if (defaultKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, |
- _peek()); |
+ ParserErrorCode.SWITCH_HAS_MULTIPLE_DEFAULT_CASES, _peek()); |
} |
defaultKeyword = getAndAdvance(); |
Token colon = _expect(TokenType.COLON); |
- members.add( |
- new SwitchDefault(labels, defaultKeyword, colon, _parseStatementList())); |
+ members.add(new SwitchDefault( |
+ labels, defaultKeyword, colon, _parseStatementList())); |
} else { |
// We need to advance, otherwise we could end up in an infinite loop, |
// but this could be a lot smarter about recovering from the error. |
@@ -8342,14 +7598,8 @@ class Parser { |
} |
} |
Token rightBracket = _expect(TokenType.CLOSE_CURLY_BRACKET); |
- return new SwitchStatement( |
- keyword, |
- leftParenthesis, |
- expression, |
- rightParenthesis, |
- leftBracket, |
- members, |
- rightBracket); |
+ return new SwitchStatement(keyword, leftParenthesis, expression, |
+ rightParenthesis, leftBracket, members, rightBracket); |
} finally { |
_inSwitch = wasInSwitch; |
} |
@@ -8405,8 +7655,7 @@ class Parser { |
Token keyword = _expectKeyword(Keyword.THROW); |
if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) { |
_reportErrorForToken( |
- ParserErrorCode.MISSING_EXPRESSION_IN_THROW, |
- _currentToken); |
+ ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken); |
return new ThrowExpression(keyword, _createSyntheticIdentifier()); |
} |
Expression expression = parseExpression2(); |
@@ -8427,8 +7676,7 @@ class Parser { |
Token keyword = _expectKeyword(Keyword.THROW); |
if (_matches(TokenType.SEMICOLON) || _matches(TokenType.CLOSE_PAREN)) { |
_reportErrorForToken( |
- ParserErrorCode.MISSING_EXPRESSION_IN_THROW, |
- _currentToken); |
+ ParserErrorCode.MISSING_EXPRESSION_IN_THROW, _currentToken); |
return new ThrowExpression(keyword, _createSyntheticIdentifier()); |
} |
Expression expression = parseExpressionWithoutCascade(); |
@@ -8484,17 +7732,9 @@ 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)) { |
@@ -8506,11 +7746,7 @@ class Parser { |
} |
} |
return new TryStatement( |
- tryKeyword, |
- body, |
- catchClauses, |
- finallyKeyword, |
- finallyClause); |
+ tryKeyword, body, catchClauses, finallyKeyword, finallyClause); |
} |
/** |
@@ -8550,16 +7786,14 @@ class Parser { |
TypeAlias typeAlias = |
_parseClassTypeAlias(commentAndMetadata, null, keyword); |
_reportErrorForToken( |
- ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, |
- keyword); |
+ ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword); |
return typeAlias; |
} |
} else if (_tokenMatches(next, TokenType.EQ)) { |
TypeAlias typeAlias = |
_parseClassTypeAlias(commentAndMetadata, null, keyword); |
_reportErrorForToken( |
- ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, |
- keyword); |
+ ParserErrorCode.DEPRECATED_CLASS_TYPE_ALIAS, keyword); |
return typeAlias; |
} |
} |
@@ -8596,8 +7830,7 @@ class Parser { |
return new PrefixExpression(operator, _parseUnaryExpression()); |
} |
return new PrefixExpression( |
- operator, |
- new SuperExpression(getAndAdvance())); |
+ operator, new SuperExpression(getAndAdvance())); |
} |
return new PrefixExpression(operator, _parseUnaryExpression()); |
} else if (_currentToken.type.isIncrementOperator) { |
@@ -8622,17 +7855,14 @@ 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( |
- ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, |
- [operator.lexeme]); |
+ ParserErrorCode.INVALID_OPERATOR_FOR_SUPER, [operator.lexeme]); |
return new PrefixExpression( |
- operator, |
- new SuperExpression(getAndAdvance())); |
+ operator, new SuperExpression(getAndAdvance())); |
} |
} |
return new PrefixExpression(operator, _parseAssignableExpression(false)); |
@@ -8649,10 +7879,9 @@ class Parser { |
* Parse a string literal representing a URI. |
*/ |
StringLiteral _parseUri() { |
- bool iskeywordAfterUri(Token token) => |
- token.lexeme == Keyword.AS.syntax || |
- token.lexeme == _HIDE || |
- token.lexeme == _SHOW; |
+ bool iskeywordAfterUri(Token token) => token.lexeme == Keyword.AS.syntax || |
+ token.lexeme == _HIDE || |
+ token.lexeme == _SHOW; |
if (!_matches(TokenType.STRING) && |
!_matches(TokenType.SEMICOLON) && |
!iskeywordAfterUri(_currentToken)) { |
@@ -8688,8 +7917,7 @@ class Parser { |
Token newToken = |
new StringToken(TokenType.STRING, "'$value'", _currentToken.offset); |
_reportErrorForToken( |
- ParserErrorCode.NON_STRING_LITERAL_AS_URI, |
- newToken); |
+ ParserErrorCode.NON_STRING_LITERAL_AS_URI, newToken); |
_currentToken = endToken.next; |
return new SimpleStringLiteral(newToken, value); |
} |
@@ -8716,12 +7944,8 @@ class Parser { |
equals = getAndAdvance(); |
initializer = parseExpression2(); |
} |
- return new VariableDeclaration( |
- commentAndMetadata.comment, |
- commentAndMetadata.metadata, |
- name, |
- equals, |
- initializer); |
+ return new VariableDeclaration(commentAndMetadata.comment, |
+ commentAndMetadata.metadata, name, equals, initializer); |
} |
/** |
@@ -8735,13 +7959,11 @@ class Parser { |
* @param commentAndMetadata the metadata to be associated with the variable declaration list |
* @return the variable declaration list that was parsed |
*/ |
- VariableDeclarationList |
- _parseVariableDeclarationListAfterMetadata(CommentAndMetadata commentAndMetadata) { |
+ VariableDeclarationList _parseVariableDeclarationListAfterMetadata( |
+ CommentAndMetadata commentAndMetadata) { |
FinalConstVarOrType holder = _parseFinalConstVarOrType(false); |
return _parseVariableDeclarationListAfterType( |
- commentAndMetadata, |
- holder.keyword, |
- holder.type); |
+ commentAndMetadata, holder.keyword, holder.type); |
} |
/** |
@@ -8759,9 +7981,8 @@ class Parser { |
* @param type the type of the variables in the list |
* @return the variable declaration list that was parsed |
*/ |
- VariableDeclarationList |
- _parseVariableDeclarationListAfterType(CommentAndMetadata commentAndMetadata, |
- Token keyword, TypeName type) { |
+ VariableDeclarationList _parseVariableDeclarationListAfterType( |
+ CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) { |
if (type != null && |
keyword != null && |
_tokenMatchesKeyword(keyword, Keyword.VAR)) { |
@@ -8776,9 +7997,7 @@ class Parser { |
return new VariableDeclarationList( |
commentAndMetadata != null ? commentAndMetadata.comment : null, |
commentAndMetadata != null ? commentAndMetadata.metadata : null, |
- keyword, |
- type, |
- variables); |
+ keyword, type, variables); |
} |
/** |
@@ -8793,8 +8012,8 @@ class Parser { |
* statement, or `null` if there is no attempt at parsing the comment and metadata |
* @return the variable declaration statement that was parsed |
*/ |
- VariableDeclarationStatement |
- _parseVariableDeclarationStatementAfterMetadata(CommentAndMetadata commentAndMetadata) { |
+ VariableDeclarationStatement _parseVariableDeclarationStatementAfterMetadata( |
+ CommentAndMetadata commentAndMetadata) { |
// Token startToken = currentToken; |
VariableDeclarationList variableList = |
_parseVariableDeclarationListAfterMetadata(commentAndMetadata); |
@@ -8823,11 +8042,11 @@ class Parser { |
* @param type the type of the variables in the list |
* @return the variable declaration statement that was parsed |
*/ |
- VariableDeclarationStatement |
- _parseVariableDeclarationStatementAfterType(CommentAndMetadata commentAndMetadata, |
- Token keyword, TypeName type) { |
+ VariableDeclarationStatement _parseVariableDeclarationStatementAfterType( |
+ CommentAndMetadata commentAndMetadata, Token keyword, TypeName type) { |
VariableDeclarationList variableList = |
- _parseVariableDeclarationListAfterType(commentAndMetadata, keyword, type); |
+ _parseVariableDeclarationListAfterType( |
+ commentAndMetadata, keyword, type); |
Token semicolon = _expect(TokenType.SEMICOLON); |
return new VariableDeclarationStatement(variableList, semicolon); |
} |
@@ -8852,11 +8071,7 @@ class Parser { |
Token rightParenthesis = _expect(TokenType.CLOSE_PAREN); |
Statement body = parseStatement2(); |
return new WhileStatement( |
- keyword, |
- leftParenthesis, |
- condition, |
- rightParenthesis, |
- body); |
+ keyword, leftParenthesis, condition, rightParenthesis, body); |
} finally { |
_inLoop = wasInLoop; |
} |
@@ -8938,13 +8153,8 @@ class Parser { |
*/ |
void _reportErrorForNode(ParserErrorCode errorCode, AstNode node, |
[List<Object> arguments]) { |
- _reportError( |
- new AnalysisError.con2( |
- _source, |
- node.offset, |
- node.length, |
- errorCode, |
- arguments)); |
+ _reportError(new AnalysisError.con2( |
+ _source, node.offset, node.length, errorCode, arguments)); |
} |
/** |
@@ -8959,13 +8169,8 @@ class Parser { |
if (token.type == TokenType.EOF) { |
token = token.previous; |
} |
- _reportError( |
- new AnalysisError.con2( |
- _source, |
- token.offset, |
- math.max(token.length, 1), |
- errorCode, |
- arguments)); |
+ _reportError(new AnalysisError.con2(_source, token.offset, |
+ math.max(token.length, 1), errorCode, arguments)); |
} |
/** |
@@ -8980,9 +8185,7 @@ class Parser { |
endToken = _currentToken.next; |
} |
_reportErrorForToken( |
- ParserErrorCode.EXPECTED_TOKEN, |
- _currentToken.previous, |
- ["}"]); |
+ ParserErrorCode.EXPECTED_TOKEN, _currentToken.previous, ["}"]); |
} else { |
_currentToken = endToken.next; |
} |
@@ -9087,8 +8290,11 @@ class Parser { |
// Look to see whether the token after the open parenthesis is something |
// that should only occur at the beginning of a parameter list. |
// |
- if (next.matchesAny( |
- [TokenType.AT, TokenType.OPEN_SQUARE_BRACKET, TokenType.OPEN_CURLY_BRACKET]) || |
+ if (next.matchesAny([ |
+ TokenType.AT, |
+ TokenType.OPEN_SQUARE_BRACKET, |
+ TokenType.OPEN_CURLY_BRACKET |
+ ]) || |
_tokenMatchesKeyword(next, Keyword.VOID) || |
(_tokenMatchesIdentifier(next) && |
(next.next.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN])))) { |
@@ -9102,7 +8308,8 @@ class Parser { |
_tokenMatches(next.next, TokenType.OPEN_PAREN)) { |
Token afterParameters = _skipFormalParameterList(next.next); |
if (afterParameters != null && |
- (afterParameters.matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN]))) { |
+ (afterParameters |
+ .matchesAny([TokenType.COMMA, TokenType.CLOSE_PAREN]))) { |
return _skipPastMatchingToken(startToken); |
} |
} |
@@ -9459,7 +8666,8 @@ class Parser { |
* @return `true` if the given token matches the given keyword |
*/ |
bool _tokenMatchesKeyword(Token token, Keyword keyword) => |
- token.type == TokenType.KEYWORD && (token as KeywordToken).keyword == keyword; |
+ token.type == TokenType.KEYWORD && |
+ (token as KeywordToken).keyword == keyword; |
/** |
* Return `true` if the given token matches the given identifier. |
@@ -9527,8 +8735,7 @@ class Parser { |
// Illegal escape sequence: invalid hex digit |
_reportErrorForCurrentToken(ParserErrorCode.INVALID_HEX_ESCAPE); |
} else { |
- int charCode = |
- (Character.digit(firstDigit, 16) << 4) + |
+ int charCode = (Character.digit(firstDigit, 16) << 4) + |
Character.digit(secondDigit, 16); |
buffer.writeCharCode(charCode); |
} |
@@ -9576,12 +8783,8 @@ class Parser { |
// Illegal escape sequence: not enough or too many hex digits |
_reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE); |
} |
- _appendScalarValue( |
- buffer, |
- lexeme.substring(index, currentIndex + 1), |
- value, |
- index, |
- currentIndex); |
+ _appendScalarValue(buffer, lexeme.substring(index, currentIndex + 1), |
+ value, index, currentIndex); |
return currentIndex + 1; |
} else { |
if (currentIndex + 3 >= length) { |
@@ -9600,17 +8803,13 @@ class Parser { |
// Illegal escape sequence: invalid hex digits |
_reportErrorForCurrentToken(ParserErrorCode.INVALID_UNICODE_ESCAPE); |
} else { |
- _appendScalarValue( |
- buffer, |
- lexeme.substring(index, currentIndex + 1), |
+ _appendScalarValue(buffer, lexeme.substring(index, currentIndex + 1), |
(((((Character.digit(firstDigit, 16) << 4) + |
- Character.digit(secondDigit, 16)) << |
- 4) + |
- Character.digit(thirdDigit, 16)) << |
- 4) + |
- Character.digit(fourthDigit, 16), |
- index, |
- currentIndex + 3); |
+ Character.digit(secondDigit, 16)) << |
+ 4) + |
+ Character.digit(thirdDigit, 16)) << |
+ 4) + |
+ Character.digit(fourthDigit, 16), index, currentIndex + 3); |
} |
return currentIndex + 4; |
} |
@@ -9660,8 +8859,7 @@ class Parser { |
} |
if (modifiers.externalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_CLASS, |
- modifiers.externalKeyword); |
+ ParserErrorCode.EXTERNAL_CLASS, modifiers.externalKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken(ParserErrorCode.FINAL_CLASS, modifiers.finalKeyword); |
@@ -9682,23 +8880,19 @@ class Parser { |
Token _validateModifiersForConstructor(Modifiers modifiers) { |
if (modifiers.abstractKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.ABSTRACT_CLASS_MEMBER, |
- modifiers.abstractKeyword); |
+ ParserErrorCode.ABSTRACT_CLASS_MEMBER, modifiers.abstractKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FINAL_CONSTRUCTOR, |
- modifiers.finalKeyword); |
+ ParserErrorCode.FINAL_CONSTRUCTOR, modifiers.finalKeyword); |
} |
if (modifiers.staticKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.STATIC_CONSTRUCTOR, |
- modifiers.staticKeyword); |
+ ParserErrorCode.STATIC_CONSTRUCTOR, modifiers.staticKeyword); |
} |
if (modifiers.varKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, |
- modifiers.varKeyword); |
+ ParserErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE, modifiers.varKeyword); |
} |
Token externalKeyword = modifiers.externalKeyword; |
Token constKeyword = modifiers.constKeyword; |
@@ -9707,15 +8901,13 @@ class Parser { |
constKeyword != null && |
constKeyword.offset < externalKeyword.offset) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_AFTER_CONST, |
- externalKeyword); |
+ ParserErrorCode.EXTERNAL_AFTER_CONST, externalKeyword); |
} |
if (externalKeyword != null && |
factoryKeyword != null && |
factoryKeyword.offset < externalKeyword.offset) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_AFTER_FACTORY, |
- externalKeyword); |
+ ParserErrorCode.EXTERNAL_AFTER_FACTORY, externalKeyword); |
} |
return constKeyword; |
} |
@@ -9730,16 +8922,14 @@ class Parser { |
_validateModifiersForTopLevelDeclaration(modifiers); |
if (modifiers.abstractKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.ABSTRACT_ENUM, |
- modifiers.abstractKeyword); |
+ ParserErrorCode.ABSTRACT_ENUM, modifiers.abstractKeyword); |
} |
if (modifiers.constKeyword != null) { |
_reportErrorForToken(ParserErrorCode.CONST_ENUM, modifiers.constKeyword); |
} |
if (modifiers.externalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_ENUM, |
- modifiers.externalKeyword); |
+ ParserErrorCode.EXTERNAL_ENUM, modifiers.externalKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken(ParserErrorCode.FINAL_ENUM, modifiers.finalKeyword); |
@@ -9762,13 +8952,11 @@ class Parser { |
} |
if (modifiers.externalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_FIELD, |
- modifiers.externalKeyword); |
+ ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword); |
} |
if (modifiers.factoryKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.NON_CONSTRUCTOR_FACTORY, |
- modifiers.factoryKeyword); |
+ ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword); |
} |
Token staticKeyword = modifiers.staticKeyword; |
Token constKeyword = modifiers.constKeyword; |
@@ -9828,23 +9016,19 @@ class Parser { |
} |
if (modifiers.constKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.CONST_METHOD, |
- modifiers.constKeyword); |
+ ParserErrorCode.CONST_METHOD, modifiers.constKeyword); |
} |
if (modifiers.factoryKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.NON_CONSTRUCTOR_FACTORY, |
- modifiers.factoryKeyword); |
+ ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FINAL_METHOD, |
- modifiers.finalKeyword); |
+ ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword); |
} |
if (modifiers.varKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.VAR_RETURN_TYPE, |
- modifiers.varKeyword); |
+ ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword); |
} |
Token externalKeyword = modifiers.externalKeyword; |
Token staticKeyword = modifiers.staticKeyword; |
@@ -9852,8 +9036,7 @@ class Parser { |
staticKeyword != null && |
staticKeyword.offset < externalKeyword.offset) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_AFTER_STATIC, |
- externalKeyword); |
+ ParserErrorCode.EXTERNAL_AFTER_STATIC, externalKeyword); |
} |
} |
@@ -9868,28 +9051,23 @@ class Parser { |
} |
if (modifiers.constKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.CONST_METHOD, |
- modifiers.constKeyword); |
+ ParserErrorCode.CONST_METHOD, modifiers.constKeyword); |
} |
if (modifiers.factoryKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.NON_CONSTRUCTOR_FACTORY, |
- modifiers.factoryKeyword); |
+ ParserErrorCode.NON_CONSTRUCTOR_FACTORY, modifiers.factoryKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FINAL_METHOD, |
- modifiers.finalKeyword); |
+ ParserErrorCode.FINAL_METHOD, modifiers.finalKeyword); |
} |
if (modifiers.staticKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.STATIC_OPERATOR, |
- modifiers.staticKeyword); |
+ ParserErrorCode.STATIC_OPERATOR, modifiers.staticKeyword); |
} |
if (modifiers.varKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.VAR_RETURN_TYPE, |
- modifiers.varKeyword); |
+ ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword); |
} |
} |
@@ -9900,13 +9078,11 @@ class Parser { |
*/ |
void _validateModifiersForTopLevelDeclaration(Modifiers modifiers) { |
if (modifiers.factoryKeyword != null) { |
- _reportErrorForToken( |
- ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, |
+ _reportErrorForToken(ParserErrorCode.FACTORY_TOP_LEVEL_DECLARATION, |
modifiers.factoryKeyword); |
} |
if (modifiers.staticKeyword != null) { |
- _reportErrorForToken( |
- ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, |
+ _reportErrorForToken(ParserErrorCode.STATIC_TOP_LEVEL_DECLARATION, |
modifiers.staticKeyword); |
} |
} |
@@ -9929,8 +9105,7 @@ class Parser { |
} |
if (modifiers.varKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.VAR_RETURN_TYPE, |
- modifiers.varKeyword); |
+ ParserErrorCode.VAR_RETURN_TYPE, modifiers.varKeyword); |
} |
} |
@@ -9948,8 +9123,7 @@ class Parser { |
} |
if (modifiers.externalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_FIELD, |
- modifiers.externalKeyword); |
+ ParserErrorCode.EXTERNAL_FIELD, modifiers.externalKeyword); |
} |
Token constKeyword = modifiers.constKeyword; |
Token finalKeyword = modifiers.finalKeyword; |
@@ -9979,23 +9153,19 @@ class Parser { |
_validateModifiersForTopLevelDeclaration(modifiers); |
if (modifiers.abstractKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.ABSTRACT_TYPEDEF, |
- modifiers.abstractKeyword); |
+ ParserErrorCode.ABSTRACT_TYPEDEF, modifiers.abstractKeyword); |
} |
if (modifiers.constKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.CONST_TYPEDEF, |
- modifiers.constKeyword); |
+ ParserErrorCode.CONST_TYPEDEF, modifiers.constKeyword); |
} |
if (modifiers.externalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.EXTERNAL_TYPEDEF, |
- modifiers.externalKeyword); |
+ ParserErrorCode.EXTERNAL_TYPEDEF, modifiers.externalKeyword); |
} |
if (modifiers.finalKeyword != null) { |
_reportErrorForToken( |
- ParserErrorCode.FINAL_TYPEDEF, |
- modifiers.finalKeyword); |
+ ParserErrorCode.FINAL_TYPEDEF, modifiers.finalKeyword); |
} |
if (modifiers.varKeyword != null) { |
_reportErrorForToken(ParserErrorCode.VAR_TYPEDEF, modifiers.varKeyword); |
@@ -10022,7 +9192,6 @@ class Parser_SyntheticKeywordToken extends KeywordToken { |
Token copy() => new Parser_SyntheticKeywordToken(keyword, offset); |
} |
- |
/** |
* The enumeration `ParserErrorCode` defines the error codes used for errors |
* detected by the parser. The convention for this class is for the name of the |
@@ -10036,50 +9205,41 @@ class ParserErrorCode extends ErrorCode { |
"Members of classes cannot be declared to be 'abstract'"); |
static const ParserErrorCode ABSTRACT_ENUM = const ParserErrorCode( |
- 'ABSTRACT_ENUM', |
- "Enums cannot be declared to be 'abstract'"); |
+ 'ABSTRACT_ENUM', "Enums cannot be declared to be 'abstract'"); |
static const ParserErrorCode ABSTRACT_STATIC_METHOD = const ParserErrorCode( |
'ABSTRACT_STATIC_METHOD', |
"Static methods cannot be declared to be 'abstract'"); |
static const ParserErrorCode ABSTRACT_TOP_LEVEL_FUNCTION = |
- const ParserErrorCode( |
- 'ABSTRACT_TOP_LEVEL_FUNCTION', |
+ const ParserErrorCode('ABSTRACT_TOP_LEVEL_FUNCTION', |
"Top-level functions cannot be declared to be 'abstract'"); |
static const ParserErrorCode ABSTRACT_TOP_LEVEL_VARIABLE = |
- const ParserErrorCode( |
- 'ABSTRACT_TOP_LEVEL_VARIABLE', |
+ const ParserErrorCode('ABSTRACT_TOP_LEVEL_VARIABLE', |
"Top-level variables cannot be declared to be 'abstract'"); |
static const ParserErrorCode ABSTRACT_TYPEDEF = const ParserErrorCode( |
- 'ABSTRACT_TYPEDEF', |
- "Type aliases cannot be declared to be 'abstract'"); |
+ 'ABSTRACT_TYPEDEF', "Type aliases cannot be declared to be 'abstract'"); |
static const ParserErrorCode ANNOTATION_ON_ENUM_CONSTANT = |
- const ParserErrorCode( |
- 'ANNOTATION_ON_ENUM_CONSTANT', |
+ const ParserErrorCode('ANNOTATION_ON_ENUM_CONSTANT', |
"Enum constants cannot have annotations"); |
static const ParserErrorCode ASSERT_DOES_NOT_TAKE_ASSIGNMENT = |
- const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_ASSIGNMENT', |
+ const ParserErrorCode('ASSERT_DOES_NOT_TAKE_ASSIGNMENT', |
"Assert cannot be called on an assignment"); |
static const ParserErrorCode ASSERT_DOES_NOT_TAKE_CASCADE = |
const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_CASCADE', |
- "Assert cannot be called on cascade"); |
+ 'ASSERT_DOES_NOT_TAKE_CASCADE', "Assert cannot be called on cascade"); |
static const ParserErrorCode ASSERT_DOES_NOT_TAKE_THROW = |
const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_THROW', |
- "Assert cannot be called on throws"); |
+ 'ASSERT_DOES_NOT_TAKE_THROW', "Assert cannot be called on throws"); |
static const ParserErrorCode ASSERT_DOES_NOT_TAKE_RETHROW = |
- const ParserErrorCode( |
- 'ASSERT_DOES_NOT_TAKE_RETHROW', |
+ const ParserErrorCode('ASSERT_DOES_NOT_TAKE_RETHROW', |
"Assert cannot be called on rethrows"); |
/** |
@@ -10088,8 +9248,7 @@ class ParserErrorCode extends ErrorCode { |
* body marked with either async, async*, or sync*. |
*/ |
static const ParserErrorCode ASYNC_KEYWORD_USED_AS_IDENTIFIER = |
- const ParserErrorCode( |
- 'ASYNC_KEYWORD_USED_AS_IDENTIFIER', |
+ const ParserErrorCode('ASYNC_KEYWORD_USED_AS_IDENTIFIER', |
"The keywords 'async', 'await', and 'yield' may not be used as identifiers in an asynchronous or generator function."); |
static const ParserErrorCode BREAK_OUTSIDE_OF_LOOP = const ParserErrorCode( |
@@ -10097,12 +9256,10 @@ class ParserErrorCode extends ErrorCode { |
"A break statement cannot be used outside of a loop or switch statement"); |
static const ParserErrorCode CLASS_IN_CLASS = const ParserErrorCode( |
- 'CLASS_IN_CLASS', |
- "Classes cannot be declared inside other classes"); |
+ 'CLASS_IN_CLASS', "Classes cannot be declared inside other classes"); |
static const ParserErrorCode COLON_IN_PLACE_OF_IN = const ParserErrorCode( |
- 'COLON_IN_PLACE_OF_IN', |
- "For-in loops use 'in' rather than a colon"); |
+ 'COLON_IN_PLACE_OF_IN', "For-in loops use 'in' rather than a colon"); |
static const ParserErrorCode CONST_AND_FINAL = const ParserErrorCode( |
'CONST_AND_FINAL', |
@@ -10113,16 +9270,14 @@ class ParserErrorCode extends ErrorCode { |
"Members cannot be declared to be both 'const' and 'var'"); |
static const ParserErrorCode CONST_CLASS = const ParserErrorCode( |
- 'CONST_CLASS', |
- "Classes cannot be declared to be 'const'"); |
+ 'CONST_CLASS', "Classes cannot be declared to be 'const'"); |
static const ParserErrorCode CONST_CONSTRUCTOR_WITH_BODY = |
- const ParserErrorCode( |
- 'CONST_CONSTRUCTOR_WITH_BODY', |
+ const ParserErrorCode('CONST_CONSTRUCTOR_WITH_BODY', |
"'const' constructors cannot have a body"); |
- static const ParserErrorCode CONST_ENUM = |
- const ParserErrorCode('CONST_ENUM', "Enums cannot be declared to be 'const'"); |
+ static const ParserErrorCode CONST_ENUM = const ParserErrorCode( |
+ 'CONST_ENUM', "Enums cannot be declared to be 'const'"); |
static const ParserErrorCode CONST_FACTORY = const ParserErrorCode( |
'CONST_FACTORY', |
@@ -10133,12 +9288,10 @@ class ParserErrorCode extends ErrorCode { |
"Getters, setters and methods cannot be declared to be 'const'"); |
static const ParserErrorCode CONST_TYPEDEF = const ParserErrorCode( |
- 'CONST_TYPEDEF', |
- "Type aliases cannot be declared to be 'const'"); |
+ 'CONST_TYPEDEF', "Type aliases cannot be declared to be 'const'"); |
static const ParserErrorCode CONSTRUCTOR_WITH_RETURN_TYPE = |
- const ParserErrorCode( |
- 'CONSTRUCTOR_WITH_RETURN_TYPE', |
+ const ParserErrorCode('CONSTRUCTOR_WITH_RETURN_TYPE', |
"Constructors cannot have a return type"); |
static const ParserErrorCode CONTINUE_OUTSIDE_OF_LOOP = const ParserErrorCode( |
@@ -10146,41 +9299,33 @@ class ParserErrorCode extends ErrorCode { |
"A continue statement cannot be used outside of a loop or switch statement"); |
static const ParserErrorCode CONTINUE_WITHOUT_LABEL_IN_CASE = |
- const ParserErrorCode( |
- 'CONTINUE_WITHOUT_LABEL_IN_CASE', |
+ const ParserErrorCode('CONTINUE_WITHOUT_LABEL_IN_CASE', |
"A continue statement in a switch statement must have a label as a target"); |
static const ParserErrorCode DEPRECATED_CLASS_TYPE_ALIAS = |
- const ParserErrorCode( |
- 'DEPRECATED_CLASS_TYPE_ALIAS', |
+ const ParserErrorCode('DEPRECATED_CLASS_TYPE_ALIAS', |
"The 'typedef' mixin application was replaced with 'class'"); |
static const ParserErrorCode DIRECTIVE_AFTER_DECLARATION = |
- const ParserErrorCode( |
- 'DIRECTIVE_AFTER_DECLARATION', |
+ const ParserErrorCode('DIRECTIVE_AFTER_DECLARATION', |
"Directives must appear before any declarations"); |
static const ParserErrorCode DUPLICATE_LABEL_IN_SWITCH_STATEMENT = |
- const ParserErrorCode( |
- 'DUPLICATE_LABEL_IN_SWITCH_STATEMENT', |
+ const ParserErrorCode('DUPLICATE_LABEL_IN_SWITCH_STATEMENT', |
"The label {0} was already used in this switch statement"); |
static const ParserErrorCode DUPLICATED_MODIFIER = const ParserErrorCode( |
- 'DUPLICATED_MODIFIER', |
- "The modifier '{0}' was already specified."); |
+ 'DUPLICATED_MODIFIER', "The modifier '{0}' was already specified."); |
static const ParserErrorCode EMPTY_ENUM_BODY = const ParserErrorCode( |
- 'EMPTY_ENUM_BODY', |
- "An enum must declare at least one constant name"); |
+ 'EMPTY_ENUM_BODY', "An enum must declare at least one constant name"); |
static const ParserErrorCode EQUALITY_CANNOT_BE_EQUALITY_OPERAND = |
- const ParserErrorCode( |
- 'EQUALITY_CANNOT_BE_EQUALITY_OPERAND', |
+ const ParserErrorCode('EQUALITY_CANNOT_BE_EQUALITY_OPERAND', |
"Equality expression cannot be operand of another equality expression."); |
static const ParserErrorCode EXPECTED_CASE_OR_DEFAULT = const ParserErrorCode( |
- 'EXPECTED_CASE_OR_DEFAULT', |
- "Expected 'case' or 'default'"); |
+ 'EXPECTED_CASE_OR_DEFAULT', "Expected 'case' or 'default'"); |
static const ParserErrorCode EXPECTED_CLASS_MEMBER = |
const ParserErrorCode('EXPECTED_CLASS_MEMBER', "Expected a class member"); |
@@ -10191,11 +9336,10 @@ class ParserErrorCode extends ErrorCode { |
static const ParserErrorCode EXPECTED_LIST_OR_MAP_LITERAL = |
const ParserErrorCode( |
- 'EXPECTED_LIST_OR_MAP_LITERAL', |
- "Expected a list or map literal"); |
+ 'EXPECTED_LIST_OR_MAP_LITERAL', "Expected a list or map literal"); |
- static const ParserErrorCode EXPECTED_STRING_LITERAL = |
- const ParserErrorCode('EXPECTED_STRING_LITERAL', "Expected a string literal"); |
+ static const ParserErrorCode EXPECTED_STRING_LITERAL = const ParserErrorCode( |
+ 'EXPECTED_STRING_LITERAL', "Expected a string literal"); |
static const ParserErrorCode EXPECTED_TOKEN = |
const ParserErrorCode('EXPECTED_TOKEN', "Expected to find '{0}'"); |
@@ -10204,8 +9348,7 @@ class ParserErrorCode extends ErrorCode { |
const ParserErrorCode('EXPECTED_TYPE_NAME', "Expected a type name"); |
static const ParserErrorCode EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = |
- const ParserErrorCode( |
- 'EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', |
+ const ParserErrorCode('EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', |
"Export directives must preceed part directives"); |
static const ParserErrorCode EXTERNAL_AFTER_CONST = const ParserErrorCode( |
@@ -10221,65 +9364,53 @@ class ParserErrorCode extends ErrorCode { |
"The modifier 'external' should be before the modifier 'static'"); |
static const ParserErrorCode EXTERNAL_CLASS = const ParserErrorCode( |
- 'EXTERNAL_CLASS', |
- "Classes cannot be declared to be 'external'"); |
+ 'EXTERNAL_CLASS', "Classes cannot be declared to be 'external'"); |
static const ParserErrorCode EXTERNAL_CONSTRUCTOR_WITH_BODY = |
- const ParserErrorCode( |
- 'EXTERNAL_CONSTRUCTOR_WITH_BODY', |
+ const ParserErrorCode('EXTERNAL_CONSTRUCTOR_WITH_BODY', |
"External constructors cannot have a body"); |
static const ParserErrorCode EXTERNAL_ENUM = const ParserErrorCode( |
- 'EXTERNAL_ENUM', |
- "Enums cannot be declared to be 'external'"); |
+ 'EXTERNAL_ENUM', "Enums cannot be declared to be 'external'"); |
static const ParserErrorCode EXTERNAL_FIELD = const ParserErrorCode( |
- 'EXTERNAL_FIELD', |
- "Fields cannot be declared to be 'external'"); |
+ 'EXTERNAL_FIELD', "Fields cannot be declared to be 'external'"); |
static const ParserErrorCode EXTERNAL_GETTER_WITH_BODY = |
const ParserErrorCode( |
- 'EXTERNAL_GETTER_WITH_BODY', |
- "External getters cannot have a body"); |
+ 'EXTERNAL_GETTER_WITH_BODY', "External getters cannot have a body"); |
static const ParserErrorCode EXTERNAL_METHOD_WITH_BODY = |
const ParserErrorCode( |
- 'EXTERNAL_METHOD_WITH_BODY', |
- "External methods cannot have a body"); |
+ 'EXTERNAL_METHOD_WITH_BODY', "External methods cannot have a body"); |
static const ParserErrorCode EXTERNAL_OPERATOR_WITH_BODY = |
- const ParserErrorCode( |
- 'EXTERNAL_OPERATOR_WITH_BODY', |
+ const ParserErrorCode('EXTERNAL_OPERATOR_WITH_BODY', |
"External operators cannot have a body"); |
static const ParserErrorCode EXTERNAL_SETTER_WITH_BODY = |
const ParserErrorCode( |
- 'EXTERNAL_SETTER_WITH_BODY', |
- "External setters cannot have a body"); |
+ 'EXTERNAL_SETTER_WITH_BODY', "External setters cannot have a body"); |
static const ParserErrorCode EXTERNAL_TYPEDEF = const ParserErrorCode( |
- 'EXTERNAL_TYPEDEF', |
- "Type aliases cannot be declared to be 'external'"); |
+ 'EXTERNAL_TYPEDEF', "Type aliases cannot be declared to be 'external'"); |
static const ParserErrorCode FACTORY_TOP_LEVEL_DECLARATION = |
- const ParserErrorCode( |
- 'FACTORY_TOP_LEVEL_DECLARATION', |
+ const ParserErrorCode('FACTORY_TOP_LEVEL_DECLARATION', |
"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."); |
+ "constructor or remove the initializers."); |
static const ParserErrorCode FACTORY_WITHOUT_BODY = const ParserErrorCode( |
'FACTORY_WITHOUT_BODY', |
"A non-redirecting 'factory' constructor must have a body"); |
static const ParserErrorCode FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR = |
- const ParserErrorCode( |
- 'FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', |
+ const ParserErrorCode('FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR', |
"Field initializers can only be used in a constructor"); |
static const ParserErrorCode FINAL_AND_VAR = const ParserErrorCode( |
@@ -10287,28 +9418,24 @@ class ParserErrorCode extends ErrorCode { |
"Members cannot be declared to be both 'final' and 'var'"); |
static const ParserErrorCode FINAL_CLASS = const ParserErrorCode( |
- 'FINAL_CLASS', |
- "Classes cannot be declared to be 'final'"); |
+ 'FINAL_CLASS', "Classes cannot be declared to be 'final'"); |
static const ParserErrorCode FINAL_CONSTRUCTOR = const ParserErrorCode( |
- 'FINAL_CONSTRUCTOR', |
- "A constructor cannot be declared to be 'final'"); |
+ 'FINAL_CONSTRUCTOR', "A constructor cannot be declared to be 'final'"); |
- static const ParserErrorCode FINAL_ENUM = |
- const ParserErrorCode('FINAL_ENUM', "Enums cannot be declared to be 'final'"); |
+ static const ParserErrorCode FINAL_ENUM = const ParserErrorCode( |
+ 'FINAL_ENUM', "Enums cannot be declared to be 'final'"); |
static const ParserErrorCode FINAL_METHOD = const ParserErrorCode( |
'FINAL_METHOD', |
"Getters, setters and methods cannot be declared to be 'final'"); |
static const ParserErrorCode FINAL_TYPEDEF = const ParserErrorCode( |
- 'FINAL_TYPEDEF', |
- "Type aliases cannot be declared to be 'final'"); |
+ 'FINAL_TYPEDEF', "Type aliases cannot be declared to be 'final'"); |
- static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = |
- const ParserErrorCode( |
- 'FUNCTION_TYPED_PARAMETER_VAR', |
- "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type"); |
+ static const ParserErrorCode FUNCTION_TYPED_PARAMETER_VAR = const ParserErrorCode( |
+ 'FUNCTION_TYPED_PARAMETER_VAR', |
+ "Function typed parameters cannot specify 'const', 'final' or 'var' instead of return type"); |
static const ParserErrorCode GETTER_IN_FUNCTION = const ParserErrorCode( |
'GETTER_IN_FUNCTION', |
@@ -10319,13 +9446,11 @@ class ParserErrorCode extends ErrorCode { |
"Getter should be declared without a parameter list"); |
static const ParserErrorCode ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE = |
- const ParserErrorCode( |
- 'ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', |
+ const ParserErrorCode('ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE', |
"Illegal assignment to non-assignable expression"); |
static const ParserErrorCode IMPLEMENTS_BEFORE_EXTENDS = |
- const ParserErrorCode( |
- 'IMPLEMENTS_BEFORE_EXTENDS', |
+ const ParserErrorCode('IMPLEMENTS_BEFORE_EXTENDS', |
"The extends clause must be before the implements clause"); |
static const ParserErrorCode IMPLEMENTS_BEFORE_WITH = const ParserErrorCode( |
@@ -10333,13 +9458,11 @@ class ParserErrorCode extends ErrorCode { |
"The with clause must be before the implements clause"); |
static const ParserErrorCode IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE = |
- const ParserErrorCode( |
- 'IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', |
+ const ParserErrorCode('IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE', |
"Import directives must preceed part directives"); |
static const ParserErrorCode INITIALIZED_VARIABLE_IN_FOR_EACH = |
- const ParserErrorCode( |
- 'INITIALIZED_VARIABLE_IN_FOR_EACH', |
+ const ParserErrorCode('INITIALIZED_VARIABLE_IN_FOR_EACH', |
"The loop variable in a for-each loop cannot be initialized"); |
static const ParserErrorCode INVALID_AWAIT_IN_FOR = const ParserErrorCode( |
@@ -10351,22 +9474,19 @@ class ParserErrorCode extends ErrorCode { |
'INVALID_CODE_POINT', |
"The escape sequence '{0}' is not a valid code point"); |
- static const ParserErrorCode INVALID_COMMENT_REFERENCE = |
- const ParserErrorCode( |
- 'INVALID_COMMENT_REFERENCE', |
- "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else"); |
+ static const ParserErrorCode INVALID_COMMENT_REFERENCE = const ParserErrorCode( |
+ 'INVALID_COMMENT_REFERENCE', |
+ "Comment references should contain a possibly prefixed identifier and can start with 'new', but should not contain anything else"); |
static const ParserErrorCode INVALID_HEX_ESCAPE = const ParserErrorCode( |
'INVALID_HEX_ESCAPE', |
"An escape sequence starting with '\\x' must be followed by 2 hexidecimal digits"); |
static const ParserErrorCode INVALID_OPERATOR = const ParserErrorCode( |
- 'INVALID_OPERATOR', |
- "The string '{0}' is not a valid operator"); |
+ 'INVALID_OPERATOR', "The string '{0}' is not a valid operator"); |
static const ParserErrorCode INVALID_OPERATOR_FOR_SUPER = |
- const ParserErrorCode( |
- 'INVALID_OPERATOR_FOR_SUPER', |
+ const ParserErrorCode('INVALID_OPERATOR_FOR_SUPER', |
"The operator '{0}' cannot be used with 'super'"); |
static const ParserErrorCode INVALID_STAR_AFTER_ASYNC = const ParserErrorCode( |
@@ -10384,23 +9504,19 @@ class ParserErrorCode extends ErrorCode { |
"An escape sequence starting with '\\u' must be followed by 4 hexidecimal digits or from 1 to 6 digits between '{' and '}'"); |
static const ParserErrorCode LIBRARY_DIRECTIVE_NOT_FIRST = |
- const ParserErrorCode( |
- 'LIBRARY_DIRECTIVE_NOT_FIRST', |
+ const ParserErrorCode('LIBRARY_DIRECTIVE_NOT_FIRST', |
"The library directive must appear before all other directives"); |
static const ParserErrorCode LOCAL_FUNCTION_DECLARATION_MODIFIER = |
- const ParserErrorCode( |
- 'LOCAL_FUNCTION_DECLARATION_MODIFIER', |
+ const ParserErrorCode('LOCAL_FUNCTION_DECLARATION_MODIFIER', |
"Local function declarations cannot specify any modifier"); |
static const ParserErrorCode MISSING_ASSIGNABLE_SELECTOR = |
- const ParserErrorCode( |
- 'MISSING_ASSIGNABLE_SELECTOR', |
+ const ParserErrorCode('MISSING_ASSIGNABLE_SELECTOR', |
"Missing selector such as \".<identifier>\" or \"[0]\""); |
static const ParserErrorCode MISSING_ASSIGNMENT_IN_INITIALIZER = |
- const ParserErrorCode( |
- 'MISSING_ASSIGNMENT_IN_INITIALIZER', |
+ const ParserErrorCode('MISSING_ASSIGNMENT_IN_INITIALIZER', |
"Expected an assignment after the field name"); |
static const ParserErrorCode MISSING_CATCH_OR_FINALLY = const ParserErrorCode( |
@@ -10413,12 +9529,10 @@ class ParserErrorCode extends ErrorCode { |
static const ParserErrorCode MISSING_CLOSING_PARENTHESIS = |
const ParserErrorCode( |
- 'MISSING_CLOSING_PARENTHESIS', |
- "The closing parenthesis is missing"); |
+ 'MISSING_CLOSING_PARENTHESIS', "The closing parenthesis is missing"); |
static const ParserErrorCode MISSING_CONST_FINAL_VAR_OR_TYPE = |
- const ParserErrorCode( |
- 'MISSING_CONST_FINAL_VAR_OR_TYPE', |
+ const ParserErrorCode('MISSING_CONST_FINAL_VAR_OR_TYPE', |
"Variables must be declared using the keywords 'const', 'final', 'var' or a type name"); |
static const ParserErrorCode MISSING_ENUM_BODY = const ParserErrorCode( |
@@ -10426,27 +9540,22 @@ class ParserErrorCode extends ErrorCode { |
"An enum definition must have a body with at least one constant name"); |
static const ParserErrorCode MISSING_EXPRESSION_IN_INITIALIZER = |
- const ParserErrorCode( |
- 'MISSING_EXPRESSION_IN_INITIALIZER', |
+ const ParserErrorCode('MISSING_EXPRESSION_IN_INITIALIZER', |
"Expected an expression after the assignment operator"); |
static const ParserErrorCode MISSING_EXPRESSION_IN_THROW = |
- const ParserErrorCode( |
- 'MISSING_EXPRESSION_IN_THROW', |
+ const ParserErrorCode('MISSING_EXPRESSION_IN_THROW', |
"Throw expressions must compute the object to be thrown"); |
static const ParserErrorCode MISSING_FUNCTION_BODY = const ParserErrorCode( |
- 'MISSING_FUNCTION_BODY', |
- "A function body must be provided"); |
+ 'MISSING_FUNCTION_BODY', "A function body must be provided"); |
static const ParserErrorCode MISSING_FUNCTION_PARAMETERS = |
- const ParserErrorCode( |
- 'MISSING_FUNCTION_PARAMETERS', |
+ const ParserErrorCode('MISSING_FUNCTION_PARAMETERS', |
"Functions must have an explicit list of parameters"); |
static const ParserErrorCode MISSING_METHOD_PARAMETERS = |
- const ParserErrorCode( |
- 'MISSING_METHOD_PARAMETERS', |
+ const ParserErrorCode('MISSING_METHOD_PARAMETERS', |
"Methods must have an explicit list of parameters"); |
static const ParserErrorCode MISSING_GET = const ParserErrorCode( |
@@ -10464,18 +9573,15 @@ class ParserErrorCode extends ErrorCode { |
"Operator declarations must be preceeded by the keyword 'operator'"); |
static const ParserErrorCode MISSING_NAME_IN_LIBRARY_DIRECTIVE = |
- const ParserErrorCode( |
- 'MISSING_NAME_IN_LIBRARY_DIRECTIVE', |
+ const ParserErrorCode('MISSING_NAME_IN_LIBRARY_DIRECTIVE', |
"Library directives must include a library name"); |
static const ParserErrorCode MISSING_NAME_IN_PART_OF_DIRECTIVE = |
- const ParserErrorCode( |
- 'MISSING_NAME_IN_PART_OF_DIRECTIVE', |
+ const ParserErrorCode('MISSING_NAME_IN_PART_OF_DIRECTIVE', |
"Library directives must include a library name"); |
static const ParserErrorCode MISSING_PREFIX_IN_DEFERRED_IMPORT = |
- const ParserErrorCode( |
- 'MISSING_PREFIX_IN_DEFERRED_IMPORT', |
+ const ParserErrorCode('MISSING_PREFIX_IN_DEFERRED_IMPORT', |
"Deferred imports must have a prefix"); |
static const ParserErrorCode MISSING_STAR_AFTER_SYNC = const ParserErrorCode( |
@@ -10487,19 +9593,16 @@ class ParserErrorCode extends ErrorCode { |
const ParserErrorCode('MISSING_STATEMENT', "Expected a statement"); |
static const ParserErrorCode MISSING_TERMINATOR_FOR_PARAMETER_GROUP = |
- const ParserErrorCode( |
- 'MISSING_TERMINATOR_FOR_PARAMETER_GROUP', |
+ const ParserErrorCode('MISSING_TERMINATOR_FOR_PARAMETER_GROUP', |
"There is no '{0}' to close the parameter group"); |
static const ParserErrorCode MISSING_TYPEDEF_PARAMETERS = |
- const ParserErrorCode( |
- 'MISSING_TYPEDEF_PARAMETERS', |
+ const ParserErrorCode('MISSING_TYPEDEF_PARAMETERS', |
"Type aliases for functions must have an explicit list of parameters"); |
- static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = |
- const ParserErrorCode( |
- 'MISSING_VARIABLE_IN_FOR_EACH', |
- "A loop variable must be declared in a for-each loop before the 'in', but none were found"); |
+ static const ParserErrorCode MISSING_VARIABLE_IN_FOR_EACH = const ParserErrorCode( |
+ 'MISSING_VARIABLE_IN_FOR_EACH', |
+ "A loop variable must be declared in a for-each loop before the 'in', but none were found"); |
static const ParserErrorCode MIXED_PARAMETER_GROUPS = const ParserErrorCode( |
'MIXED_PARAMETER_GROUPS', |
@@ -10510,33 +9613,27 @@ class ParserErrorCode extends ErrorCode { |
"Each class definition can have at most one extends clause"); |
static const ParserErrorCode MULTIPLE_IMPLEMENTS_CLAUSES = |
- const ParserErrorCode( |
- 'MULTIPLE_IMPLEMENTS_CLAUSES', |
+ const ParserErrorCode('MULTIPLE_IMPLEMENTS_CLAUSES', |
"Each class definition can have at most one implements clause"); |
static const ParserErrorCode MULTIPLE_LIBRARY_DIRECTIVES = |
- const ParserErrorCode( |
- 'MULTIPLE_LIBRARY_DIRECTIVES', |
+ const ParserErrorCode('MULTIPLE_LIBRARY_DIRECTIVES', |
"Only one library directive may be declared in a file"); |
static const ParserErrorCode MULTIPLE_NAMED_PARAMETER_GROUPS = |
- const ParserErrorCode( |
- 'MULTIPLE_NAMED_PARAMETER_GROUPS', |
+ const ParserErrorCode('MULTIPLE_NAMED_PARAMETER_GROUPS', |
"Cannot have multiple groups of named parameters in a single parameter list"); |
static const ParserErrorCode MULTIPLE_PART_OF_DIRECTIVES = |
- const ParserErrorCode( |
- 'MULTIPLE_PART_OF_DIRECTIVES', |
+ const ParserErrorCode('MULTIPLE_PART_OF_DIRECTIVES', |
"Only one part-of directive may be declared in a file"); |
static const ParserErrorCode MULTIPLE_POSITIONAL_PARAMETER_GROUPS = |
- const ParserErrorCode( |
- 'MULTIPLE_POSITIONAL_PARAMETER_GROUPS', |
+ const ParserErrorCode('MULTIPLE_POSITIONAL_PARAMETER_GROUPS', |
"Cannot have multiple groups of positional parameters in a single parameter list"); |
static const ParserErrorCode MULTIPLE_VARIABLES_IN_FOR_EACH = |
- const ParserErrorCode( |
- 'MULTIPLE_VARIABLES_IN_FOR_EACH', |
+ const ParserErrorCode('MULTIPLE_VARIABLES_IN_FOR_EACH', |
"A single loop variable must be declared in a for-each loop before the 'in', but {0} were found"); |
static const ParserErrorCode MULTIPLE_WITH_CLAUSES = const ParserErrorCode( |
@@ -10545,22 +9642,18 @@ class ParserErrorCode extends ErrorCode { |
static const ParserErrorCode NAMED_FUNCTION_EXPRESSION = |
const ParserErrorCode( |
- 'NAMED_FUNCTION_EXPRESSION', |
- "Function expressions cannot be named"); |
+ 'NAMED_FUNCTION_EXPRESSION', "Function expressions cannot be named"); |
static const ParserErrorCode NAMED_PARAMETER_OUTSIDE_GROUP = |
- const ParserErrorCode( |
- 'NAMED_PARAMETER_OUTSIDE_GROUP', |
+ const ParserErrorCode('NAMED_PARAMETER_OUTSIDE_GROUP', |
"Named parameters must be enclosed in curly braces ('{' and '}')"); |
static const ParserErrorCode NATIVE_CLAUSE_IN_NON_SDK_CODE = |
- const ParserErrorCode( |
- 'NATIVE_CLAUSE_IN_NON_SDK_CODE', |
+ const ParserErrorCode('NATIVE_CLAUSE_IN_NON_SDK_CODE', |
"Native clause can only be used in the SDK and code that is loaded through native extensions"); |
static const ParserErrorCode NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE = |
- const ParserErrorCode( |
- 'NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', |
+ const ParserErrorCode('NATIVE_FUNCTION_BODY_IN_NON_SDK_CODE', |
"Native functions can only be declared in the SDK and code that is loaded through native extensions"); |
static const ParserErrorCode NON_CONSTRUCTOR_FACTORY = const ParserErrorCode( |
@@ -10568,44 +9661,36 @@ class ParserErrorCode extends ErrorCode { |
"Only constructors can be declared to be a 'factory'"); |
static const ParserErrorCode NON_IDENTIFIER_LIBRARY_NAME = |
- const ParserErrorCode( |
- 'NON_IDENTIFIER_LIBRARY_NAME', |
+ const ParserErrorCode('NON_IDENTIFIER_LIBRARY_NAME', |
"The name of a library must be an identifier"); |
static const ParserErrorCode NON_PART_OF_DIRECTIVE_IN_PART = |
- const ParserErrorCode( |
- 'NON_PART_OF_DIRECTIVE_IN_PART', |
+ const ParserErrorCode('NON_PART_OF_DIRECTIVE_IN_PART', |
"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."); |
static const ParserErrorCode NON_USER_DEFINABLE_OPERATOR = |
- const ParserErrorCode( |
- 'NON_USER_DEFINABLE_OPERATOR', |
+ const ParserErrorCode('NON_USER_DEFINABLE_OPERATOR', |
"The operator '{0}' is not user definable"); |
static const ParserErrorCode NORMAL_BEFORE_OPTIONAL_PARAMETERS = |
- const ParserErrorCode( |
- 'NORMAL_BEFORE_OPTIONAL_PARAMETERS', |
+ const ParserErrorCode('NORMAL_BEFORE_OPTIONAL_PARAMETERS', |
"Normal parameters must occur before optional parameters"); |
static const ParserErrorCode POSITIONAL_AFTER_NAMED_ARGUMENT = |
- const ParserErrorCode( |
- 'POSITIONAL_AFTER_NAMED_ARGUMENT', |
+ const ParserErrorCode('POSITIONAL_AFTER_NAMED_ARGUMENT', |
"Positional arguments must occur before named arguments"); |
static const ParserErrorCode POSITIONAL_PARAMETER_OUTSIDE_GROUP = |
- const ParserErrorCode( |
- 'POSITIONAL_PARAMETER_OUTSIDE_GROUP', |
+ const ParserErrorCode('POSITIONAL_PARAMETER_OUTSIDE_GROUP', |
"Positional parameters must be enclosed in square brackets ('[' and ']')"); |
static const ParserErrorCode REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR = |
- const ParserErrorCode( |
- 'REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', |
+ const ParserErrorCode('REDIRECTION_IN_NON_FACTORY_CONSTRUCTOR', |
"Only factory constructor can specify '=' redirection."); |
static const ParserErrorCode SETTER_IN_FUNCTION = const ParserErrorCode( |
@@ -10624,48 +9709,41 @@ class ParserErrorCode extends ErrorCode { |
'STATIC_AFTER_VAR', |
"The modifier 'static' should be before the modifier 'var'"); |
- static const ParserErrorCode STATIC_CONSTRUCTOR = |
- const ParserErrorCode('STATIC_CONSTRUCTOR', "Constructors cannot be static"); |
+ static const ParserErrorCode STATIC_CONSTRUCTOR = const ParserErrorCode( |
+ 'STATIC_CONSTRUCTOR', "Constructors cannot be static"); |
static const ParserErrorCode STATIC_GETTER_WITHOUT_BODY = |
const ParserErrorCode( |
- 'STATIC_GETTER_WITHOUT_BODY', |
- "A 'static' getter must have a body"); |
+ 'STATIC_GETTER_WITHOUT_BODY', "A 'static' getter must have a body"); |
static const ParserErrorCode STATIC_OPERATOR = |
const ParserErrorCode('STATIC_OPERATOR', "Operators cannot be static"); |
static const ParserErrorCode STATIC_SETTER_WITHOUT_BODY = |
const ParserErrorCode( |
- 'STATIC_SETTER_WITHOUT_BODY', |
- "A 'static' setter must have a body"); |
+ 'STATIC_SETTER_WITHOUT_BODY', "A 'static' setter must have a body"); |
static const ParserErrorCode STATIC_TOP_LEVEL_DECLARATION = |
- const ParserErrorCode( |
- 'STATIC_TOP_LEVEL_DECLARATION', |
+ const ParserErrorCode('STATIC_TOP_LEVEL_DECLARATION', |
"Top-level declarations cannot be declared to be 'static'"); |
static const ParserErrorCode SWITCH_HAS_CASE_AFTER_DEFAULT_CASE = |
- const ParserErrorCode( |
- 'SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', |
+ const ParserErrorCode('SWITCH_HAS_CASE_AFTER_DEFAULT_CASE', |
"The 'default' case should be the last case in a switch statement"); |
static const ParserErrorCode SWITCH_HAS_MULTIPLE_DEFAULT_CASES = |
- const ParserErrorCode( |
- 'SWITCH_HAS_MULTIPLE_DEFAULT_CASES', |
+ const ParserErrorCode('SWITCH_HAS_MULTIPLE_DEFAULT_CASES', |
"The 'default' case can only be declared once"); |
static const ParserErrorCode TOP_LEVEL_OPERATOR = const ParserErrorCode( |
- 'TOP_LEVEL_OPERATOR', |
- "Operators must be declared within a class"); |
+ 'TOP_LEVEL_OPERATOR', "Operators must be declared within a class"); |
static const ParserErrorCode TYPEDEF_IN_CLASS = const ParserErrorCode( |
'TYPEDEF_IN_CLASS', |
"Function type aliases cannot be declared inside classes"); |
static const ParserErrorCode UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP = |
- const ParserErrorCode( |
- 'UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', |
+ const ParserErrorCode('UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP', |
"There is no '{0}' to open a parameter group"); |
static const ParserErrorCode UNEXPECTED_TOKEN = |
@@ -10680,18 +9758,15 @@ class ParserErrorCode extends ErrorCode { |
"The with clause cannot be used without an extends clause"); |
static const ParserErrorCode WRONG_SEPARATOR_FOR_NAMED_PARAMETER = |
- const ParserErrorCode( |
- 'WRONG_SEPARATOR_FOR_NAMED_PARAMETER', |
+ const ParserErrorCode('WRONG_SEPARATOR_FOR_NAMED_PARAMETER', |
"The default value of a named parameter should be preceeded by ':'"); |
static const ParserErrorCode WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER = |
- const ParserErrorCode( |
- 'WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', |
+ const ParserErrorCode('WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER', |
"The default value of a positional parameter should be preceeded by '='"); |
static const ParserErrorCode WRONG_TERMINATOR_FOR_PARAMETER_GROUP = |
- const ParserErrorCode( |
- 'WRONG_TERMINATOR_FOR_PARAMETER_GROUP', |
+ const ParserErrorCode('WRONG_TERMINATOR_FOR_PARAMETER_GROUP', |
"Expected '{0}' to close parameter group"); |
static const ParserErrorCode VAR_AND_TYPE = const ParserErrorCode( |
@@ -10699,29 +9774,25 @@ class ParserErrorCode extends ErrorCode { |
"Variables cannot be declared using both 'var' and a type name; remove the 'var'"); |
static const ParserErrorCode VAR_AS_TYPE_NAME = const ParserErrorCode( |
- 'VAR_AS_TYPE_NAME', |
- "The keyword 'var' cannot be used as a type name"); |
+ 'VAR_AS_TYPE_NAME', "The keyword 'var' cannot be used as a type name"); |
- static const ParserErrorCode VAR_CLASS = |
- const ParserErrorCode('VAR_CLASS', "Classes cannot be declared to be 'var'"); |
+ static const ParserErrorCode VAR_CLASS = const ParserErrorCode( |
+ 'VAR_CLASS', "Classes cannot be declared to be 'var'"); |
static const ParserErrorCode VAR_ENUM = |
const ParserErrorCode('VAR_ENUM', "Enums cannot be declared to be 'var'"); |
- static const ParserErrorCode VAR_RETURN_TYPE = |
- const ParserErrorCode('VAR_RETURN_TYPE', "The return type cannot be 'var'"); |
+ static const ParserErrorCode VAR_RETURN_TYPE = const ParserErrorCode( |
+ 'VAR_RETURN_TYPE', "The return type cannot be 'var'"); |
static const ParserErrorCode VAR_TYPEDEF = const ParserErrorCode( |
- 'VAR_TYPEDEF', |
- "Type aliases cannot be declared to be 'var'"); |
+ 'VAR_TYPEDEF', "Type aliases cannot be declared to be 'var'"); |
static const ParserErrorCode VOID_PARAMETER = const ParserErrorCode( |
- 'VOID_PARAMETER', |
- "Parameters cannot have a type of 'void'"); |
+ 'VOID_PARAMETER', "Parameters cannot have a type of 'void'"); |
static const ParserErrorCode VOID_VARIABLE = const ParserErrorCode( |
- 'VOID_VARIABLE', |
- "Variables cannot have a type of 'void'"); |
+ 'VOID_VARIABLE', "Variables cannot have a type of 'void'"); |
/** |
* Initialize a newly created error code to have the given [name]. The message |
@@ -10739,7 +9810,6 @@ class ParserErrorCode extends ErrorCode { |
ErrorType get type => ErrorType.SYNTACTIC_ERROR; |
} |
- |
/** |
* Instances of the class `ResolutionCopier` copies resolution information from one AST |
* structure to another as long as the structures of the corresponding children of a pair of nodes |
@@ -10761,8 +9831,7 @@ 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), |
@@ -10776,8 +9845,7 @@ 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)); |
} |
@@ -10785,8 +9853,7 @@ 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; |
@@ -10799,8 +9866,7 @@ 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), |
@@ -10810,8 +9876,7 @@ 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; |
@@ -10826,16 +9891,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitAwaitExpression(AwaitExpression node) { |
AwaitExpression toNode = this._toNode as AwaitExpression; |
- return _and( |
- _isEqualTokens(node.awaitKeyword, toNode.awaitKeyword), |
+ return _and(_isEqualTokens(node.awaitKeyword, toNode.awaitKeyword), |
_isEqualNodes(node.expression, toNode.expression)); |
} |
@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; |
@@ -10850,8 +9913,7 @@ 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)); |
} |
@@ -10865,8 +9927,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitBooleanLiteral(BooleanLiteral node) { |
BooleanLiteral toNode = this._toNode as BooleanLiteral; |
- if (_and( |
- _isEqualTokens(node.literal, toNode.literal), |
+ if (_and(_isEqualTokens(node.literal, toNode.literal), |
node.value == toNode.value)) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -10878,8 +9939,7 @@ 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. |
@@ -10891,8 +9951,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitCascadeExpression(CascadeExpression node) { |
CascadeExpression toNode = this._toNode as CascadeExpression; |
- if (_and( |
- _isEqualNodes(node.target, toNode.target), |
+ if (_and(_isEqualNodes(node.target, toNode.target), |
_isEqualNodeLists(node.cascadeSections, toNode.cascadeSections))) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -10904,8 +9963,7 @@ 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), |
@@ -10960,16 +10018,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitCommentReference(CommentReference node) { |
CommentReference toNode = this._toNode as CommentReference; |
- return _and( |
- _isEqualTokens(node.newKeyword, toNode.newKeyword), |
+ return _and(_isEqualTokens(node.newKeyword, toNode.newKeyword), |
_isEqualNodes(node.identifier, toNode.identifier)); |
} |
@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), |
@@ -10983,8 +10039,7 @@ 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), |
@@ -11023,8 +10078,7 @@ 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), |
@@ -11034,8 +10088,7 @@ 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; |
@@ -11047,8 +10100,7 @@ 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. |
@@ -11071,8 +10123,7 @@ 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)); |
@@ -11081,8 +10132,7 @@ 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), |
@@ -11094,8 +10144,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitDoubleLiteral(DoubleLiteral node) { |
DoubleLiteral toNode = this._toNode as DoubleLiteral; |
- if (_and( |
- _isEqualTokens(node.literal, toNode.literal), |
+ if (_and(_isEqualTokens(node.literal, toNode.literal), |
node.value == toNode.value)) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11166,16 +10215,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitExpressionStatement(ExpressionStatement node) { |
ExpressionStatement toNode = this._toNode as ExpressionStatement; |
- return _and( |
- _isEqualNodes(node.expression, toNode.expression), |
+ return _and(_isEqualNodes(node.expression, toNode.expression), |
_isEqualTokens(node.semicolon, toNode.semicolon)); |
} |
@override |
bool visitExtendsClause(ExtendsClause node) { |
ExtendsClause toNode = this._toNode as ExtendsClause; |
- return _and( |
- _isEqualTokens(node.extendsKeyword, toNode.extendsKeyword), |
+ return _and(_isEqualTokens(node.extendsKeyword, toNode.extendsKeyword), |
_isEqualNodes(node.superclass, toNode.superclass)); |
} |
@@ -11206,8 +10253,7 @@ 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), |
@@ -11219,8 +10265,7 @@ 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), |
@@ -11230,8 +10275,7 @@ 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), |
@@ -11266,8 +10310,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitFunctionExpression(FunctionExpression node) { |
FunctionExpression toNode = this._toNode as FunctionExpression; |
- if (_and( |
- _isEqualNodes(node.parameters, toNode.parameters), |
+ if (_and(_isEqualNodes(node.parameters, toNode.parameters), |
_isEqualNodes(node.body, toNode.body))) { |
toNode.element = node.element; |
toNode.propagatedType = node.propagatedType; |
@@ -11281,8 +10324,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
bool visitFunctionExpressionInvocation(FunctionExpressionInvocation node) { |
FunctionExpressionInvocation toNode = |
this._toNode as FunctionExpressionInvocation; |
- if (_and( |
- _isEqualNodes(node.function, toNode.function), |
+ if (_and(_isEqualNodes(node.function, toNode.function), |
_isEqualNodes(node.argumentList, toNode.argumentList))) { |
toNode.propagatedElement = node.propagatedElement; |
toNode.propagatedType = node.propagatedType; |
@@ -11322,16 +10364,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitHideCombinator(HideCombinator node) { |
HideCombinator toNode = this._toNode as HideCombinator; |
- return _and( |
- _isEqualTokens(node.keyword, toNode.keyword), |
+ return _and(_isEqualTokens(node.keyword, toNode.keyword), |
_isEqualNodeLists(node.hiddenNames, toNode.hiddenNames)); |
} |
@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), |
@@ -11369,8 +10409,7 @@ 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))) { |
@@ -11388,8 +10427,7 @@ 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; |
@@ -11403,8 +10441,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitIntegerLiteral(IntegerLiteral node) { |
IntegerLiteral toNode = this._toNode as IntegerLiteral; |
- if (_and( |
- _isEqualTokens(node.literal, toNode.literal), |
+ if (_and(_isEqualTokens(node.literal, toNode.literal), |
node.value == toNode.value)) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11416,8 +10453,7 @@ 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)); |
} |
@@ -11425,16 +10461,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitInterpolationString(InterpolationString node) { |
InterpolationString toNode = this._toNode as InterpolationString; |
- return _and( |
- _isEqualTokens(node.contents, toNode.contents), |
+ return _and(_isEqualTokens(node.contents, toNode.contents), |
node.value == toNode.value); |
} |
@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))) { |
@@ -11448,16 +10482,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitLabel(Label node) { |
Label toNode = this._toNode as Label; |
- return _and( |
- _isEqualNodes(node.label, toNode.label), |
+ return _and(_isEqualNodes(node.label, toNode.label), |
_isEqualTokens(node.colon, toNode.colon)); |
} |
@override |
bool visitLabeledStatement(LabeledStatement node) { |
LabeledStatement toNode = this._toNode as LabeledStatement; |
- return _and( |
- _isEqualNodeLists(node.labels, toNode.labels), |
+ return _and(_isEqualNodeLists(node.labels, toNode.labels), |
_isEqualNodes(node.statement, toNode.statement)); |
} |
@@ -11486,8 +10518,7 @@ 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), |
@@ -11502,8 +10533,7 @@ 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), |
@@ -11518,8 +10548,7 @@ 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)); |
} |
@@ -11543,8 +10572,7 @@ 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.period, toNode.period), |
_isEqualNodes(node.methodName, toNode.methodName), |
_isEqualNodes(node.argumentList, toNode.argumentList))) { |
@@ -11558,8 +10586,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitNamedExpression(NamedExpression node) { |
NamedExpression toNode = this._toNode as NamedExpression; |
- if (_and( |
- _isEqualNodes(node.name, toNode.name), |
+ if (_and(_isEqualNodes(node.name, toNode.name), |
_isEqualNodes(node.expression, toNode.expression))) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11571,16 +10598,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitNativeClause(NativeClause node) { |
NativeClause toNode = this._toNode as NativeClause; |
- return _and( |
- _isEqualTokens(node.nativeKeyword, toNode.nativeKeyword), |
+ return _and(_isEqualTokens(node.nativeKeyword, toNode.nativeKeyword), |
_isEqualNodes(node.name, toNode.name)); |
} |
@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)); |
} |
@@ -11599,8 +10624,7 @@ 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; |
@@ -11644,8 +10668,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitPostfixExpression(PostfixExpression node) { |
PostfixExpression toNode = this._toNode as PostfixExpression; |
- if (_and( |
- _isEqualNodes(node.operand, toNode.operand), |
+ if (_and(_isEqualNodes(node.operand, toNode.operand), |
_isEqualTokens(node.operator, toNode.operator))) { |
toNode.propagatedElement = node.propagatedElement; |
toNode.propagatedType = node.propagatedType; |
@@ -11659,8 +10682,7 @@ 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; |
@@ -11673,8 +10695,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitPrefixExpression(PrefixExpression node) { |
PrefixExpression toNode = this._toNode as PrefixExpression; |
- if (_and( |
- _isEqualTokens(node.operator, toNode.operator), |
+ if (_and(_isEqualTokens(node.operator, toNode.operator), |
_isEqualNodes(node.operand, toNode.operand))) { |
toNode.propagatedElement = node.propagatedElement; |
toNode.propagatedType = node.propagatedType; |
@@ -11688,8 +10709,7 @@ 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; |
@@ -11700,12 +10720,11 @@ class ResolutionCopier implements AstVisitor<bool> { |
} |
@override |
- bool |
- visitRedirectingConstructorInvocation(RedirectingConstructorInvocation node) { |
+ bool visitRedirectingConstructorInvocation( |
+ 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))) { |
@@ -11729,8 +10748,7 @@ 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)); |
} |
@@ -11744,8 +10762,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitShowCombinator(ShowCombinator node) { |
ShowCombinator toNode = this._toNode as ShowCombinator; |
- return _and( |
- _isEqualTokens(node.keyword, toNode.keyword), |
+ return _and(_isEqualTokens(node.keyword, toNode.keyword), |
_isEqualNodeLists(node.shownNames, toNode.shownNames)); |
} |
@@ -11777,8 +10794,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitSimpleStringLiteral(SimpleStringLiteral node) { |
SimpleStringLiteral toNode = this._toNode as SimpleStringLiteral; |
- if (_and( |
- _isEqualTokens(node.literal, toNode.literal), |
+ if (_and(_isEqualTokens(node.literal, toNode.literal), |
node.value == toNode.value)) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11802,8 +10818,7 @@ 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))) { |
@@ -11827,8 +10842,7 @@ 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), |
@@ -11838,8 +10852,7 @@ 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)); |
@@ -11848,8 +10861,7 @@ 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), |
@@ -11861,8 +10873,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitSymbolLiteral(SymbolLiteral node) { |
SymbolLiteral toNode = this._toNode as SymbolLiteral; |
- if (_and( |
- _isEqualTokens(node.poundSign, toNode.poundSign), |
+ if (_and(_isEqualTokens(node.poundSign, toNode.poundSign), |
_isEqualTokenLists(node.components, toNode.components))) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11885,8 +10896,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitThrowExpression(ThrowExpression node) { |
ThrowExpression toNode = this._toNode as ThrowExpression; |
- if (_and( |
- _isEqualTokens(node.throwKeyword, toNode.throwKeyword), |
+ if (_and(_isEqualTokens(node.throwKeyword, toNode.throwKeyword), |
_isEqualNodes(node.expression, toNode.expression))) { |
toNode.propagatedType = node.propagatedType; |
toNode.staticType = node.staticType; |
@@ -11909,8 +10919,7 @@ 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), |
@@ -11920,8 +10929,7 @@ 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)); |
} |
@@ -11929,8 +10937,7 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitTypeName(TypeName node) { |
TypeName toNode = this._toNode as TypeName; |
- if (_and( |
- _isEqualNodes(node.name, toNode.name), |
+ if (_and(_isEqualNodes(node.name, toNode.name), |
_isEqualNodes(node.typeArguments, toNode.typeArguments))) { |
toNode.type = node.type; |
return true; |
@@ -11952,8 +10959,7 @@ 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)); |
} |
@@ -11984,16 +10990,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
bool visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
VariableDeclarationStatement toNode = |
this._toNode as VariableDeclarationStatement; |
- return _and( |
- _isEqualNodes(node.variables, toNode.variables), |
+ return _and(_isEqualNodes(node.variables, toNode.variables), |
_isEqualTokens(node.semicolon, toNode.semicolon)); |
} |
@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), |
@@ -12003,16 +11007,14 @@ class ResolutionCopier implements AstVisitor<bool> { |
@override |
bool visitWithClause(WithClause node) { |
WithClause toNode = this._toNode as WithClause; |
- return _and( |
- _isEqualTokens(node.withKeyword, toNode.withKeyword), |
+ return _and(_isEqualTokens(node.withKeyword, toNode.withKeyword), |
_isEqualNodeLists(node.mixinTypes, toNode.mixinTypes)); |
} |
@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)); |
} |
@@ -12021,8 +11023,8 @@ 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 b6 = true, bool b7 = true, bool b8 = true, bool b9 = true, |
+ bool b10 = true, bool b11 = true, bool b12 = true, bool b13 = true]) { |
return b1 && |
b2 && |
b3 && |