Files
sdk/pkg/front_end/parser_testcases/patterns/issue_51230.dart.expect
Jens Johansen 4ee8852d77 [CFE/parser] Update 'end' on endLiteralString; Set offset of StringConcatenation to the start; rename 'token' to 'operatorToken' on endBinaryPatterns
* The 'end' token on endLiteralString is now the last token of the
   string, not the next unrelated token.
 * Set the offset of StringConcatenation to the start of the string,
   not the start of the next unrelated token.
 * The 'end' token on endBinaryPatterns is renamed to 'operatorToken'.

Fixes https://github.com/dart-lang/sdk/issues/55690

Tested: Existing
Change-Id: Iae788464008594c21e759570a626971d89688033
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/498601
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-04-30 01:05:23 -07:00

664 lines
28 KiB
Plaintext

beginCompilationUnit(method1)
beginMetadataStar(method1)
endMetadataStar(0)
beginTopLevelMember(method1)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(method1, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(o)
endMetadataStar(0)
beginFormalParameter(o, MemberKind.TopLevelMethod, null, null, null)
handleNoType(()
handleIdentifier(o, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, null, o, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginSwitchExpression(switch)
handleIdentifier(o, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(o, o)
handleParenthesizedCondition((, null, null)
beginSwitchExpressionBlock({)
beginSwitchExpressionCase()
beginPattern({)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handleSwitchExpressionCasePattern(a)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(String, typeReference)
handleNoTypeArguments(a)
handleType(String, null)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handleSwitchExpressionCasePattern(a)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handleSwitchExpressionCasePattern(a)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handleSwitchExpressionCasePattern(a)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(String, typeReference)
handleNoTypeArguments(a)
handleType(String, null)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, a, false)
endPattern(a)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
handleIdentifier(int, typeReference)
handleNoTypeArguments(a)
handleType(int, null)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
handleIdentifier(String, typeReference)
handleNoTypeArguments(a)
handleType(String, null)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, a, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoType(_)
handleWildcardPattern(null, _)
endPattern(_)
handleSwitchExpressionCasePattern(_)
beginLiteralString('')
endLiteralString(0, '')
endSwitchExpressionCase(_, null, =>, '')
endSwitchExpressionBlock(15, {, })
endSwitchExpression(switch, })
handleExpressionFunctionBody(=>, ;)
endTopLevelMethod(method1, null, ;)
endTopLevelDeclaration(;)
beginMetadataStar(method2)
endMetadataStar(0)
beginTopLevelMember(method2)
beginTopLevelMethod(;, null, null)
handleNoType(;)
handleIdentifier(method2, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(o)
endMetadataStar(0)
beginFormalParameter(o, MemberKind.TopLevelMethod, null, null, null)
handleNoType(()
handleIdentifier(o, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, null, o, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginSwitchExpression(switch)
handleIdentifier(o, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(o, o)
handleParenthesizedCondition((, null, null)
beginSwitchExpressionBlock({)
beginSwitchExpressionCase()
beginPattern({)
handleIdentifier(int, typeReference)
handleNoTypeArguments(async)
handleType(int, null)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handleSwitchExpressionCasePattern(async)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(String, typeReference)
handleNoTypeArguments(async)
handleType(String, null)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handleSwitchExpressionCasePattern(async)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handleSwitchExpressionCasePattern(async)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handleSwitchExpressionCasePattern(async)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(int, typeReference)
handleNoTypeArguments(async)
handleType(int, null)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleIdentifier(String, typeReference)
handleNoTypeArguments(async)
handleType(String, null)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handleSwitchExpressionCasePattern(?)
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase(final, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, async, false)
endPattern(async)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
handleIdentifier(int, typeReference)
handleNoTypeArguments(async)
handleType(int, null)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
handleIdentifier(String, typeReference)
handleNoTypeArguments(async)
handleType(String, null)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
endRecordType((, null, 0, false)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoName(()
beginPattern(:)
beginRecordType(()
beginRecordTypeEntry()
beginMetadataStar(int)
endMetadataStar(0)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
handleNoName(,)
endRecordTypeEntry()
beginRecordTypeEntry()
beginMetadataStar(String)
endMetadataStar(0)
handleIdentifier(String, typeReference)
handleNoTypeArguments())
handleType(String, null)
handleNoName())
endRecordTypeEntry()
endRecordType((, null, 2, false)
handleDeclaredVariablePattern(final, async, false)
handleNullCheckPattern(?)
endPattern(?)
handlePatternField(:)
handleRecordPattern((, 1)
endPattern())
handleSwitchExpressionCasePattern())
beginLiteralString('working')
endLiteralString(0, 'working')
endSwitchExpressionCase((, null, =>, 'working')
beginSwitchExpressionCase()
beginPattern(,)
handleNoType(_)
handleWildcardPattern(null, _)
endPattern(_)
handleSwitchExpressionCasePattern(_)
beginLiteralString('')
endLiteralString(0, '')
endSwitchExpressionCase(_, null, =>, '')
endSwitchExpressionBlock(15, {, })
endSwitchExpression(switch, })
handleExpressionFunctionBody(=>, ;)
endTopLevelMethod(method2, null, ;)
endTopLevelDeclaration(;)
beginMetadataStar(void)
endMetadataStar(0)
beginTopLevelMember(void)
beginTopLevelMethod(;, null, null)
handleVoidKeyword(void)
handleIdentifier(foo, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
endFormalParameters(0, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
handleNoTypeVariables(()
beginFunctionExpression(()
beginFormalParameters((, MemberKind.Local)
endFormalParameters(0, (, ), MemberKind.Local)
handleAsyncModifier(async, null)
handleIdentifier(print, expression)
handleNoTypeArguments(()
beginArguments(()
beginLiteralString("async unnamed taking 0 parameters")
endLiteralString(0, "async unnamed taking 0 parameters")
handlePositionalArgument("async unnamed taking 0 parameters")
endArguments(1, (, ))
handleSend(print, ))
handleExpressionFunctionBody(=>, null)
endFunctionExpression((, ))
handleExpressionStatement((, ;)
handleNoTypeVariables(()
beginFunctionExpression(()
beginFormalParameters((, MemberKind.Local)
beginMetadataStar(int)
endMetadataStar(0)
beginFormalParameter(int, MemberKind.Local, null, null, null)
handleIdentifier(int, typeReference)
handleNoTypeArguments(x)
handleType(int, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.Local)
endFormalParameters(1, (, ), MemberKind.Local)
handleAsyncModifier(async, null)
handleIdentifier(print, expression)
handleNoTypeArguments(()
beginArguments(()
beginLiteralString("async unnamed taking 1 parameter")
endLiteralString(0, "async unnamed taking 1 parameter")
handlePositionalArgument("async unnamed taking 1 parameter")
endArguments(1, (, ))
handleSend(print, ))
handleExpressionFunctionBody(=>, null)
endFunctionExpression((, ))
handleExpressionStatement((, ;)
handleNoTypeVariables(()
beginFunctionExpression(()
beginFormalParameters((, MemberKind.Local)
beginMetadataStar(int)
endMetadataStar(0)
beginFormalParameter(int, MemberKind.Local, null, null, null)
handleIdentifier(int, typeReference)
handleNoTypeArguments(x)
handleType(int, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue(,)
endFormalParameter(null, null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.Local)
beginMetadataStar(int)
endMetadataStar(0)
beginFormalParameter(int, MemberKind.Local, null, null, null)
handleIdentifier(int, typeReference)
handleNoTypeArguments(y)
handleType(int, null)
handleIdentifier(y, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, null, y, null, null, FormalParameterKind.requiredPositional, MemberKind.Local)
endFormalParameters(2, (, ), MemberKind.Local)
handleAsyncModifier(async, null)
handleIdentifier(print, expression)
handleNoTypeArguments(()
beginArguments(()
beginLiteralString("async unnamed taking 2 parameters")
endLiteralString(0, "async unnamed taking 2 parameters")
handlePositionalArgument("async unnamed taking 2 parameters")
endArguments(1, (, ))
handleSend(print, ))
handleExpressionFunctionBody(=>, null)
endFunctionExpression((, ))
handleExpressionStatement((, ;)
endBlockFunctionBody(3, {, })
endTopLevelMethod(void, null, })
endTopLevelDeclaration(})
endCompilationUnit(3, )