Files
sdk/pkg/front_end/parser_testcases/inline_class/inline_class.dart.intertwined.expect
T
Jens Johansen fc67d31862 [parser] Listener calls should not be on the next (unrelated) token
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>
2024-04-26 06:59:23 +00:00

106 lines
6.1 KiB
Plaintext

parseUnit(inline)
skipErrorTokens(inline)
listener: beginCompilationUnit(inline)
syntheticPreviousToken(inline)
parseTopLevelDeclarationImpl(, DirectiveContext(DirectiveState.Unknown))
parseMetadataStar()
listener: beginMetadataStar(inline)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(inline)
isReservedKeyword(class)
indicatesMethodOrField(Class)
parseFields(, null, null, null, null, null, null, null, , NoType(), inline, DeclarationKind.TopLevel, null, false)
listener: beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, null, )
reportRecoverableError(inline, MissingConstFinalVarOrType)
listener: handleRecoverableError(MissingConstFinalVarOrType, inline, inline)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelVariableDeclaration, false)
listener: handleIdentifier(inline, topLevelVariableDeclaration)
parseFieldInitializerOpt(inline, inline, null, null, null, null, null, DeclarationKind.TopLevel, null)
listener: handleNoFieldInitializer(class)
ensureSemicolon(inline)
reportRecoverableError(inline, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], inline, inline)
rewriter()
listener: endTopLevelFields(null, null, null, null, null, null, 1, inline, ;)
listener: endTopLevelDeclaration(;)
parseTopLevelDeclarationImpl(;, DirectiveContext(DirectiveState.Declarations))
parseMetadataStar(;)
listener: beginMetadataStar(class)
listener: endMetadataStar(0)
parseTopLevelKeywordDeclaration(class, ;, class, null, null, null, null, DirectiveContext(DirectiveState.Declarations))
parseClassOrNamedMixinApplication(class, null, null, null, null, null, null, null, null, class)
listener: beginClassOrMixinOrNamedMixinApplicationPrelude(class)
ensureIdentifier(class, classOrMixinDeclaration)
listener: handleIdentifier(Class, classOrMixinDeclaration)
listener: handleNoTypeVariables({)
listener: beginClassDeclaration(class, null, null, null, null, null, null, null, null, Class)
parseClass(Class, class, class, Class)
parseClassHeaderOpt(Class, class, class)
parseClassExtendsOpt(Class, DeclarationHeaderKind.Class)
listener: handleNoType(Class)
listener: handleClassExtends(null, 1)
parseClassWithClauseOpt(Class)
listener: handleClassNoWithClause()
parseClassOrMixinOrEnumImplementsOpt(Class)
listener: handleImplements(null, 0)
listener: handleClassHeader(class, class, null)
parseClassOrMixinOrExtensionBody(Class, DeclarationKind.Class, Class)
listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
notEofOrValue(}, })
listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 0, {, })
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration(})
parseTopLevelDeclarationImpl(}, DirectiveContext(DirectiveState.Declarations))
parseMetadataStar(})
listener: beginMetadataStar(inline)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(inline)
isReservedKeyword(class)
indicatesMethodOrField(Class)
parseFields(}, null, null, null, null, null, null, null, }, NoType(), inline, DeclarationKind.TopLevel, null, false)
listener: beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, null, })
reportRecoverableError(inline, MissingConstFinalVarOrType)
listener: handleRecoverableError(MissingConstFinalVarOrType, inline, inline)
listener: handleNoType(})
ensureIdentifierPotentiallyRecovered(}, topLevelVariableDeclaration, false)
listener: handleIdentifier(inline, topLevelVariableDeclaration)
parseFieldInitializerOpt(inline, inline, null, null, null, null, null, DeclarationKind.TopLevel, null)
listener: handleNoFieldInitializer(class)
ensureSemicolon(inline)
reportRecoverableError(inline, Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}])
listener: handleRecoverableError(Message[ExpectedAfterButGot, Expected ';' after this., null, {string: ;}], inline, inline)
rewriter()
listener: endTopLevelFields(null, null, null, null, null, null, 1, inline, ;)
listener: endTopLevelDeclaration(;)
parseTopLevelDeclarationImpl(;, DirectiveContext(DirectiveState.Declarations))
parseMetadataStar(;)
listener: beginMetadataStar(class)
listener: endMetadataStar(0)
parseTopLevelKeywordDeclaration(class, ;, class, null, null, null, null, DirectiveContext(DirectiveState.Declarations))
parseClassOrNamedMixinApplication(class, null, null, null, null, null, null, null, null, class)
listener: beginClassOrMixinOrNamedMixinApplicationPrelude(class)
ensureIdentifier(class, classOrMixinDeclaration)
listener: handleIdentifier(Class, classOrMixinDeclaration)
listener: handleNoTypeVariables(=)
listener: beginNamedMixinApplication(class, null, null, null, null, null, null, null, null, Class)
parseNamedMixinApplication(Class, class, class)
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(with)
listener: handleType(Object, null)
parseMixinApplicationRest(Object)
parseTypeList(with)
listener: beginTypeList(Mixin)
listener: handleIdentifier(Mixin, typeReference)
listener: handleNoTypeArguments(;)
listener: handleType(Mixin, null)
listener: endTypeList(1)
listener: handleNamedMixinApplicationWithClause(with)
ensureSemicolon(Mixin)
listener: endNamedMixinApplication(class, class, =, null, ;)
listener: endTopLevelDeclaration(;)
reportAllErrorTokens(inline)
listener: endCompilationUnit(4, )