d579b03f71
Changes the `front_end` and `_fe_analyzer_shared` code that reports the following diagnostics so that it uses `withArguments` rather than `withArgumentsOld`: - `expectedButGot` - `expectedButGot2` - `expectedAfterButGot` - `expectedToken` - `unmatchedToken` - `constFieldWithoutInitializer` - `finalFieldWithoutInitializer` - `superclassHasNoMethod` - `unavailableDartLibrary` - `unsupportedPlatformDartLibraryImport` These messages required special care because they are translated into analyzer diagnostics by the analyzer method `FastaErrorReporter.reportByCode`, and the logic to do the translation depends on the exact parameter names used by the messages. For some of the messages I've clarified the parameter names and updated `FastaErrorReporter.reportByCode` accordingly. For others, I left the parameter names as is. Change-Id: I6a6a696481c75f4cbb198d1e012aa1ca4294ed61 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476323 Commit-Queue: Paul Berry <paulberry@google.com> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
152 lines
11 KiB
Plaintext
152 lines
11 KiB
Plaintext
parseUnit(UnmatchedToken({))
|
|
skipErrorTokens(UnmatchedToken({))
|
|
listener: beginCompilationUnit(void)
|
|
syntheticPreviousToken(void)
|
|
parseTopLevelDeclarationImpl(UnmatchedToken({), DirectiveContext(DirectiveState.Unknown))
|
|
parseMetadataStar(UnmatchedToken({))
|
|
listener: beginMetadataStar(void)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl(UnmatchedToken({))
|
|
listener: beginTopLevelMember(void)
|
|
parseTopLevelMethod(UnmatchedToken({), null, null, UnmatchedToken({), VoidType(), null, f, false)
|
|
listener: beginTopLevelMethod(UnmatchedToken({), null, null)
|
|
listener: handleVoidKeyword(void)
|
|
ensureIdentifierPotentiallyRecovered(void, topLevelFunctionDeclaration, false)
|
|
listener: handleIdentifier(f, topLevelFunctionDeclaration)
|
|
parseMethodTypeVar(f)
|
|
listener: handleNoTypeVariables(()
|
|
parseGetterOrFormalParameters(f, f, false, MemberKind.TopLevelMethod)
|
|
parseFormalParameters(f, MemberKind.TopLevelMethod)
|
|
parseFormalParametersRest((, MemberKind.TopLevelMethod)
|
|
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
|
|
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
|
|
parseMetadataStar(()
|
|
listener: beginMetadataStar(Object)
|
|
listener: endMetadataStar(0)
|
|
listener: beginFormalParameter(Object, MemberKind.TopLevelMethod, null, null, null)
|
|
listener: handleIdentifier(Object, typeReference)
|
|
listener: handleNoTypeArguments(?)
|
|
listener: handleType(Object, ?)
|
|
ensureIdentifier(?, formalParameterDeclaration)
|
|
listener: handleIdentifier(x, formalParameterDeclaration)
|
|
listener: handleFormalParameterWithoutValue())
|
|
listener: endFormalParameter(null, null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
|
|
listener: endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
|
|
parseAsyncModifierOpt())
|
|
listener: handleAsyncModifier(null, null)
|
|
inPlainSync()
|
|
parseFunctionBody(), false, false)
|
|
listener: beginBlockFunctionBody({)
|
|
notEofOrType(CLOSE_CURLY_BRACKET, ()
|
|
parseStatement({)
|
|
parseStatementX({)
|
|
parseExpressionStatementOrDeclaration({, null)
|
|
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
|
|
looksLikeLocalFunction(()
|
|
parseExpressionStatement({)
|
|
parseExpression({)
|
|
looksLikeOuterPatternEquals({)
|
|
skipOuterPattern({)
|
|
parsePrecedenceExpression({, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression({, true, ConstantPatternContext.none)
|
|
parsePrimary({, expression, ConstantPatternContext.none)
|
|
parseParenthesizedExpressionFunctionLiteralOrRecordLiteral({, ConstantPatternContext.none)
|
|
parseParenthesizedExpressionOrRecordLiteral({, null, ConstantPatternContext.none)
|
|
listener: beginParenthesizedExpressionOrRecordLiteral(()
|
|
parseExpression(()
|
|
looksLikeOuterPatternEquals(()
|
|
skipOuterPattern(()
|
|
parsePrecedenceExpression((, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression((, true, ConstantPatternContext.none)
|
|
parsePrimary((, expression, ConstantPatternContext.none)
|
|
inPlainSync()
|
|
parseSwitchExpression(()
|
|
listener: beginSwitchExpression(switch)
|
|
ensureParenthesizedCondition(switch, allowCase: false)
|
|
parseExpressionInParenthesisRest((, allowCase: false)
|
|
parseExpression(()
|
|
looksLikeOuterPatternEquals(()
|
|
skipOuterPattern(()
|
|
skipObjectPatternRest(x)
|
|
parsePrecedenceExpression((, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression((, true, ConstantPatternContext.none)
|
|
parsePrimary((, expression, ConstantPatternContext.none)
|
|
parseSendOrFunctionLiteral((, expression, ConstantPatternContext.none)
|
|
parseSend((, expression, ConstantPatternContext.none)
|
|
ensureIdentifier((, expression)
|
|
listener: handleIdentifier(x, expression)
|
|
listener: handleNoTypeArguments())
|
|
parseArgumentsOpt(x)
|
|
listener: handleNoArguments())
|
|
listener: handleSend(x, x)
|
|
ensureCloseParen(x, ()
|
|
listener: handleParenthesizedCondition((, null, null)
|
|
ensureBlock(), BlockKind(switch expression))
|
|
listener: beginSwitchExpressionBlock({)
|
|
listener: beginSwitchExpressionCase()
|
|
parsePattern({, PatternContext.matching, precedence: 1)
|
|
listener: beginPattern({)
|
|
parsePrimaryPattern({, PatternContext.matching)
|
|
listener: beginConstantPattern(const)
|
|
parsePrecedenceExpression(const, 7, false, ConstantPatternContext.explicit)
|
|
parseUnaryExpression(const, false, ConstantPatternContext.explicit)
|
|
parsePrimary(const, expression, ConstantPatternContext.explicit)
|
|
parseSendOrFunctionLiteral(const, expression, ConstantPatternContext.explicit)
|
|
parseSend(const, expression, ConstantPatternContext.explicit)
|
|
ensureIdentifier(const, expression)
|
|
listener: handleIdentifier(A, expression)
|
|
listener: handleNoTypeArguments(()
|
|
parseArgumentsOpt(A)
|
|
parseArguments(A)
|
|
parseArgumentsRest(()
|
|
listener: beginArguments(()
|
|
listener: endArguments(0, (, ))
|
|
listener: handleSend(A, ))
|
|
listener: endConstantPattern(const)
|
|
listener: endPattern())
|
|
listener: handleSwitchExpressionCasePattern())
|
|
ensureFunctionArrow())
|
|
parseExpression(=>)
|
|
looksLikeOuterPatternEquals(=>)
|
|
skipOuterPattern(=>)
|
|
parsePrecedenceExpression(=>, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression(=>, true, ConstantPatternContext.none)
|
|
parsePrimary(=>, expression, ConstantPatternContext.none)
|
|
parseLiteralInt(=>)
|
|
listener: handleLiteralInt(0)
|
|
listener: endSwitchExpressionCase(const, null, =>, 0)
|
|
listener: beginSwitchExpressionCase()
|
|
parsePattern(,, PatternContext.matching, precedence: 1)
|
|
listener: beginPattern(,)
|
|
parsePrimaryPattern(,, PatternContext.matching)
|
|
parseVariablePattern(,, PatternContext.matching, typeInfo: NoType())
|
|
listener: handleNoType(_)
|
|
listener: handleWildcardPattern(null, _)
|
|
listener: endPattern(_)
|
|
listener: handleSwitchExpressionCasePattern(_)
|
|
ensureFunctionArrow(_)
|
|
parseExpression(=>)
|
|
looksLikeOuterPatternEquals(=>)
|
|
skipOuterPattern(=>)
|
|
parsePrecedenceExpression(=>, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression(=>, true, ConstantPatternContext.none)
|
|
parsePrimary(=>, expression, ConstantPatternContext.none)
|
|
parseLiteralInt(=>)
|
|
listener: handleLiteralInt(1)
|
|
listener: endSwitchExpressionCase(_, null, =>, 1)
|
|
listener: endSwitchExpressionBlock(2, {, })
|
|
listener: endSwitchExpression(switch, })
|
|
listener: handlePositionalRecordField(switch)
|
|
ensureCloseParen(}, ()
|
|
listener: endParenthesizedExpression(()
|
|
ensureSemicolon())
|
|
listener: handleExpressionStatement((, ;)
|
|
notEofOrType(CLOSE_CURLY_BRACKET, })
|
|
listener: endBlockFunctionBody(1, {, })
|
|
listener: endTopLevelMethod(void, null, })
|
|
listener: endTopLevelDeclaration(})
|
|
reportAllErrorTokens(UnmatchedToken({))
|
|
listener: handleErrorToken(UnmatchedToken({))
|
|
listener: handleRecoverableError(Message[Template(UnmatchedToken), Can't find '}' to match '{'., null, {expected: }, lexeme: {}], UnmatchedToken({), UnmatchedToken({))
|
|
listener: endCompilationUnit(1, )
|