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>
173 lines
11 KiB
Plaintext
173 lines
11 KiB
Plaintext
parseUnit(void)
|
|
skipErrorTokens(void)
|
|
listener: beginCompilationUnit(void)
|
|
syntheticPreviousToken(void)
|
|
parseTopLevelDeclarationImpl(, DirectiveContext(DirectiveState.Unknown))
|
|
parseMetadataStar()
|
|
listener: beginMetadataStar(void)
|
|
listener: endMetadataStar(0)
|
|
parseTopLevelMemberImpl()
|
|
listener: beginTopLevelMember(void)
|
|
parseTopLevelMethod(, null, null, , VoidType(), null, f, false)
|
|
listener: beginTopLevelMethod(, 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, switch)
|
|
parseStatement({)
|
|
parseStatementX({)
|
|
parseSwitchStatement({)
|
|
listener: beginSwitchStatement(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)
|
|
parseSwitchBlock())
|
|
ensureBlock(), BlockKind(switch statement))
|
|
listener: beginSwitchBlock({)
|
|
notEofOrType(CLOSE_CURLY_BRACKET, case)
|
|
peekPastLabels(case)
|
|
listener: beginCaseExpression(case)
|
|
parsePattern(case, PatternContext.matching, precedence: 1)
|
|
listener: beginPattern(case)
|
|
parsePrimaryPattern(case, PatternContext.matching)
|
|
listener: handleNoTypeArguments({)
|
|
parseMapPatternSuffix(case, PatternContext.matching)
|
|
parseExpression({)
|
|
looksLikeOuterPatternEquals({)
|
|
skipOuterPattern({)
|
|
parsePrecedenceExpression({, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression({, true, ConstantPatternContext.none)
|
|
parsePrimary({, expression, ConstantPatternContext.none)
|
|
parseLiteralInt({)
|
|
listener: handleLiteralInt(0)
|
|
parsePattern(:, PatternContext.matching, precedence: 1)
|
|
listener: beginPattern(:)
|
|
parsePrimaryPattern(:, PatternContext.matching)
|
|
listener: beginConstantPattern(null)
|
|
parsePrecedenceExpression(:, 7, false, ConstantPatternContext.implicit)
|
|
parseUnaryExpression(:, false, ConstantPatternContext.implicit)
|
|
parsePrimary(:, expression, ConstantPatternContext.implicit)
|
|
inPlainSync()
|
|
parseSend(:, expression, ConstantPatternContext.implicit)
|
|
ensureIdentifier(:, expression)
|
|
reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
|
|
listener: handleRecoverableError(Message[Template(ExpectedIdentifier), Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
rewriter()
|
|
listener: handleIdentifier(, expression)
|
|
listener: handleNoTypeArguments(if)
|
|
parseArgumentsOpt()
|
|
listener: handleNoArguments(if)
|
|
listener: handleSend(, )
|
|
listener: endConstantPattern(null)
|
|
listener: endPattern()
|
|
listener: handleMapPatternEntry(:, if)
|
|
rewriteAndRecover(, Message[Template(ExpectedButGot), Expected ',' before this., null, {expected: ,}], ,)
|
|
reportRecoverableError(if, Message[Template(ExpectedButGot), Expected ',' before this., null, {expected: ,}])
|
|
listener: handleRecoverableError(Message[Template(ExpectedButGot), Expected ',' before this., null, {expected: ,}], if, if)
|
|
rewriter()
|
|
parseExpression(,)
|
|
looksLikeOuterPatternEquals(,)
|
|
skipOuterPattern(,)
|
|
parsePrecedenceExpression(,, 1, true, ConstantPatternContext.none)
|
|
parseUnaryExpression(,, true, ConstantPatternContext.none)
|
|
parsePrimary(,, expression, ConstantPatternContext.none)
|
|
inPlainSync()
|
|
parseSend(,, expression, ConstantPatternContext.none)
|
|
ensureIdentifier(,, expression)
|
|
reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
|
|
listener: handleRecoverableError(Message[Template(ExpectedIdentifier), Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
rewriter()
|
|
listener: handleIdentifier(, expression)
|
|
listener: handleNoTypeArguments(if)
|
|
parseArgumentsOpt()
|
|
listener: handleNoArguments(if)
|
|
listener: handleSend(, )
|
|
rewriteAndRecover(, Message[Template(ExpectedButGot), Expected ':' before this., null, {expected: :}], :)
|
|
reportRecoverableError(if, Message[Template(ExpectedButGot), Expected ':' before this., null, {expected: :}])
|
|
listener: handleRecoverableError(Message[Template(ExpectedButGot), Expected ':' before this., null, {expected: :}], if, if)
|
|
rewriter()
|
|
parsePattern(:, PatternContext.matching, precedence: 1)
|
|
listener: beginPattern(:)
|
|
parsePrimaryPattern(:, PatternContext.matching)
|
|
listener: beginConstantPattern(null)
|
|
parsePrecedenceExpression(:, 7, false, ConstantPatternContext.implicit)
|
|
parseUnaryExpression(:, false, ConstantPatternContext.implicit)
|
|
parsePrimary(:, expression, ConstantPatternContext.implicit)
|
|
inPlainSync()
|
|
parseSend(:, expression, ConstantPatternContext.implicit)
|
|
ensureIdentifier(:, expression)
|
|
reportRecoverableErrorWithToken(if, Template(ExpectedIdentifier))
|
|
listener: handleRecoverableError(Message[Template(ExpectedIdentifier), Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
rewriter()
|
|
listener: handleIdentifier(, expression)
|
|
listener: handleNoTypeArguments(if)
|
|
parseArgumentsOpt()
|
|
listener: handleNoArguments(if)
|
|
listener: handleSend(, )
|
|
listener: endConstantPattern(null)
|
|
listener: endPattern()
|
|
listener: handleMapPatternEntry(:, })
|
|
listener: handleMapPattern(2, {, })
|
|
listener: endPattern(})
|
|
listener: handleSwitchCaseNoWhenClause(})
|
|
ensureColon(})
|
|
listener: endCaseExpression(case, null, :)
|
|
peekPastLabels(})
|
|
parseStatementsInSwitchCase(:, }, case, 0, 1, null, null)
|
|
listener: beginSwitchCase(0, 1, case)
|
|
listener: endSwitchCase(0, 1, null, null, 0, case, :)
|
|
notEofOrType(CLOSE_CURLY_BRACKET, })
|
|
listener: endSwitchBlock(1, {, })
|
|
listener: endSwitchStatement(switch, })
|
|
notEofOrType(CLOSE_CURLY_BRACKET, ;)
|
|
parseStatement(})
|
|
parseStatementX(})
|
|
parseEmptyStatement(})
|
|
listener: handleEmptyStatement(;)
|
|
notEofOrType(CLOSE_CURLY_BRACKET, })
|
|
listener: endBlockFunctionBody(2, {, })
|
|
listener: endTopLevelMethod(void, null, })
|
|
listener: endTopLevelDeclaration(})
|
|
reportAllErrorTokens(void)
|
|
listener: endCompilationUnit(1, )
|