Files
sdk/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_disallowsConst.dart.expect
T
Johnni Winther 0a154753c6 [parser][InternalNodes] Add handlePositionalArgument and handlePositionalRecordField
This [handlePositionalArgument] and [handlePositionalRecordField] methods to the parser listener, allowing listeners to normals arguments and record fields

Change-Id: I3947e196dafffea2ab383f797904c857db8327ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469620
Reviewed-by: Jens Johansen <jensj@google.com>
2026-01-06 02:30:12 -08:00

46 lines
1.7 KiB
Plaintext

Problems reported:
parser/patterns/patternVariableDeclarationStatement_disallowsConst:2:11: A record literal with exactly one positional field requires a trailing comma.
const (_) = x;
^
beginCompilationUnit(f)
beginMetadataStar(f)
endMetadataStar(0)
beginTopLevelMember(f)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(f, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(x)
endMetadataStar(0)
beginFormalParameter(x, MemberKind.TopLevelMethod, null, null, null)
handleNoType(()
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginConstLiteral(()
beginParenthesizedExpressionOrRecordLiteral(()
handleIdentifier(_, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(_, _)
handlePositionalRecordField(_)
handleRecoverableError(RecordLiteralOnePositionalFieldNoTrailingComma, ), ))
endRecordLiteral((, 1, const)
endConstLiteral())
handleIdentifier(x, expression)
handleNoTypeArguments(;)
handleNoArguments(;)
handleSend(x, x)
handleAssignmentExpression(=, x)
handleExpressionStatement(const, ;)
endBlockFunctionBody(1, {, })
endTopLevelMethod(f, null, })
endTopLevelDeclaration(})
endCompilationUnit(1, )