Files
sdk/pkg/front_end/parser_testcases/patterns/skipOuterPattern_eof.dart.intertwined.expect
Paul Berry d579b03f71 [messages] Use withArguments for diagnostics translated by the analyzer.
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>
2026-01-30 10:12:42 -08:00

96 lines
5.9 KiB
Plaintext

parseUnit(UnmatchedToken({))
skipErrorTokens(UnmatchedToken({))
listener: beginCompilationUnit(main)
syntheticPreviousToken(main)
parseTopLevelDeclarationImpl(UnmatchedToken({), DirectiveContext(DirectiveState.Unknown))
parseMetadataStar(UnmatchedToken({))
listener: beginMetadataStar(main)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(UnmatchedToken({))
listener: beginTopLevelMember(main)
isReservedKeyword(()
parseTopLevelMethod(UnmatchedToken({), null, null, UnmatchedToken({), NoType(), null, main, false)
listener: beginTopLevelMethod(UnmatchedToken({), null, null)
listener: handleNoType(UnmatchedToken({))
ensureIdentifierPotentiallyRecovered(UnmatchedToken({), topLevelFunctionDeclaration, false)
listener: handleIdentifier(main, topLevelFunctionDeclaration)
parseMethodTypeVar(main)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(main, main, false, MemberKind.TopLevelMethod)
parseFormalParameters(main, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
listener: endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
parseAsyncModifierOpt())
listener: handleAsyncModifier(null, null)
inPlainSync()
parseFunctionBody(), false, false)
listener: beginBlockFunctionBody({)
notEofOrType(CLOSE_CURLY_BRACKET, int)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrDeclarationAfterModifiers({, {, null, null, null, null)
looksLikeLocalFunction(int)
parseExpressionStatement({)
parseExpression({)
looksLikeOuterPatternEquals({)
skipOuterPattern({)
skipObjectPatternRest(int)
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(int, expression)
listener: handleNoTypeArguments(var)
parseArgumentsOpt(int)
listener: handleNoArguments(var)
listener: handleSend(int, int)
ensureSemicolon(int)
reportRecoverableError(int, Message[Template(ExpectedAfterButGot), Expected ';' after this., null, {expected: ;}])
listener: handleRecoverableError(Message[Template(ExpectedAfterButGot), Expected ';' after this., null, {expected: ;}], int, int)
rewriter()
listener: handleExpressionStatement(int, ;)
notEofOrType(CLOSE_CURLY_BRACKET, var)
parseStatement(;)
parseStatementX(;)
parseExpressionStatementOrDeclarationAfterModifiers(var, ;, null, var, null, null)
skipOuterPattern(var)
looksLikeLocalFunction(=)
listener: beginMetadataStar(var)
listener: endMetadataStar(0)
listener: handleNoType(var)
listener: beginVariablesDeclaration(=, null, var)
parseVariablesDeclarationRest(var, true)
parseOptionallyInitializedIdentifier(var)
ensureIdentifier(var, localVariableDeclaration)
insertSyntheticIdentifier(var, localVariableDeclaration, message: Message[Template(ExpectedIdentifier), Expected an identifier, but got '='., Try inserting an identifier before '='., {lexeme: =}], messageOnToken: null)
reportRecoverableError(=, Message[Template(ExpectedIdentifier), Expected an identifier, but got '='., Try inserting an identifier before '='., {lexeme: =}])
listener: handleRecoverableError(Message[Template(ExpectedIdentifier), Expected an identifier, but got '='., Try inserting an identifier before '='., {lexeme: =}], =, =)
rewriter()
listener: handleIdentifier(, localVariableDeclaration)
listener: beginInitializedIdentifier()
parseVariableInitializerOpt()
listener: beginVariableInitializer(=)
parseExpression(=)
looksLikeOuterPatternEquals(=)
skipOuterPattern(=)
parsePrecedenceExpression(=, 1, true, ConstantPatternContext.none)
parseUnaryExpression(=, true, ConstantPatternContext.none)
parsePrimary(=, expression, ConstantPatternContext.none)
parseLiteralInt(=)
listener: handleLiteralInt(0)
listener: endVariableInitializer(=)
listener: endInitializedIdentifier()
ensureSemicolon(0)
listener: endVariablesDeclaration(1, ;)
notEofOrType(CLOSE_CURLY_BRACKET, })
listener: endBlockFunctionBody(2, {, })
listener: endTopLevelMethod(main, 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, )