fc67d31862
When the parser sends events to the listener some events has a pair of parameters, `beginToken` and `endToken`. Most of these are constructed in such a way that the `beginToken` is the first token and the `endToken` is the last token in that construct. This is for instance the case with `endClassDeclaration`. It was, however, not the case for `endMetadata` where `endToken` instead was the next token *not* in the metadata. In this CL I've found a changed the following to point to the last token in the construct instead of the next token not in the construct and renamed the parameter where it made sense: * `endAssert` --- and renamed `semicolonToken` (which only pointed to a semicolon for statements) to `endToken`. * `endAwaitExpression` * `endConstLiteral` --- and renamed `token` to `endToken` * `endConstructorReference` * `endFieldInitializer` --- and renamed `token` to `endToken` * `endForIn` * `endForInBody` --- and renamed `token` to `endToken` * `endForStatement` * `endForStatementBody` --- and renamed `token` to `endToken` * `endFunctionExpression` --- and renamed `token` to `endToken` * `endInitializer` --- and renamed `token` to `endToken` * `endInitializers` * `endInvalidAwaitExpression` * `endMetadata` * `endSwitchCase` * `endTopLevelDeclaration` --- and renamed `nextToken` to `endToken` * `endWhileStatement` * `endWhileStatementBody` --- and renamed `token` to `endToken` * `handleNoConstructorReferenceContinuationAfterTypeArguments` In the few places in listeners where these values were used I've mostly updated to do e.g. `endToken.text!` to retain the current behavior. Change-Id: I25495e160d1eec5c75bcf1313b512cd04bcb1533 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364322 Reviewed-by: Johnni Winther <johnniwinther@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Jens Johansen <jensj@google.com>
95 lines
4.0 KiB
Plaintext
95 lines
4.0 KiB
Plaintext
Problems reported:
|
|
|
|
parser/patterns/syntheticIdentifier_insideMapPattern:3:14: Expected an identifier, but got 'if'.
|
|
case {0: if}:
|
|
^^
|
|
|
|
parser/patterns/syntheticIdentifier_insideMapPattern:3:14: Expected ',' before this.
|
|
case {0: if}:
|
|
^^
|
|
|
|
parser/patterns/syntheticIdentifier_insideMapPattern:3:14: Expected an identifier, but got 'if'.
|
|
case {0: if}:
|
|
^^
|
|
|
|
parser/patterns/syntheticIdentifier_insideMapPattern:3:14: Expected ':' before this.
|
|
case {0: if}:
|
|
^^
|
|
|
|
parser/patterns/syntheticIdentifier_insideMapPattern:3:14: Expected an identifier, but got 'if'.
|
|
case {0: if}:
|
|
^^
|
|
|
|
beginCompilationUnit(void)
|
|
beginMetadataStar(void)
|
|
endMetadataStar(0)
|
|
beginTopLevelMember(void)
|
|
beginTopLevelMethod(, null, null)
|
|
handleVoidKeyword(void)
|
|
handleIdentifier(f, topLevelFunctionDeclaration)
|
|
handleNoTypeVariables(()
|
|
beginFormalParameters((, MemberKind.TopLevelMethod)
|
|
beginMetadataStar(Object)
|
|
endMetadataStar(0)
|
|
beginFormalParameter(Object, MemberKind.TopLevelMethod, null, null, null)
|
|
handleIdentifier(Object, typeReference)
|
|
handleNoTypeArguments(?)
|
|
handleType(Object, ?)
|
|
handleIdentifier(x, formalParameterDeclaration)
|
|
handleFormalParameterWithoutValue())
|
|
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
|
|
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
|
|
handleAsyncModifier(null, null)
|
|
beginBlockFunctionBody({)
|
|
beginSwitchStatement(switch)
|
|
handleIdentifier(x, expression)
|
|
handleNoTypeArguments())
|
|
handleNoArguments())
|
|
handleSend(x, ))
|
|
handleParenthesizedCondition((, null, null)
|
|
beginSwitchBlock({)
|
|
beginCaseExpression(case)
|
|
beginPattern(case)
|
|
handleNoTypeArguments({)
|
|
handleLiteralInt(0)
|
|
beginPattern(:)
|
|
beginConstantPattern(null)
|
|
handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
handleIdentifier(, expression)
|
|
handleNoTypeArguments(if)
|
|
handleNoArguments(if)
|
|
handleSend(, if)
|
|
endConstantPattern(null)
|
|
endPattern()
|
|
handleMapPatternEntry(:, if)
|
|
handleRecoverableError(Message[ExpectedButGot, Expected ',' before this., null, {string: ,}], if, if)
|
|
handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
handleIdentifier(, expression)
|
|
handleNoTypeArguments(if)
|
|
handleNoArguments(if)
|
|
handleSend(, if)
|
|
handleRecoverableError(Message[ExpectedButGot, Expected ':' before this., null, {string: :}], if, if)
|
|
beginPattern(:)
|
|
beginConstantPattern(null)
|
|
handleRecoverableError(Message[ExpectedIdentifier, Expected an identifier, but got 'if'., Try inserting an identifier before 'if'., {lexeme: if}], if, if)
|
|
handleIdentifier(, expression)
|
|
handleNoTypeArguments(if)
|
|
handleNoArguments(if)
|
|
handleSend(, if)
|
|
endConstantPattern(null)
|
|
endPattern()
|
|
handleMapPatternEntry(:, })
|
|
handleMapPattern(2, {, })
|
|
endPattern(})
|
|
handleSwitchCaseNoWhenClause(})
|
|
endCaseExpression(case, null, :)
|
|
beginSwitchCase(0, 1, case)
|
|
endSwitchCase(0, 1, null, null, 0, case, :)
|
|
endSwitchBlock(1, {, })
|
|
endSwitchStatement(switch, })
|
|
handleEmptyStatement(;)
|
|
endBlockFunctionBody(2, {, })
|
|
endTopLevelMethod(void, null, })
|
|
endTopLevelDeclaration(})
|
|
endCompilationUnit(1, )
|