Files
sdk/pkg/front_end/parser_testcases/patterns/patternVariableDeclaration_topLevel.dart.expect
T
Konstantin Shcheglov 5f6daed1e1 Augment. Parse 'augmentKeyword' for top-level variables.
Change-Id: If8f0cb6fc1af77fb91774952931db5da214142e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/354520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2024-02-27 16:48:18 +00:00

24 lines
866 B
Plaintext

Problems reported:
parser/patterns/patternVariableDeclaration_topLevel:1:5: A pattern variable declaration may not appear outside a function or method.
var (a, b) = (0, 1);
^^^^^^
beginCompilationUnit(var)
beginMetadataStar(var)
endMetadataStar(0)
beginTopLevelMember(var)
handleRecoverableError(PatternVariableDeclarationOutsideFunctionOrMethod, (, ))
beginFields(DeclarationKind.TopLevel, null, null, null, null, null, null, var, )
handleNoType(var)
handleIdentifier(, topLevelVariableDeclaration)
beginFieldInitializer(=)
beginParenthesizedExpressionOrRecordLiteral(()
handleLiteralInt(0)
handleLiteralInt(1)
endRecordLiteral((, 2, null)
endFieldInitializer(=, ;)
endTopLevelFields(null, null, null, null, null, var, 1, var, ;)
endTopLevelDeclaration()
endCompilationUnit(1, )