[cfe] Add parser tests for patterns

These tests are copied from
pkg/analyzer/test/generated/patterns_parser_test.dart

Change-Id: Ib5fd7ca8c22dd24bf5334ac87140d961bc80838a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/261660
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This commit is contained in:
Johnni Winther 2022-09-29 09:08:57 +00:00 committed by Commit Queue
parent f1927345a6
commit dc7df3218e
818 changed files with 32406 additions and 7 deletions

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case true:
break;
}
}

View file

@ -0,0 +1,42 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralBool(true)
handleConstantPattern(null)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,98 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseLiteralBool(case)
listener: handleLiteralBool(true)
listener: handleConstantPattern(null)
ensureColon(true)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case true as Object:
break;
}
}

View file

@ -0,0 +1,48 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralBool(true)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(:)
handleType(Object, null)
endAsOperatorType(as)
handleCastPattern(as)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,105 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseLiteralBool(case)
listener: handleLiteralBool(true)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(:)
listener: handleType(Object, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
ensureColon(Object)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true as Object:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken] as[KeywordToken] Object[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true as Object:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken] as[KeywordToken] Object[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,3 @@
test(dynamic x) {
if (x case true) {}
}

View file

@ -0,0 +1,38 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginIfStatement(if)
handleIdentifier(x, expression)
handleNoTypeArguments(case)
handleNoArguments(case)
handleSend(x, case)
handleLiteralBool(true)
handleConstantPattern(null)
handleParenthesizedCondition((, case)
beginThenStatement({)
beginBlock({, BlockKind(statement))
endBlock(0, {, }, BlockKind(statement))
endThenStatement(})
endIfStatement(if, null)
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,85 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, if)
parseStatement({)
parseStatementX({)
parseIfStatement({)
listener: beginIfStatement(if)
ensureParenthesizedCondition(if, allowCase: true)
parseExpressionInParenthesisRest((, allowCase: true)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments(case)
parseArgumentsOpt(x)
listener: handleNoArguments(case)
listener: handleSend(x, case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseLiteralBool(case)
listener: handleLiteralBool(true)
listener: handleConstantPattern(null)
ensureCloseParen(true, ()
listener: handleParenthesizedCondition((, case)
listener: beginThenStatement({)
parseStatement())
parseStatementX())
parseBlock(), BlockKind(statement))
ensureBlock(), null, null)
listener: beginBlock({, BlockKind(statement))
notEofOrValue(}, })
listener: endBlock(0, {, }, BlockKind(statement))
listener: endThenStatement(})
listener: endIfStatement(if, null)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,9 @@
test(dynamic x) {
if (x case true) {}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
if[KeywordToken] ([BeginToken]x[StringToken] case[KeywordToken] true[KeywordToken])[SimpleToken] {[BeginToken]}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,9 @@
test(dynamic x) {
if (x case true) {}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
if[KeywordToken] ([BeginToken]x[StringToken] case[KeywordToken] true[KeywordToken])[SimpleToken] {[BeginToken]}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case true!:
break;
}
}

View file

@ -0,0 +1,43 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralBool(true)
handleConstantPattern(null)
handleNullAssertPattern(!)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,99 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseLiteralBool(case)
listener: handleLiteralBool(true)
listener: handleConstantPattern(null)
listener: handleNullAssertPattern(!)
ensureColon(!)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true!:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]![SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true!:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]![SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case true?:
break;
}
}

View file

@ -0,0 +1,43 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralBool(true)
handleConstantPattern(null)
handleNullCheckPattern(?)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,99 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseLiteralBool(case)
listener: handleLiteralBool(true)
listener: handleConstantPattern(null)
listener: handleNullCheckPattern(?)
ensureColon(?)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case true?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] true[KeywordToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,7 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y as int:
break;
}
}

View file

@ -0,0 +1,62 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginMetadataStar(const)
endMetadataStar(0)
handleNoType(const)
beginVariablesDeclaration(y, null, const)
handleIdentifier(y, localVariableDeclaration)
beginInitializedIdentifier(y)
beginVariableInitializer(=)
handleLiteralInt(1)
endVariableInitializer(=)
endInitializedIdentifier(y)
endVariablesDeclaration(1, ;)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(y, expression)
handleNoTypeArguments(as)
handleNoArguments(as)
handleSend(y, as)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(:)
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(2, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,139 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, const)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrConstDeclaration({)
parseExpressionStatementOrDeclarationAfterModifiers(const, {, null, const, Instance of 'NoType', false)
looksLikeLocalFunction(y)
listener: beginMetadataStar(const)
listener: endMetadataStar(0)
listener: handleNoType(const)
listener: beginVariablesDeclaration(y, null, const)
parseVariablesDeclarationRest(const, true)
parseOptionallyInitializedIdentifier(const)
ensureIdentifier(const, localVariableDeclaration)
listener: handleIdentifier(y, localVariableDeclaration)
listener: beginInitializedIdentifier(y)
parseVariableInitializerOpt(y)
listener: beginVariableInitializer(=)
parseExpression(=)
parsePrecedenceExpression(=, 1, true)
parseUnaryExpression(=, true)
parsePrimary(=, expression)
parseLiteralInt(=)
listener: handleLiteralInt(1)
listener: endVariableInitializer(=)
listener: endInitializedIdentifier(y)
ensureSemicolon(1)
listener: endVariablesDeclaration(1, ;)
notEofOrValue(}, switch)
parseStatement(;)
parseStatementX(;)
parseSwitchStatement(;)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseSendOrFunctionLiteral(case, expression)
parseSend(case, expression)
isNextIdentifier(case)
ensureIdentifier(case, expression)
listener: handleIdentifier(y, expression)
listener: handleNoTypeArguments(as)
parseArgumentsOpt(y)
listener: handleNoArguments(as)
listener: handleSend(y, as)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(:)
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
ensureColon(int)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(2, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,17 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y as int:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
const[KeywordToken] y[StringToken] =[SimpleToken] 1[StringToken];[SimpleToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] y[StringToken] as[KeywordToken] int[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,17 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y as int:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
const[KeywordToken] y[StringToken] =[SimpleToken] 1[StringToken];[SimpleToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] y[StringToken] as[KeywordToken] int[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,9 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(f: 1 as int):
break;
}
}

View file

@ -0,0 +1,79 @@
beginCompilationUnit(class)
beginMetadataStar(class)
endMetadataStar(0)
beginClassOrMixinOrNamedMixinApplicationPrelude(class)
handleIdentifier(C, classOrMixinDeclaration)
handleNoTypeVariables({)
beginClassDeclaration(class, null, null, null, C)
handleNoType(C)
handleClassExtends(null, 1)
handleClassNoWithClause()
handleImplements(null, 0)
handleClassHeader(class, class, null)
beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
beginMetadataStar(int)
endMetadataStar(0)
beginMember()
beginFields(DeclarationKind.Class, null, null, null, null, null, null, null, {)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleIdentifier(f, fieldDeclaration)
handleNoFieldInitializer(;)
endClassFields(null, null, null, null, null, null, null, 1, int, ;)
endMember()
endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
endClassDeclaration(class, })
endTopLevelDeclaration(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(}, null, null)
handleNoType(})
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleNoTypeArguments(()
handleIdentifier(f, namedArgumentReference)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments())
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handlePatternField(:)
handleExtractorPatternFields(1, (, ))
handleExtractorPattern(C, null, null)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(2, )

View file

@ -0,0 +1,158 @@
parseUnit(class)
skipErrorTokens(class)
listener: beginCompilationUnit(class)
syntheticPreviousToken(class)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(class)
listener: endMetadataStar(0)
parseTopLevelKeywordDeclaration(, class, null, Instance of 'DirectiveContext')
parseClassOrNamedMixinApplication(null, null, null, class)
listener: beginClassOrMixinOrNamedMixinApplicationPrelude(class)
ensureIdentifier(class, classOrMixinDeclaration)
listener: handleIdentifier(C, classOrMixinDeclaration)
listener: handleNoTypeVariables({)
listener: beginClassDeclaration(class, null, null, null, C)
parseClass(C, class, class, C)
parseClassHeaderOpt(C, class, class)
parseClassExtendsOpt(C)
listener: handleNoType(C)
listener: handleClassExtends(null, 1)
parseClassWithClauseOpt(C)
listener: handleClassNoWithClause()
parseClassOrMixinOrEnumImplementsOpt(C)
listener: handleImplements(null, 0)
listener: handleClassHeader(class, class, null)
parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
notEofOrValue(}, int)
parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
parseMetadataStar({)
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: beginMember()
parseFields({, null, null, null, null, null, null, null, {, Instance of 'SimpleNullableType', f, DeclarationKind.Class, C, false)
listener: beginFields(DeclarationKind.Class, null, null, null, null, null, null, null, {)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
ensureIdentifierPotentiallyRecovered(?, fieldDeclaration, false)
listener: handleIdentifier(f, fieldDeclaration)
parseFieldInitializerOpt(f, f, null, null, null, null, null, DeclarationKind.Class, C)
listener: handleNoFieldInitializer(;)
listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
listener: endMember()
notEofOrValue(}, })
listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration(test)
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(}, null, null, }, Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(}, null, null)
listener: handleNoType(})
ensureIdentifierPotentiallyRecovered(}, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
listener: handleNoTypeArguments(()
parseExtractorPatternRest(C)
ensureIdentifier((, namedArgumentReference)
listener: handleIdentifier(f, namedArgumentReference)
parsePattern(:, precedence: 1)
parsePrimaryPattern(:)
parseUnaryExpression(:, false)
parsePrimary(:, expression)
parseLiteralInt(:)
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments())
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handlePatternField(:)
listener: handleExtractorPatternFields(1, (, ))
listener: handleExtractorPattern(C, null, null)
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(class)
listener: endCompilationUnit(2, )

View file

@ -0,0 +1,21 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(f: 1 as int):
break;
}
}
class[KeywordToken] C[StringToken] {[BeginToken]
int[StringToken]?[SimpleToken] f[StringToken];[SimpleToken]
}[SimpleToken]
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] C[StringToken]([BeginToken]f[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,21 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(f: 1 as int):
break;
}
}
class[KeywordToken] C[StringToken] {[BeginToken]
int[StringToken]?[SimpleToken] f[StringToken];[SimpleToken]
}[SimpleToken]
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] C[StringToken]([BeginToken]f[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,9 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(: var f as int):
break;
}
}

View file

@ -0,0 +1,79 @@
beginCompilationUnit(class)
beginMetadataStar(class)
endMetadataStar(0)
beginClassOrMixinOrNamedMixinApplicationPrelude(class)
handleIdentifier(C, classOrMixinDeclaration)
handleNoTypeVariables({)
beginClassDeclaration(class, null, null, null, C)
handleNoType(C)
handleClassExtends(null, 1)
handleClassNoWithClause()
handleImplements(null, 0)
handleClassHeader(class, class, null)
beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
beginMetadataStar(int)
endMetadataStar(0)
beginMember()
beginFields(DeclarationKind.Class, null, null, null, null, null, null, null, {)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleIdentifier(f, fieldDeclaration)
handleNoFieldInitializer(;)
endClassFields(null, null, null, null, null, null, null, 1, int, ;)
endMember()
endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
endClassDeclaration(class, })
endTopLevelDeclaration(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(}, null, null)
handleNoType(})
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleNoTypeArguments(()
handleNoName(()
handleNoType(var)
handleVariablePattern(var, f)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments())
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handlePatternField(:)
handleExtractorPatternFields(1, (, ))
handleExtractorPattern(C, null, null)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(2, )

View file

@ -0,0 +1,155 @@
parseUnit(class)
skipErrorTokens(class)
listener: beginCompilationUnit(class)
syntheticPreviousToken(class)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(class)
listener: endMetadataStar(0)
parseTopLevelKeywordDeclaration(, class, null, Instance of 'DirectiveContext')
parseClassOrNamedMixinApplication(null, null, null, class)
listener: beginClassOrMixinOrNamedMixinApplicationPrelude(class)
ensureIdentifier(class, classOrMixinDeclaration)
listener: handleIdentifier(C, classOrMixinDeclaration)
listener: handleNoTypeVariables({)
listener: beginClassDeclaration(class, null, null, null, C)
parseClass(C, class, class, C)
parseClassHeaderOpt(C, class, class)
parseClassExtendsOpt(C)
listener: handleNoType(C)
listener: handleClassExtends(null, 1)
parseClassWithClauseOpt(C)
listener: handleClassNoWithClause()
parseClassOrMixinOrEnumImplementsOpt(C)
listener: handleImplements(null, 0)
listener: handleClassHeader(class, class, null)
parseClassOrMixinOrExtensionBody(C, DeclarationKind.Class, C)
listener: beginClassOrMixinOrExtensionBody(DeclarationKind.Class, {)
notEofOrValue(}, int)
parseClassOrMixinOrExtensionOrEnumMemberImpl({, DeclarationKind.Class, C)
parseMetadataStar({)
listener: beginMetadataStar(int)
listener: endMetadataStar(0)
listener: beginMember()
parseFields({, null, null, null, null, null, null, null, {, Instance of 'SimpleNullableType', f, DeclarationKind.Class, C, false)
listener: beginFields(DeclarationKind.Class, null, null, null, null, null, null, null, {)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
ensureIdentifierPotentiallyRecovered(?, fieldDeclaration, false)
listener: handleIdentifier(f, fieldDeclaration)
parseFieldInitializerOpt(f, f, null, null, null, null, null, DeclarationKind.Class, C)
listener: handleNoFieldInitializer(;)
listener: endClassFields(null, null, null, null, null, null, null, 1, int, ;)
listener: endMember()
notEofOrValue(}, })
listener: endClassOrMixinOrExtensionBody(DeclarationKind.Class, 1, {, })
listener: endClassDeclaration(class, })
listener: endTopLevelDeclaration(test)
parseTopLevelDeclarationImpl(}, Instance of 'DirectiveContext')
parseMetadataStar(})
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl(})
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(}, null, null, }, Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(}, null, null)
listener: handleNoType(})
ensureIdentifierPotentiallyRecovered(}, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
listener: handleNoTypeArguments(()
parseExtractorPatternRest(C)
listener: handleNoName(()
parsePattern(:, precedence: 1)
parsePrimaryPattern(:)
parseVariablePattern(:, typeInfo: Instance of 'NoType')
listener: handleNoType(var)
listener: handleVariablePattern(var, f)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments())
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handlePatternField(:)
listener: handleExtractorPatternFields(1, (, ))
listener: handleExtractorPattern(C, null, null)
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(class)
listener: endCompilationUnit(2, )

View file

@ -0,0 +1,21 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(: var f as int):
break;
}
}
class[KeywordToken] C[StringToken] {[BeginToken]
int[StringToken]?[SimpleToken] f[StringToken];[SimpleToken]
}[SimpleToken]
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] C[StringToken]([BeginToken]:[SimpleToken] var[KeywordToken] f[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,21 @@
class C {
int? f;
}
test(dynamic x) {
switch (x) {
case C(: var f as int):
break;
}
}
class[KeywordToken] C[StringToken] {[BeginToken]
int[StringToken]?[SimpleToken] f[StringToken];[SimpleToken]
}[SimpleToken]
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] C[StringToken]([BeginToken]:[SimpleToken] var[KeywordToken] f[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,3 @@
test(dynamic x) {
if (x case var y as int) {}
}

View file

@ -0,0 +1,44 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginIfStatement(if)
handleIdentifier(x, expression)
handleNoTypeArguments(case)
handleNoArguments(case)
handleSend(x, case)
handleNoType(var)
handleVariablePattern(var, y)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments())
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handleParenthesizedCondition((, case)
beginThenStatement({)
beginBlock({, BlockKind(statement))
endBlock(0, {, }, BlockKind(statement))
endThenStatement(})
endIfStatement(if, null)
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,90 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, if)
parseStatement({)
parseStatementX({)
parseIfStatement({)
listener: beginIfStatement(if)
ensureParenthesizedCondition(if, allowCase: true)
parseExpressionInParenthesisRest((, allowCase: true)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments(case)
parseArgumentsOpt(x)
listener: handleNoArguments(case)
listener: handleSend(x, case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseVariablePattern(case, typeInfo: Instance of 'NoType')
listener: handleNoType(var)
listener: handleVariablePattern(var, y)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments())
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
ensureCloseParen(int, ()
listener: handleParenthesizedCondition((, case)
listener: beginThenStatement({)
parseStatement())
parseStatementX())
parseBlock(), BlockKind(statement))
ensureBlock(), null, null)
listener: beginBlock({, BlockKind(statement))
notEofOrValue(}, })
listener: endBlock(0, {, }, BlockKind(statement))
listener: endThenStatement(})
listener: endIfStatement(if, null)
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,9 @@
test(dynamic x) {
if (x case var y as int) {}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
if[KeywordToken] ([BeginToken]x[StringToken] case[KeywordToken] var[KeywordToken] y[StringToken] as[KeywordToken] int[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,9 @@
test(dynamic x) {
if (x case var y as int) {}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
if[KeywordToken] ([BeginToken]x[StringToken] case[KeywordToken] var[KeywordToken] y[StringToken] as[KeywordToken] int[StringToken])[SimpleToken] {[BeginToken]}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case [1 as int]:
break;
}
}

View file

@ -0,0 +1,50 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleNoTypeArguments([)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(])
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handleListPattern(1, [, ])
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,110 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
listener: handleNoTypeArguments([)
parseListPatternSuffix(case)
parsePattern([, precedence: 1)
parsePrimaryPattern([)
parseUnaryExpression([, false)
parsePrimary([, expression)
parseLiteralInt([)
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(])
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handleListPattern(1, [, ])
ensureColon(])
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case [1 as int]:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] [[BeginToken]1[StringToken] as[KeywordToken] int[StringToken]][SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case [1 as int]:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] [[BeginToken]1[StringToken] as[KeywordToken] int[StringToken]][SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case int? _ as double? & Object? _:
break;
}
}

View file

@ -0,0 +1,56 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleVariablePattern(null, _)
beginAsOperatorType(as)
handleIdentifier(double, typeReference)
handleNoTypeArguments(?)
handleType(double, ?)
endAsOperatorType(as)
handleCastPattern(as)
beginBinaryPattern(&)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(?)
handleType(Object, ?)
handleVariablePattern(null, _)
endBinaryPattern(&)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,114 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
listener: handleVariablePattern(null, _)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(double, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(double, ?)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: beginBinaryPattern(&)
parsePattern(&, precedence: 12)
parsePrimaryPattern(&)
parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(Object, ?)
listener: handleVariablePattern(null, _)
listener: endBinaryPattern(&)
ensureColon(_)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ as double? & Object? _:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] double[StringToken]?[SimpleToken] &[SimpleToken] Object[StringToken]?[SimpleToken] _[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ as double? & Object? _:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] double[StringToken]?[SimpleToken] &[SimpleToken] Object[StringToken]?[SimpleToken] _[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case int? _ & double? _ as Object?:
break;
}
}

View file

@ -0,0 +1,56 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleVariablePattern(null, _)
beginBinaryPattern(&)
handleIdentifier(double, typeReference)
handleNoTypeArguments(?)
handleType(double, ?)
handleVariablePattern(null, _)
beginAsOperatorType(as)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(?)
handleType(Object, ?)
endAsOperatorType(as)
handleCastPattern(as)
endBinaryPattern(&)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,114 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
listener: handleVariablePattern(null, _)
listener: beginBinaryPattern(&)
parsePattern(&, precedence: 12)
parsePrimaryPattern(&)
parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(double, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(double, ?)
listener: handleVariablePattern(null, _)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(Object, ?)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: endBinaryPattern(&)
ensureColon(?)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ & double? _ as Object?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] &[SimpleToken] double[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] Object[StringToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ & double? _ as Object?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] &[SimpleToken] double[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] Object[StringToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case int? _ as double? | Object? _:
break;
}
}

View file

@ -0,0 +1,56 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleVariablePattern(null, _)
beginAsOperatorType(as)
handleIdentifier(double, typeReference)
handleNoTypeArguments(?)
handleType(double, ?)
endAsOperatorType(as)
handleCastPattern(as)
beginBinaryPattern(|)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(?)
handleType(Object, ?)
handleVariablePattern(null, _)
endBinaryPattern(|)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,114 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
listener: handleVariablePattern(null, _)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(double, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(double, ?)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: beginBinaryPattern(|)
parsePattern(|, precedence: 10)
parsePrimaryPattern(|)
parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(Object, ?)
listener: handleVariablePattern(null, _)
listener: endBinaryPattern(|)
ensureColon(_)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ as double? | Object? _:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] double[StringToken]?[SimpleToken] |[SimpleToken] Object[StringToken]?[SimpleToken] _[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ as double? | Object? _:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] double[StringToken]?[SimpleToken] |[SimpleToken] Object[StringToken]?[SimpleToken] _[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case int? _ | double? _ as Object?:
break;
}
}

View file

@ -0,0 +1,56 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(int, typeReference)
handleNoTypeArguments(?)
handleType(int, ?)
handleVariablePattern(null, _)
beginBinaryPattern(|)
handleIdentifier(double, typeReference)
handleNoTypeArguments(?)
handleType(double, ?)
handleVariablePattern(null, _)
beginAsOperatorType(as)
handleIdentifier(Object, typeReference)
handleNoTypeArguments(?)
handleType(Object, ?)
endAsOperatorType(as)
handleCastPattern(as)
endBinaryPattern(|)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,114 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(int, ?)
listener: handleVariablePattern(null, _)
listener: beginBinaryPattern(|)
parsePattern(|, precedence: 10)
parsePrimaryPattern(|)
parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType')
listener: handleIdentifier(double, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(double, ?)
listener: handleVariablePattern(null, _)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(Object, typeReference)
listener: handleNoTypeArguments(?)
listener: handleType(Object, ?)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: endBinaryPattern(|)
ensureColon(?)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ | double? _ as Object?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] |[SimpleToken] double[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] Object[StringToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case int? _ | double? _ as Object?:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] int[StringToken]?[SimpleToken] _[StringToken] |[SimpleToken] double[StringToken]?[SimpleToken] _[StringToken] as[KeywordToken] Object[StringToken]?[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case {'a': 1 as int}:
break;
}
}

View file

@ -0,0 +1,53 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleNoTypeArguments({)
beginLiteralString('a')
endLiteralString(0, :)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(})
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handleMapPatternEntry(:, })
handleMapPattern(1, {, })
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,119 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
listener: handleNoTypeArguments({)
parseMapPatternSuffix(case)
parseExpression({)
parsePrecedenceExpression({, 1, true)
parseUnaryExpression({, true)
parsePrimary({, expression)
parseLiteralString({)
parseSingleLiteralString({)
listener: beginLiteralString('a')
listener: endLiteralString(0, :)
parsePattern(:, precedence: 1)
parsePrimaryPattern(:)
parseUnaryExpression(:, false)
parsePrimary(:, expression)
parseLiteralInt(:)
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(})
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handleMapPatternEntry(:, })
listener: handleMapPattern(1, {, })
ensureColon(})
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case {'a': 1 as int}:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] {[BeginToken]'a'[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken]}[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case {'a': 1 as int}:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] {[BeginToken]'a'[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken]}[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case (1 as int):
break;
}
}

View file

@ -0,0 +1,49 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments())
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handleParenthesizedPattern(()
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,110 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseParenthesizedPatternOrRecordPattern(case)
parsePattern((, precedence: 1)
parsePrimaryPattern(()
parseUnaryExpression((, false)
parsePrimary((, expression)
parseLiteralInt(()
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments())
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
ensureCloseParen(int, ()
listener: handleParenthesizedPattern(()
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (1 as int):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]1[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (1 as int):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]1[StringToken] as[KeywordToken] int[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case (: var n as int, 2):
break;
}
}

View file

@ -0,0 +1,54 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleNoName(()
handleNoType(var)
handleVariablePattern(var, n)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handlePatternField(:)
handleLiteralInt(2)
handleConstantPattern(null)
handlePatternField(null)
handleRecordPattern((, 2)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,118 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseParenthesizedPatternOrRecordPattern(case)
listener: handleNoName(()
parsePattern(:, precedence: 1)
parsePrimaryPattern(:)
parseVariablePattern(:, typeInfo: Instance of 'NoType')
listener: handleNoType(var)
listener: handleVariablePattern(var, n)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handlePatternField(:)
parsePattern(,, precedence: 1)
parsePrimaryPattern(,)
parseUnaryExpression(,, false)
parsePrimary(,, expression)
parseLiteralInt(,)
listener: handleLiteralInt(2)
listener: handleConstantPattern(null)
listener: handlePatternField(null)
ensureCloseParen(2, ()
listener: handleRecordPattern((, 2)
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (: var n as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]:[SimpleToken] var[KeywordToken] n[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (: var n as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]:[SimpleToken] var[KeywordToken] n[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case (n: 1 as int, 2):
break;
}
}

View file

@ -0,0 +1,54 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(n, namedRecordFieldReference)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handlePatternField(:)
handleLiteralInt(2)
handleConstantPattern(null)
handlePatternField(null)
handleRecordPattern((, 2)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,121 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseParenthesizedPatternOrRecordPattern(case)
ensureIdentifier((, namedRecordFieldReference)
listener: handleIdentifier(n, namedRecordFieldReference)
parsePattern(:, precedence: 1)
parsePrimaryPattern(:)
parseUnaryExpression(:, false)
parsePrimary(:, expression)
parseLiteralInt(:)
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handlePatternField(:)
parsePattern(,, precedence: 1)
parsePrimaryPattern(,)
parseUnaryExpression(,, false)
parsePrimary(,, expression)
parseLiteralInt(,)
listener: handleLiteralInt(2)
listener: handleConstantPattern(null)
listener: handlePatternField(null)
ensureCloseParen(2, ()
listener: handleRecordPattern((, 2)
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (n: 1 as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]n[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (n: 1 as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]n[StringToken]:[SimpleToken] 1[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,6 @@
test(dynamic x) {
switch (x) {
case (1 as int, 2):
break;
}
}

View file

@ -0,0 +1,53 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleLiteralInt(1)
handleConstantPattern(null)
beginAsOperatorType(as)
handleIdentifier(int, typeReference)
handleNoTypeArguments(,)
handleType(int, null)
endAsOperatorType(as)
handleCastPattern(as)
handlePatternField(null)
handleLiteralInt(2)
handleConstantPattern(null)
handlePatternField(null)
handleRecordPattern((, 2)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(1, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,119 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, switch)
parseStatement({)
parseStatementX({)
parseSwitchStatement({)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseParenthesizedPatternOrRecordPattern(case)
parsePattern((, precedence: 1)
parsePrimaryPattern(()
parseUnaryExpression((, false)
parsePrimary((, expression)
parseLiteralInt(()
listener: handleLiteralInt(1)
listener: handleConstantPattern(null)
listener: beginAsOperatorType(as)
computeTypeAfterIsOrAs(as)
listener: handleIdentifier(int, typeReference)
listener: handleNoTypeArguments(,)
listener: handleType(int, null)
listener: endAsOperatorType(as)
listener: handleCastPattern(as)
listener: handlePatternField(null)
parsePattern(,, precedence: 1)
parsePrimaryPattern(,)
parseUnaryExpression(,, false)
parsePrimary(,, expression)
parseLiteralInt(,)
listener: handleLiteralInt(2)
listener: handleConstantPattern(null)
listener: handlePatternField(null)
ensureCloseParen(2, ()
listener: handleRecordPattern((, 2)
ensureColon())
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(1, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (1 as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]1[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,15 @@
test(dynamic x) {
switch (x) {
case (1 as int, 2):
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] ([BeginToken]1[StringToken] as[KeywordToken] int[StringToken],[SimpleToken] 2[StringToken])[SimpleToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,7 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y:
break;
}
}

View file

@ -0,0 +1,56 @@
beginCompilationUnit(test)
beginMetadataStar(test)
endMetadataStar(0)
beginTopLevelMember(test)
beginTopLevelMethod(, null, null)
handleNoType()
handleIdentifier(test, topLevelFunctionDeclaration)
handleNoTypeVariables(()
beginFormalParameters((, MemberKind.TopLevelMethod)
beginMetadataStar(dynamic)
endMetadataStar(0)
beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
handleIdentifier(dynamic, typeReference)
handleNoTypeArguments(x)
handleType(dynamic, null)
handleIdentifier(x, formalParameterDeclaration)
handleFormalParameterWithoutValue())
endFormalParameter(null, null, null, x, null, null, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
endFormalParameters(1, (, ), MemberKind.TopLevelMethod)
handleAsyncModifier(null, null)
beginBlockFunctionBody({)
beginMetadataStar(const)
endMetadataStar(0)
handleNoType(const)
beginVariablesDeclaration(y, null, const)
handleIdentifier(y, localVariableDeclaration)
beginInitializedIdentifier(y)
beginVariableInitializer(=)
handleLiteralInt(1)
endVariableInitializer(=)
endInitializedIdentifier(y)
endVariablesDeclaration(1, ;)
beginSwitchStatement(switch)
handleIdentifier(x, expression)
handleNoTypeArguments())
handleNoArguments())
handleSend(x, ))
handleParenthesizedCondition((, null)
beginSwitchBlock({)
beginCaseExpression(case)
handleIdentifier(y, expression)
handleNoTypeArguments(:)
handleNoArguments(:)
handleSend(y, :)
handleConstantPattern(null)
endCaseExpression(:)
handleCaseMatch(case, :)
beginSwitchCase(0, 1, case)
handleBreakStatement(false, break, ;)
endSwitchCase(0, 1, null, null, 1, case, })
endSwitchBlock(1, {, })
endSwitchStatement(switch, })
endBlockFunctionBody(2, {, })
endTopLevelMethod(test, null, })
endTopLevelDeclaration()
endCompilationUnit(1, )

View file

@ -0,0 +1,132 @@
parseUnit(test)
skipErrorTokens(test)
listener: beginCompilationUnit(test)
syntheticPreviousToken(test)
parseTopLevelDeclarationImpl(, Instance of 'DirectiveContext')
parseMetadataStar()
listener: beginMetadataStar(test)
listener: endMetadataStar(0)
parseTopLevelMemberImpl()
listener: beginTopLevelMember(test)
isReservedKeyword(()
parseTopLevelMethod(, null, null, , Instance of 'NoType', null, test, false)
listener: beginTopLevelMethod(, null, null)
listener: handleNoType()
ensureIdentifierPotentiallyRecovered(, topLevelFunctionDeclaration, false)
listener: handleIdentifier(test, topLevelFunctionDeclaration)
parseMethodTypeVar(test)
listener: handleNoTypeVariables(()
parseGetterOrFormalParameters(test, test, false, MemberKind.TopLevelMethod)
parseFormalParameters(test, MemberKind.TopLevelMethod)
parseFormalParametersRest((, MemberKind.TopLevelMethod)
listener: beginFormalParameters((, MemberKind.TopLevelMethod)
parseFormalParameter((, FormalParameterKind.requiredPositional, MemberKind.TopLevelMethod)
parseMetadataStar(()
listener: beginMetadataStar(dynamic)
listener: endMetadataStar(0)
listener: beginFormalParameter(dynamic, MemberKind.TopLevelMethod, null, null, null)
listener: handleIdentifier(dynamic, typeReference)
listener: handleNoTypeArguments(x)
listener: handleType(dynamic, null)
ensureIdentifier(dynamic, 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(}, const)
parseStatement({)
parseStatementX({)
parseExpressionStatementOrConstDeclaration({)
parseExpressionStatementOrDeclarationAfterModifiers(const, {, null, const, Instance of 'NoType', false)
looksLikeLocalFunction(y)
listener: beginMetadataStar(const)
listener: endMetadataStar(0)
listener: handleNoType(const)
listener: beginVariablesDeclaration(y, null, const)
parseVariablesDeclarationRest(const, true)
parseOptionallyInitializedIdentifier(const)
ensureIdentifier(const, localVariableDeclaration)
listener: handleIdentifier(y, localVariableDeclaration)
listener: beginInitializedIdentifier(y)
parseVariableInitializerOpt(y)
listener: beginVariableInitializer(=)
parseExpression(=)
parsePrecedenceExpression(=, 1, true)
parseUnaryExpression(=, true)
parsePrimary(=, expression)
parseLiteralInt(=)
listener: handleLiteralInt(1)
listener: endVariableInitializer(=)
listener: endInitializedIdentifier(y)
ensureSemicolon(1)
listener: endVariablesDeclaration(1, ;)
notEofOrValue(}, switch)
parseStatement(;)
parseStatementX(;)
parseSwitchStatement(;)
listener: beginSwitchStatement(switch)
ensureParenthesizedCondition(switch, allowCase: false)
parseExpressionInParenthesisRest((, allowCase: false)
parseExpression(()
parsePrecedenceExpression((, 1, true)
parseUnaryExpression((, true)
parsePrimary((, expression)
parseSendOrFunctionLiteral((, expression)
parseSend((, expression)
isNextIdentifier(()
ensureIdentifier((, expression)
listener: handleIdentifier(x, expression)
listener: handleNoTypeArguments())
parseArgumentsOpt(x)
listener: handleNoArguments())
listener: handleSend(x, ))
ensureCloseParen(x, ()
listener: handleParenthesizedCondition((, null)
parseSwitchBlock())
ensureBlock(), null, switch statement)
listener: beginSwitchBlock({)
notEofOrValue(}, case)
peekPastLabels(case)
listener: beginCaseExpression(case)
parsePattern(case, precedence: 1)
parsePrimaryPattern(case)
parseUnaryExpression(case, false)
parsePrimary(case, expression)
parseSendOrFunctionLiteral(case, expression)
parseSend(case, expression)
isNextIdentifier(case)
ensureIdentifier(case, expression)
listener: handleIdentifier(y, expression)
listener: handleNoTypeArguments(:)
parseArgumentsOpt(y)
listener: handleNoArguments(:)
listener: handleSend(y, :)
listener: handleConstantPattern(null)
ensureColon(y)
listener: endCaseExpression(:)
listener: handleCaseMatch(case, :)
peekPastLabels(break)
parseStatementsInSwitchCase(:, break, case, 0, 1, null, null)
listener: beginSwitchCase(0, 1, case)
parseStatement(:)
parseStatementX(:)
parseBreakStatement(:)
isBreakAllowed()
ensureSemicolon(break)
listener: handleBreakStatement(false, break, ;)
peekPastLabels(})
listener: endSwitchCase(0, 1, null, null, 1, case, })
notEofOrValue(}, })
listener: endSwitchBlock(1, {, })
listener: endSwitchStatement(switch, })
notEofOrValue(}, })
listener: endBlockFunctionBody(2, {, })
listener: endTopLevelMethod(test, null, })
listener: endTopLevelDeclaration()
reportAllErrorTokens(test)
listener: endCompilationUnit(1, )

View file

@ -0,0 +1,17 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
const[KeywordToken] y[StringToken] =[SimpleToken] 1[StringToken];[SimpleToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] y[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

View file

@ -0,0 +1,17 @@
test(dynamic x) {
const y = 1;
switch (x) {
case y:
break;
}
}
test[StringToken]([BeginToken]dynamic[KeywordToken] x[StringToken])[SimpleToken] {[BeginToken]
const[KeywordToken] y[StringToken] =[SimpleToken] 1[StringToken];[SimpleToken]
switch[KeywordToken] ([BeginToken]x[StringToken])[SimpleToken] {[BeginToken]
case[KeywordToken] y[StringToken]:[SimpleToken]
break[KeywordToken];[SimpleToken]
}[SimpleToken]
}[SimpleToken]
[SimpleToken]

Some files were not shown because too many files have changed in this diff Show more