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>
85 lines
4.7 KiB
Plaintext
85 lines
4.7 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(x)
|
|
listener: endMetadataStar(0)
|
|
listener: beginFormalParameter(x, MemberKind.TopLevelMethod, null, null, null)
|
|
listener: handleNoType(()
|
|
ensureIdentifier((, formalParameterDeclaration)
|
|
listener: handleIdentifier(x, formalParameterDeclaration)
|
|
listener: handleFormalParameterWithoutValue())
|
|
listener: endFormalParameter(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({)
|
|
notEofOrValue(}, var)
|
|
parseStatement({)
|
|
parseStatementX({)
|
|
parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null)
|
|
skipOuterPattern(var)
|
|
listener: beginMetadataStar(var)
|
|
listener: endMetadataStar(0)
|
|
parsePatternVariableDeclarationStatement(var, {, var)
|
|
parsePattern(var, PatternContext.declaration, precedence: 1)
|
|
listener: beginPattern(var)
|
|
parsePrimaryPattern(var, PatternContext.declaration)
|
|
parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration)
|
|
parsePattern((, PatternContext.declaration, precedence: 1)
|
|
listener: beginPattern(()
|
|
parsePrimaryPattern((, PatternContext.declaration)
|
|
parseVariablePattern((, PatternContext.declaration, typeInfo: NoType())
|
|
listener: handleNoType(y)
|
|
listener: handleDeclaredVariablePattern(null, y, false)
|
|
listener: handleNullAssertPattern(!)
|
|
listener: endPattern(!)
|
|
ensureCloseParen(!, ()
|
|
listener: handleParenthesizedPattern(()
|
|
listener: endPattern())
|
|
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)
|
|
isNextIdentifier(=)
|
|
ensureIdentifier(=, expression)
|
|
listener: handleIdentifier(x, expression)
|
|
listener: handleNoTypeArguments(;)
|
|
parseArgumentsOpt(x)
|
|
listener: handleNoArguments(;)
|
|
listener: handleSend(x, ;)
|
|
ensureSemicolon(x)
|
|
listener: handlePatternVariableDeclarationStatement(var, =, ;)
|
|
notEofOrValue(}, })
|
|
listener: endBlockFunctionBody(1, {, })
|
|
listener: endTopLevelMethod(void, null, })
|
|
listener: endTopLevelDeclaration(})
|
|
reportAllErrorTokens(void)
|
|
listener: endCompilationUnit(1, )
|