diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart index 2b68e9150610..6dcc89cfaa84 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/forwarding_listener.dart @@ -1778,8 +1778,10 @@ class ForwardingListener implements Listener { } @override - void handleVariablePattern(Token? keyword, Token variable) { - listener?.handleVariablePattern(keyword, variable); + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { + listener?.handleVariablePattern(keyword, variable, + inAssignmentPattern: inAssignmentPattern); } @override diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart index 28c02b504b3d..9fe0915686a8 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/listener.dart @@ -1433,7 +1433,12 @@ class Listener implements UnescapeErrorListener { /// Called after the parser has consumed a variable pattern, consisting of an /// optional `var` or `final` keyword, an optional type annotation, and a /// variable name identifier. - void handleVariablePattern(Token? keyword, Token variable) { + /// + /// The flag [inAssignmentPattern] indicates whether this variable pattern is + /// part of a `patternAssignment` (and hence should refer to a previously + /// declared variable rather than declaring a fresh one). + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { logEvent('VariablePattern'); } diff --git a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart index 4d8415a8e5d1..788f2f7fb32f 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart @@ -6298,7 +6298,7 @@ class Parser { Token next = token.next!; if (allowPatterns && optional('case', next)) { Token case_ = token = next; - token = parsePattern(token, isRefutableContext: true); + token = parsePattern(token, PatternContext.matching); next = token.next!; Token? when; if (optional('when', next)) { @@ -7459,7 +7459,7 @@ class Parser { } if (forPartsContext != null) { forPartsContext.patternKeyword = varFinalOrConst; - return parsePattern(beforeType, isRefutableContext: false); + return parsePattern(beforeType, PatternContext.declaration); } else { return parsePatternVariableDeclarationStatement( beforeType, start, varFinalOrConst); @@ -8371,7 +8371,7 @@ class Parser { } listener.beginCaseExpression(caseKeyword); if (allowPatterns) { - token = parsePattern(caseKeyword, isRefutableContext: true); + token = parsePattern(caseKeyword, PatternContext.matching); } else { token = parseExpression(caseKeyword); } @@ -9234,20 +9234,13 @@ class Parser { /// nullAssertPattern ::= primaryPattern '!' /// nullCheckPattern ::= primaryPattern '?' /// - /// [isRefutableContext] should be `true` if the pattern occurs in a - /// `guardedPattern` or any of its sub-patterns (i.e. in a - /// `switchStatementCase`, `switchExpressionCase`, or `ifCondition`); these - /// are contexts where a pattern match might be expected to fail, and bare - /// identifiers are treated as constant patterns. It should be `false` if the - /// pattern occurs in a `localVariableDeclaration`, `forLoopParts`, or - /// `patternAssignment`; these are contexts where a pattern match failure is - /// either prohibited statically or causes a runtime exception, and bare - /// identifiers are treated as variable patterns. - Token parsePattern(Token token, - {int precedence = 1, required bool isRefutableContext}) { + /// [patternContext] indicates whether the pattern is refutable or + /// irrefutable, and whether it occurs as part of a patternAssignment. + Token parsePattern(Token token, PatternContext patternContext, + {int precedence = 1}) { assert(precedence >= 1); assert(precedence <= SELECTOR_PRECEDENCE); - token = parsePrimaryPattern(token, isRefutableContext: isRefutableContext); + token = parsePrimaryPattern(token, patternContext); while (true) { Token next = token.next!; int tokenLevel = _computePrecedence(next, forPattern: true); @@ -9278,9 +9271,8 @@ class Parser { case '||': listener.beginBinaryPattern(next); // Left associative so we parse the RHS one precedence level higher - token = parsePattern(next, - precedence: tokenLevel + 1, - isRefutableContext: isRefutableContext); + token = + parsePattern(next, patternContext, precedence: tokenLevel + 1); listener.endBinaryPattern(next); break; default: @@ -9317,7 +9309,7 @@ class Parser { /// | 'const' typeArguments? '{' elements? '}' /// | 'const' '(' expression ')' /// objectPattern ::= typeName typeArguments? '(' patternFields? ')' - Token parsePrimaryPattern(Token token, {required bool isRefutableContext}) { + Token parsePrimaryPattern(Token token, PatternContext patternContext) { Token start = token; TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token, /* inDeclaration = */ true); @@ -9327,8 +9319,7 @@ class Parser { case '[': // listPattern ::= typeArguments? '[' patterns? ']' token = typeArg.parseArguments(token, this); - token = parseListPatternSuffix(token, - isRefutableContext: isRefutableContext); + token = parseListPatternSuffix(token, patternContext); // A list pattern is a valid form of outerPattern, so verify that // skipOuterPattern would have skipped this pattern properly. assert( @@ -9339,8 +9330,7 @@ class Parser { // mapPatternEntries ::= mapPatternEntry ( ',' mapPatternEntry )* ','? // mapPatternEntry ::= expression ':' pattern token = typeArg.parseArguments(token, this); - token = parseMapPatternSuffix(token, - isRefutableContext: isRefutableContext); + token = parseMapPatternSuffix(token, patternContext); // A map pattern is a valid form of outerPattern, so verify that // skipOuterPattern would have skipped this pattern properly. assert( @@ -9355,7 +9345,7 @@ class Parser { case 'var': case 'final': // variablePattern ::= ( 'var' | 'final' | 'final'? type )? identifier - return parseVariablePattern(token); + return parseVariablePattern(token, patternContext); case '(': // parenthesizedPattern ::= '(' pattern ')' // recordPattern ::= '(' patternFields? ')' @@ -9366,8 +9356,8 @@ class Parser { listener.handleRecordPattern(next, /* count = */ 0); token = nextNext; } else { - token = parseParenthesizedPatternOrRecordPattern(token, - isRefutableContext: isRefutableContext); + token = + parseParenthesizedPatternOrRecordPattern(token, patternContext); } // A record or parenthesized pattern is a valid form of outerPattern, so // verify that skipOuterPattern would have skipped this pattern @@ -9412,7 +9402,7 @@ class Parser { } TypeInfo typeInfo = computeVariablePatternType(token); if (typeInfo != noType) { - return parseVariablePattern(token, typeInfo: typeInfo); + return parseVariablePattern(token, patternContext, typeInfo: typeInfo); } // objectPattern ::= typeName typeArguments? '(' patternFields? ')' // TODO(paulberry): Make sure OTHER_IDENTIFIER is handled @@ -9441,8 +9431,7 @@ class Parser { if (optional('(', afterToken) && !potentialTypeArg.recovered) { TypeParamOrArgInfo typeArg = potentialTypeArg; token = typeArg.parseArguments(token, this); - token = parseObjectPatternRest(token, - isRefutableContext: isRefutableContext); + token = parseObjectPatternRest(token, patternContext); listener.handleObjectPattern(firstIdentifier, dot, secondIdentifier); // An object pattern is a valid form of outerPattern, so verify that // skipOuterPattern would have skipped this pattern properly. @@ -9452,10 +9441,10 @@ class Parser { } else if (dot == null) { // It's a single identifier. If it's a wildcard pattern or we're in an // irrefutable context, parse it as a variable pattern. - if (!isRefutableContext || firstIdentifier.lexeme == '_') { + if (!patternContext.isRefutable || firstIdentifier.lexeme == '_') { // It's a wildcard pattern with no preceding type, so parse it as a // variable pattern. - return parseVariablePattern(beforeFirstIdentifier, + return parseVariablePattern(beforeFirstIdentifier, patternContext, typeInfo: typeInfo); } } @@ -9474,7 +9463,8 @@ class Parser { /// about the type appearing after [token], if any. /// /// variablePattern ::= ( 'var' | 'final' | 'final'? type )? identifier - Token parseVariablePattern(Token token, {TypeInfo typeInfo = noType}) { + Token parseVariablePattern(Token token, PatternContext patternContext, + {TypeInfo typeInfo = noType}) { Token? keyword; if (typeInfo != noType) { token = typeInfo.parseType(token, this); @@ -9500,7 +9490,8 @@ class Parser { token = insertSyntheticIdentifier( token, IdentifierContext.localVariableDeclaration); } - listener.handleVariablePattern(keyword, token); + listener.handleVariablePattern(keyword, token, + inAssignmentPattern: patternContext == PatternContext.assignment); return token; } @@ -9508,8 +9499,7 @@ class Parser { /// bracket. /// /// listPattern ::= typeArguments? '[' patterns? ']' - Token parseListPatternSuffix(Token token, - {required bool isRefutableContext}) { + Token parseListPatternSuffix(Token token, PatternContext patternContext) { Token beforeToken = token; Token beginToken = token = token.next!; assert(optional('[', token) || optional('[]', token)); @@ -9537,11 +9527,11 @@ class Parser { next = token.next!; bool hasSubPattern = looksLikePatternStart(next); if (hasSubPattern) { - token = parsePattern(token, isRefutableContext: isRefutableContext); + token = parsePattern(token, patternContext); } listener.handleRestPattern(dots, hasSubPattern: hasSubPattern); } else { - token = parsePattern(token, isRefutableContext: isRefutableContext); + token = parsePattern(token, patternContext); } next = token.next!; ++count; @@ -9585,7 +9575,7 @@ class Parser { /// mapPattern ::= typeArguments? '{' mapPatternEntries? '}' /// mapPatternEntries ::= mapPatternEntry ( ',' mapPatternEntry )* ','? /// mapPatternEntry ::= expression ':' pattern - Token parseMapPatternSuffix(Token token, {required bool isRefutableContext}) { + Token parseMapPatternSuffix(Token token, PatternContext patternContext) { Token leftBrace = token = token.next!; assert(optional('{', leftBrace)); Token next = token.next!; @@ -9604,7 +9594,7 @@ class Parser { next = token.next!; bool hasSubPattern = looksLikePatternStart(next); if (hasSubPattern) { - token = parsePattern(token, isRefutableContext: isRefutableContext); + token = parsePattern(token, patternContext); } listener.handleRestPattern(dots, hasSubPattern: hasSubPattern); } else { @@ -9618,7 +9608,7 @@ class Parser { codes.templateExpectedButGot.withArguments(':'), new SyntheticToken(TokenType.PERIOD, next.charOffset)); } - token = parsePattern(colon, isRefutableContext: isRefutableContext); + token = parsePattern(colon, patternContext); listener.handleMapPatternEntry(colon, token.next!); } ++count; @@ -9664,8 +9654,8 @@ class Parser { /// recordPattern ::= '(' patternFields? ')' /// patternFields ::= patternField ( ',' patternField )* ','? /// patternField ::= ( identifier? ':' )? pattern - Token parseParenthesizedPatternOrRecordPattern(Token token, - {required bool isRefutableContext}) { + Token parseParenthesizedPatternOrRecordPattern( + Token token, PatternContext patternContext) { Token begin = token.next!; assert(optional('(', begin)); bool old = mayParseFunctionExpressions; @@ -9698,7 +9688,7 @@ class Parser { colon = token; wasValidRecord = true; } - token = parsePattern(token, isRefutableContext: isRefutableContext); + token = parsePattern(token, patternContext); next = token.next!; if (wasRecord || colon != null) { listener.handlePatternField(colon); @@ -9741,8 +9731,7 @@ class Parser { /// `(`. /// /// objectPattern ::= typeName typeArguments? '(' patternFields? ')' - Token parseObjectPatternRest(Token token, - {required bool isRefutableContext}) { + Token parseObjectPatternRest(Token token, PatternContext patternContext) { Token begin = token = token.next!; assert(optional('(', begin)); int argumentCount = 0; @@ -9764,7 +9753,7 @@ class Parser { .next!; colon = token; } - token = parsePattern(token, isRefutableContext: isRefutableContext); + token = parsePattern(token, patternContext); next = token.next!; listener.handlePatternField(colon); ++argumentCount; @@ -9869,7 +9858,7 @@ class Parser { /// expression Token parsePatternVariableDeclarationStatement( Token keyword, Token start, Token varOrFinal) { - Token token = parsePattern(keyword, isRefutableContext: false); + Token token = parsePattern(keyword, PatternContext.declaration); Token equals = token.next!; // Caller should have assured that the pattern was followed by an `=`. assert(optional('=', equals)); @@ -9882,7 +9871,7 @@ class Parser { /// patternAssignment ::= outerPattern '=' expression Token parsePatternAssignment(Token token) { - token = parsePattern(token, isRefutableContext: false); + token = parsePattern(token, PatternContext.assignment); Token equals = token.next!; // Caller should have assured that the pattern was followed by an `=`. assert(optional('=', equals)); @@ -9911,7 +9900,7 @@ class Parser { mayParseFunctionExpressions = false; while (true) { listener.beginSwitchExpressionCase(); - token = parsePattern(token, isRefutableContext: true); + token = parsePattern(token, PatternContext.matching); Token? when; next = token.next!; if (optional('when', next)) { @@ -9980,3 +9969,23 @@ class ForPartsContext { @override String toString() => 'ForPartsContext($patternKeyword)'; } + +/// Enum describing the different contexts in which a pattern can occur. +enum PatternContext { + /// The pattern is part of a localVariableDeclaration or forLoopParts, meaning + /// bare identifiers refer to freshly declared variables. + declaration(isRefutable: false), + + /// The pattern is part of a guardedPattern inside an if-case, switch + /// expression, or switch statement, meaning bare identifiers refer to + /// constants. + matching(isRefutable: true), + + /// The pattern is part of a pattern assignment, meaning bare identifiers + /// refer to previously declared variables. + assignment(isRefutable: false); + + final bool isRefutable; + + const PatternContext({required this.isRefutable}); +} diff --git a/pkg/analyzer/lib/src/fasta/ast_builder.dart b/pkg/analyzer/lib/src/fasta/ast_builder.dart index 0f752c075c93..9fb931be7d9b 100644 --- a/pkg/analyzer/lib/src/fasta/ast_builder.dart +++ b/pkg/analyzer/lib/src/fasta/ast_builder.dart @@ -5274,7 +5274,9 @@ class AstBuilder extends StackListener { } @override - void handleVariablePattern(Token? keyword, Token variable) { + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { + // TODO(paulberry, scheglov): use inAssignmentPattern debugEvent('VariablePattern'); if (!_featureSet.isEnabled(Feature.patterns)) { // TODO(paulberry): report the appropriate error diff --git a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart index 94025edee013..c52be52c02bc 100644 --- a/pkg/front_end/lib/src/fasta/kernel/body_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/body_builder.dart @@ -8428,7 +8428,8 @@ class BodyBuilder extends StackListenerImpl } @override - void handleVariablePattern(Token? keyword, Token variable) { + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { debugEvent('VariablePattern'); assert(checkState(keyword ?? variable, [ ValueKinds.TypeBuilderOrNull, @@ -8443,6 +8444,7 @@ class BodyBuilder extends StackListenerImpl if (variable.lexeme == "_") { pattern = new WildcardPattern(patternType, variable.charOffset); } else { + // TODO(paulberry): use inAssignmentPattern. pattern = new VariablePattern( patternType, variable.lexeme, diff --git a/pkg/front_end/lib/src/fasta/kernel/macro/annotation_parser.dart b/pkg/front_end/lib/src/fasta/kernel/macro/annotation_parser.dart index 27949a28a543..66bc63e4c250 100644 --- a/pkg/front_end/lib/src/fasta/kernel/macro/annotation_parser.dart +++ b/pkg/front_end/lib/src/fasta/kernel/macro/annotation_parser.dart @@ -2032,7 +2032,8 @@ class _MacroListener implements Listener { } @override - void handleVariablePattern(Token? keyword, Token variable) { + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { _unsupported(); } diff --git a/pkg/front_end/lib/src/fasta/util/parser_ast_helper.dart b/pkg/front_end/lib/src/fasta/util/parser_ast_helper.dart index 72fa1bc0c0e7..76c11c80d8d3 100644 --- a/pkg/front_end/lib/src/fasta/util/parser_ast_helper.dart +++ b/pkg/front_end/lib/src/fasta/util/parser_ast_helper.dart @@ -1906,9 +1906,12 @@ abstract class AbstractParserAstListener implements Listener { } @override - void handleVariablePattern(Token? keyword, Token variable) { + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { VariablePatternHandle data = new VariablePatternHandle(ParserAstType.HANDLE, - keyword: keyword, variable: variable); + keyword: keyword, + variable: variable, + inAssignmentPattern: inAssignmentPattern); seen(data); } @@ -6329,15 +6332,17 @@ class NullCheckPatternHandle extends ParserAstNode { class VariablePatternHandle extends ParserAstNode { final Token? keyword; final Token variable; + final bool inAssignmentPattern; VariablePatternHandle(ParserAstType type, - {this.keyword, required this.variable}) + {this.keyword, required this.variable, required this.inAssignmentPattern}) : super("VariablePattern", type); @override Map get deprecatedArguments => { "keyword": keyword, "variable": variable, + "inAssignmentPattern": inAssignmentPattern, }; } diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect index b8e0f585cf75..6e00cbbd5f9b 100644 --- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_case.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect index 45a8b23703d2..d59358466361 100644 --- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_cast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect index 46139c67da96..a0d3dd82ab69 100644 --- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect index d4bb2f73a1ed..2decddec3227 100644 --- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_assert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect index ae5fc4247b89..7f10027852f0 100644 --- a/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/boolean_literal_inside_null_check.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect index 78ddf450cbe6..0cf06bd55781 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideIfStatement.dart.intertwined.expect @@ -58,8 +58,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect index f9f1a37039e5..093794d083bc 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_guarded_insideSwitchStatement.dart.intertwined.expect @@ -66,8 +66,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect index f450d63e1317..6df468355a2b 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideIfStatement.dart.intertwined.expect @@ -58,8 +58,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect index 9e9df2acf744..9e63c0017c1a 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withClassicPattern_unguarded_insideSwitchStatement.dart.intertwined.expect @@ -66,8 +66,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect index b403f6662af3..97e6ad41db7e 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideIfStatement.dart.intertwined.expect @@ -58,8 +58,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect index bfc1c6e73b13..e0a4f9e22de4 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_guarded_insideSwitchStatement.dart.intertwined.expect @@ -66,8 +66,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect index 94a6fc99b321..cb7ee398120b 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideIfStatement.dart.intertwined.expect @@ -58,8 +58,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect index b400811b7386..47bded5acaf9 100644 --- a/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/caseHead_withNewPattern_unguarded_insideSwitchStatement.dart.intertwined.expect @@ -66,8 +66,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect index fc08ae69f3fc..b311d5e3c31d 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_case.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect index 256aee65cc63..e6c40fe4bc2f 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.expect index 5d1a77f1b344..987112458719 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.expect @@ -56,7 +56,7 @@ beginCompilationUnit(class) handleNoTypeArguments(() handleNoName(() handleNoType(var) - handleVariablePattern(var, f) + handleVariablePattern(var, f, false) beginAsOperatorType(as) handleIdentifier(int, typeReference) handleNoTypeArguments()) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect index af1c60049c60..b37c46508475 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_extractor_pattern_implicitly_named.dart.intertwined.expect @@ -113,16 +113,16 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, f) + listener: handleVariablePattern(var, f, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(int, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.expect index 8f4e727af463..7a0fbe4256ac 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(test) handleNoArguments(case) handleSend(x, case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) beginAsOperatorType(as) handleIdentifier(int, typeReference) handleNoTypeArguments()) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect index dcdbc226df75..f5a033d6e27d 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_if_case.dart.intertwined.expect @@ -61,11 +61,11 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(int, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect index feea266e871b..3d7259527516 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_list_pattern.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.expect index f22bc8d93540..99b746bf1203 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(double, typeReference) handleNoTypeArguments(?) @@ -41,7 +41,7 @@ beginCompilationUnit(test) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect index f38103f24373..1621d04c868b 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_lhs.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(double, typeReference) @@ -84,13 +84,13 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) ensureColon(_) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.expect index 03f6122107a8..92b1779c8f03 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.expect @@ -30,12 +30,12 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(&&) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect index 2233b2103617..95bf73c55a9e 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_and_rhs.dart.intertwined.expect @@ -69,21 +69,21 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.expect index b0ea97e17393..ec686a02a1be 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(double, typeReference) handleNoTypeArguments(?) @@ -41,7 +41,7 @@ beginCompilationUnit(test) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(||) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect index 8470d81e4e85..3ac2b64fad31 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_lhs.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(double, typeReference) @@ -84,13 +84,13 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(||) ensureColon(_) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.expect index ec337d602787..1283c09556ea 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.expect @@ -30,12 +30,12 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(||) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect index 1fc7fdf1bdfb..e6c550d6c780 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_logical_or_rhs.dart.intertwined.expect @@ -69,21 +69,21 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect index a4edaa2a4d16..b86afa3b65ff 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_map_pattern.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect index aff600559d68..bd6716e94b40 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_parenthesized_pattern.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.expect index dabdcb9f8d6a..85c01f1a86ec 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.expect @@ -29,7 +29,7 @@ beginCompilationUnit(test) beginCaseExpression(case) handleNoName(() handleNoType(var) - handleVariablePattern(var, n) + handleVariablePattern(var, n, false) beginAsOperatorType(as) handleIdentifier(int, typeReference) handleNoTypeArguments(,) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect index f6089272fd88..a0a8179f85ea 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_implicitly_named.dart.intertwined.expect @@ -69,15 +69,15 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, n) + listener: handleVariablePattern(var, n, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(int, typeReference) @@ -86,8 +86,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect index 82dddc2dfe3c..4a309ea4d8cd 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_named.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -90,8 +90,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect index cf2cb937444c..8c639e8bcdee 100644 --- a/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/cast_inside_record_pattern_unnamed.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -88,8 +88,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect index 97aba29572fb..7a3e069ec56a 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_builtin.dart.intertwined.expect @@ -131,8 +131,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect index 3b8236629411..63f0097f3183 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect index 9d4779c8a9c4..9caf2c93b148 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect index bbf6005106a5..1f8ba6250a4d 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect index 4474c1e79a23..c055a0ab1669 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect index 0b77517e4b1f..d52cbbe3566f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect index 112a32d47f55..9e093257d945 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_doublyPrefixed_pseudoKeyword.dart.intertwined.expect @@ -131,8 +131,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect index 77d1048f2c80..a8268210de1f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_case.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect index bfdbe23a7bc6..d13f09a286e4 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_cast.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect index 5fbdaf07c3e6..467dfb96e176 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_if_case.dart.intertwined.expect @@ -90,8 +90,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect index 8eb976cc0057..0edd0ab93aae 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_assert.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect index e6eb3942ed0e..37406ac02221 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_inside_null_check.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect index d2e28a3015b6..53f91759f10f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixedWithUnderscore_insideCase.dart.intertwined.expect @@ -66,8 +66,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect index b54e7fb09174..d994b0936db2 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_builtin.dart.intertwined.expect @@ -118,8 +118,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect index 711c7acfe0e7..945a9551edb6 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect index 4cb5a81ff0ca..1e16276088f9 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect index 6b82410839ed..831aef0d86e9 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect index 529d8597d80e..fcb2700c76e8 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect index d4370dfbe68f..f402196928e3 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect index d657127f9642..c2fecd29b03a 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_prefixed_pseudoKeyword.dart.intertwined.expect @@ -118,8 +118,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect index 09b8c7cb119b..53049cba13a7 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_beforeWhen.dart.intertwined.expect @@ -95,8 +95,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect index 74822cc7f305..6c4acbb3818e 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_builtin.dart.intertwined.expect @@ -105,8 +105,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect index 6f89a56a2095..2b4316cbd514 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_insideSwitchExpression.dart.intertwined.expect @@ -68,8 +68,8 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) parsePrecedenceExpression({, 17, false) parseUnaryExpression({, false) parsePrimary({, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect index f93c4b0ab72c..625508e3d1f7 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_identifier_unprefixed_pseudoKeyword.dart.intertwined.expect @@ -105,8 +105,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect index cf7969717583..f1e4d5c0c6f2 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect index abda7aa16020..ffd85411080c 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect index 87bd6d720921..8ba24be7d728 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect index 7d76540fe402..e21948c81c94 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect index bbfddee6e94b..07f853d17de2 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_empty_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect index cfecb377c46d..74e32db0de61 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect index 1df5f1a65672..cd614ea54801 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect index b46f1cc986b9..b5142756c63f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect index 44a10c23a3bf..ab2984e2fa42 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect index d6f53f80760e..5615bdbe0312 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_typed_nonEmpty_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect index 3d8977553a93..2b091b3dd1e6 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect index da751d9659b5..467fb1ef87c0 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect index bc000dd0c333..23693bd955b0 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect index c8d37376fc4e..ef9a1976c43e 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect index 2fa02f079204..914214d90a64 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_empty_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect index 2d16fc6bf71c..20b029216d0b 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect index bc12440844ae..3e8765df1727 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect index f8c8fce08b4c..8bc259cd7ca8 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect index 2c9cb9dfb17c..41e00e2dd285 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect index 529c0ca456e2..b58b95660d15 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_list_untyped_nonEmpty_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect index e66dc5af8f75..62dbd5efda9c 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect index cec2c64edda9..a19e1cdc13e6 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect index 814781d7a7f1..5de20af00c64 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect index 2953c49d450a..1ec52268bb82 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect index 8741a2737e01..287b47417654 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_typed_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect index b279dfdfba6b..1df115c297d2 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect index 9e8b73685d6e..cf0834160e3f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect index 922d1a9c5ec1..5f4a6ff988b7 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect index 1cda99b9f098..55eb8d40a060 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect index 3bb1045b95d0..c2e9b8613554 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_map_untyped_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect index 8ed47ae391e8..774485023fc1 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect index 9226b57a9242..6163756d9165 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect index 19ee16993acb..0c53e46d65be 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect index ef176e800931..92d8992e6d79 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect index 87732c6bc10f..76a331fd6c56 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_objectExpression_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect index 9b548d0e3c07..13baa44e5826 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect index bdaa899625b1..6ef8f982e5db 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect index 9e6ce5bb9d66..f689a3ef7943 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect index 039af5bd3dfd..bc57b81f8b51 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect index f8d1a043e81a..01f56bb15378 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_parenthesized_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect index 2085bb935889..1310d5670ba4 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect index 431879a6d5f4..fd2e299e77cb 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect index 668cdb6a0815..1ad4783c61af 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect index 0c2f5e167858..c1cbd3d6f6e1 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect index 5b126ed30b90..90d53ed485ff 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_typed_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect index 3b0d39a91419..2f8611498b40 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCase.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect index 8bb8e062abb8..ee986c1ae98d 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideCast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect index 7964395a0e07..a7d122c2873f 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideIfCase.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect index 85756185e850..099221785bd3 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullAssert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect index 8afddc3b358a..a43de971560b 100644 --- a/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/constant_set_untyped_insideNullCheck.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect index 5dca641d1dc4..074a32d89c05 100644 --- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_case.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect index 4c8ff87c1bac..31882d57a5bc 100644 --- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_cast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect index 721068a0ed1a..9a582efe4a16 100644 --- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect index 91997198dd61..5b529897ded4 100644 --- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_assert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect index c6e5e8d19199..480b1a1aafa6 100644 --- a/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/double_literal_inside_null_check.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect index bfae2dc9eaa5..5dafd3fdb6b4 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_cast.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect index 3a2789aaa6c6..91d15db07155 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_assert.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect index 6c79e1cb4879..6a5a19a40882 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_inside_null_check.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect index 37c544a83586..8ca26ce4c06e 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args.dart.intertwined.expect @@ -104,14 +104,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(C, null, null) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect index bf056430d16c..fdf7e2784db9 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect @@ -121,18 +121,18 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect index c7c4d01d4d37..f770d35fe388 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect @@ -66,14 +66,14 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, ., Future) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect index f1a4fb97a033..bb77a2dc07b3 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_prefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect @@ -66,10 +66,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(Future, isRefutableContext: true) + parseObjectPatternRest(Future, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, ., Future) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect index 66c28bdf5f95..b29259b9452f 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withTypeArgs_insideCase.dart.intertwined.expect @@ -66,14 +66,14 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, null, null) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect index 5e889cc442b3..a413a46fc7ec 100644 --- a/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/extractor_unprefixedNamedUnderscore_withoutTypeArgs_insideCase.dart.intertwined.expect @@ -66,10 +66,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(_, isRefutableContext: true) + parseObjectPatternRest(_, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, null, null) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.expect index 1d75c91fc933..bf701cf435e1 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect index 7518379662a2..5039700168e4 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_case.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) ensureColon(y) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.expect index 80d63f7d8831..53d4c958e938 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect index 7e74dccb1017..a35700468c72 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_cast.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.expect index 58c69d9d94d1..3f6453f9900c 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(test) handleNoArguments(case) handleSend(x, case) handleNoType(final) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect index d4fcfb37e8c9..fbe35fd30512 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_if_case.dart.intertwined.expect @@ -61,11 +61,11 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) ensureCloseParen(y, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.expect index c9bf2aeb8427..6d99048aa11e 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect index a05368dd934a..aa192b4a3397 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_assert.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.expect index 9f5f3805405e..af7172d76c3c 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect index 87f032122d70..1ca4c9216c52 100644 --- a/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/final_variable_inside_null_check.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.expect index 62c4b0d8fc89..83bb0ea9b2cc 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(f) handleNoArguments(case) handleSend(x, case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleIdentifier(y, expression) handleNoTypeArguments(+) handleNoArguments(+) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect index 15615faf4053..de77693e6dfe 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_element.dart.intertwined.expect @@ -73,11 +73,11 @@ parseUnit(f) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.expect index 6b1a5897e495..a30027001491 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(f) handleNoArguments(case) handleSend(x, case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleIdentifier(y, expression) handleNoTypeArguments(+) handleNoArguments(+) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect index 2f39dadacf42..5a9709aa8da5 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideIfCaseWhenClause_statement.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(f) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect index 7f3c9157d6b1..7697b157e24e 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideListPattern.dart.intertwined.expect @@ -68,12 +68,12 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix({, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix({, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect index d09a90d89522..9861736fbe95 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideMapPattern.dart.intertwined.expect @@ -68,10 +68,10 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix({, isRefutableContext: true) + parseMapPatternSuffix({, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -82,8 +82,8 @@ parseUnit(f) parseSingleLiteralString({) listener: beginLiteralString('x') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect index 758e860bc1c6..8cb22dfea3e4 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideObjectPattern.dart.intertwined.expect @@ -68,14 +68,14 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(Foo, isRefutableContext: true) + parseObjectPatternRest(Foo, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(bar, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect index 233de1112286..9e70f6f8d803 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedConstPattern.dart.intertwined.expect @@ -68,8 +68,8 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect index 97b833b3f56a..7ee901e89508 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideParenthesizedPattern.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern({, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern({, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.expect index 2914ad83a385..839eefcb2018 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginSwitchExpression(switch) handleIdentifier(x, expression) handleNoTypeArguments()) @@ -35,7 +35,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralBool(true) handleNoTypeVariables(() beginFunctionExpression(() diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect index 4765fe3b4ea0..2370762435b7 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_guarded.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) @@ -105,11 +105,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.expect index 548946161cee..e75ae7da9f61 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginSwitchExpression(switch) handleIdentifier(x, expression) handleNoTypeArguments()) @@ -35,7 +35,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleNoTypeVariables(() beginFunctionExpression(() beginFormalParameters((, MemberKind.Local) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect index 83b6117dc499..d39675b172d9 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchExpressionCase_unguarded.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) @@ -105,11 +105,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.expect index 7bcdc50771cd..d20b829599f6 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.expect @@ -33,7 +33,7 @@ beginCompilationUnit(f) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleIdentifier(y, expression) handleNoTypeArguments(+) handleNoArguments(+) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect index 873bb8ae12ae..1c663d72689e 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_allowed_insideSwitchStatementInWhenClause.dart.intertwined.expect @@ -77,11 +77,11 @@ parseUnit(f) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.expect index a4e84249d68f..71d03d389622 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(f) beginSwitchExpressionCase() handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleListPattern(1, [, ]) beginParenthesizedExpressionOrRecordLiteral(() endRecordLiteral((, 0, null) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect index 4adb62d40929..cea5f987aea1 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterListPattern.dart.intertwined.expect @@ -68,15 +68,15 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix({, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix({, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) + parseVariablePattern([, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleListPattern(1, [, ]) parseExpression(when) looksLikeOuterPatternEquals(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.expect index 8107fc24d4ef..fbdfcf21a443 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(f) beginLiteralString('x') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleMapPatternEntry(:, }) handleMapPattern(1, {, }) beginParenthesizedExpressionOrRecordLiteral(() diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect index 45e47ddb8a2b..d3323d46ac54 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterMapPattern.dart.intertwined.expect @@ -68,10 +68,10 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix({, isRefutableContext: true) + parseMapPatternSuffix({, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -82,11 +82,11 @@ parseUnit(f) parseSingleLiteralString({) listener: beginLiteralString('x') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(1, {, }) parseExpression(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.expect index fb59b3fe4168..17a47ef5874c 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(f) handleNoTypeArguments(() handleIdentifier(bar, namedArgumentReference) handleNoType(:) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(Foo, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect index bbd787f8c3c4..362f39ba56ad 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterObjectPattern.dart.intertwined.expect @@ -68,17 +68,17 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(Foo, isRefutableContext: true) + parseObjectPatternRest(Foo, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(bar, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(Foo, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.expect index 3c7c5503037c..adb8c1114ade 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType(() - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleParenthesizedPattern(() beginParenthesizedExpressionOrRecordLiteral(() endRecordLiteral((, 0, null) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect index 089c75757927..70f50ec9d398 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterParenthesizedPattern.dart.intertwined.expect @@ -68,14 +68,14 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern({, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern({, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) + parseVariablePattern((, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureCloseParen(_, () listener: handleParenthesizedPattern(() parseExpression(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.expect index 3b0ac92e2744..d96cbce1b30b 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginSwitchExpression(switch) handleIdentifier(x, expression) handleNoTypeArguments()) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect index ca03d266690d..50d1a340ba39 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_afterSwitchExpressionInWhenClause.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.expect index 159847a6d27b..1b9122cbcf8a 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.expect @@ -32,7 +32,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleIdentifier(y, expression) handleNoTypeArguments(+) handleNoArguments(+) diff --git a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect index f8ea54fb337e..4c2f6bf258be 100644 --- a/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/functionExpression_disallowed_insideSwitchExpressionInWhenClause.dart.intertwined.expect @@ -78,11 +78,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect index 764a624a0e7d..b35c5c7de0ba 100644 --- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_case.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect index 77fbfe0de01f..03f2ce3f6dce 100644 --- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_cast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect index b1c0dde9de8e..ebf485220fee 100644 --- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect index e8178df22707..9684b99b1e22 100644 --- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_assert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect index aecb835ea72f..4fc7a7ca32c5 100644 --- a/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/integer_literal_inside_null_check.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/issue50591.dart.expect b/pkg/front_end/parser_testcases/patterns/issue50591.dart.expect index 96aa656d8774..616b7645d7e4 100644 --- a/pkg/front_end/parser_testcases/patterns/issue50591.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/issue50591.dart.expect @@ -39,7 +39,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleIdentifier(a, expression) handleNoTypeArguments(() beginArguments(() diff --git a/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect index e86e853c3cf5..c5b75b91a1ef 100644 --- a/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/issue50591.dart.intertwined.expect @@ -88,11 +88,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.expect b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.expect index abb05ede7bea..3753b96cba88 100644 --- a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.expect @@ -44,7 +44,7 @@ beginCompilationUnit(void) endSwitchExpressionCase(null, =>, 0) beginSwitchExpressionCase() handleNoType(,) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralInt(1) endSwitchExpressionCase(null, =>, 1) endSwitchExpressionBlock(2, {, }) diff --git a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect index fa4b2389ebc8..dfde1aaf55a5 100644 --- a/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/issue50591_example2.dart.intertwined.expect @@ -85,8 +85,8 @@ parseUnit(UnmatchedToken({)) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) @@ -114,11 +114,11 @@ parseUnit(UnmatchedToken({)) listener: handleLiteralInt(0) listener: endSwitchExpressionCase(null, =>, 0) listener: beginSwitchExpressionCase() - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) + parseVariablePattern(,, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.expect index 5a0299ce4884..0e83f251237a 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.expect @@ -23,9 +23,9 @@ beginCompilationUnit(void) handleType(int, null) endTypeArguments(1, <, >) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handleListPattern(2, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect index 370c1c3fd4c6..edc3cbe68581 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_typed_nonEmpty.dart.intertwined.expect @@ -46,24 +46,24 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseListPatternSuffix(>, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(>, PatternContext.assignment) + parsePattern([, PatternContext.assignment, precedence: 1) + parsePrimaryPattern([, PatternContext.assignment) + parseVariablePattern([, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + listener: handleVariablePattern(null, a, true) + parsePattern(,, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(,, PatternContext.assignment) + parseVariablePattern(,, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handleListPattern(2, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect index 765865e1705c..6e5150e76b1e 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_empty.dart.intertwined.expect @@ -46,10 +46,10 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleNoTypeArguments([]) - parseListPatternSuffix({, isRefutableContext: false) + parseListPatternSuffix({, PatternContext.assignment) rewriteSquareBrackets({) link([, ]) rewriter() diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect index 7f9f6070fedf..167ef33f1cf6 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_emptyWithWhitespace.dart.intertwined.expect @@ -46,10 +46,10 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleNoTypeArguments([) - parseListPatternSuffix({, isRefutableContext: false) + parseListPatternSuffix({, PatternContext.assignment) listener: handleListPattern(0, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.expect index 5aba75146a01..a00502906993 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.expect @@ -19,9 +19,9 @@ beginCompilationUnit(void) beginBlockFunctionBody({) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handleListPattern(2, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect index a32fef890809..130bfe6a3cbc 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideAssignment_untyped_nonEmpty.dart.intertwined.expect @@ -46,20 +46,20 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleNoTypeArguments([) - parseListPatternSuffix({, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix({, PatternContext.assignment) + parsePattern([, PatternContext.assignment, precedence: 1) + parsePrimaryPattern([, PatternContext.assignment) + parseVariablePattern([, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + listener: handleVariablePattern(null, a, true) + parsePattern(,, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(,, PatternContext.assignment) + parseVariablePattern(,, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handleListPattern(2, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.expect index bf8cf1dd371a..9cdca2a15c00 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.expect @@ -25,9 +25,9 @@ beginCompilationUnit(void) handleType(int, null) endTypeArguments(1, <, >) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handleListPattern(2, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect index 024b16bf5eef..e4b1685425dd 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_typed_nonEmpty.dart.intertwined.expect @@ -43,24 +43,24 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseListPatternSuffix(>, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(>, PatternContext.declaration) + parsePattern([, PatternContext.declaration, precedence: 1) + parsePrimaryPattern([, PatternContext.declaration) + parseVariablePattern([, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + listener: handleVariablePattern(null, a, false) + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handleListPattern(2, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect index e1441341af72..30f3472f4f31 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_empty.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments([]) - parseListPatternSuffix(var, isRefutableContext: false) + parseListPatternSuffix(var, PatternContext.declaration) rewriteSquareBrackets(var) link([, ]) rewriter() diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect index c07267a5834e..ddb8436138dc 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_emptyWithWhitespace.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments([) - parseListPatternSuffix(var, isRefutableContext: false) + parseListPatternSuffix(var, PatternContext.declaration) listener: handleListPattern(0, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.expect index deb1c8ae89c9..8de6776ce499 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.expect @@ -21,9 +21,9 @@ beginCompilationUnit(void) endMetadataStar(0) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handleListPattern(2, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect index c1cd2593d1c4..7f4fa2b806d5 100644 --- a/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect @@ -43,20 +43,20 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments([) - parseListPatternSuffix(var, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(var, PatternContext.declaration) + parsePattern([, PatternContext.declaration, precedence: 1) + parsePrimaryPattern([, PatternContext.declaration) + parseVariablePattern([, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + listener: handleVariablePattern(null, a, false) + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handleListPattern(2, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect index 9bee1bd7d1f9..21e2fe938607 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case.dart.intertwined.expect @@ -69,20 +69,20 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) parseLiteralInt([) listener: handleLiteralInt(1) listener: handleConstantPattern(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect index a64a4de11650..d4972bc8e039 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([]) - parseListPatternSuffix(case, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) rewriteSquareBrackets(case) link([, ]) rewriter() diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect index 328818bff0e0..b581b40d159b 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_empty_whitespace.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) listener: handleListPattern(0, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect index ef3375b0336a..6778fca5e5f3 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_case_with_type_arguments.dart.intertwined.expect @@ -69,24 +69,24 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseListPatternSuffix(>, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(>, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) parseLiteralInt([) listener: handleLiteralInt(1) listener: handleConstantPattern(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect index a5ffa1ec3a13..1944f7a3d47c 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_cast.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect index 2baba3ea9cc9..89df1966c4b3 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_assert.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect index 0fbbdd9ee5a2..ede71b081b68 100644 --- a/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/list_pattern_inside_null_check.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.expect index a443956a9b35..6c81437ff0dd 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.expect @@ -27,12 +27,12 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(&&) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) handleParenthesizedCondition((, case, null) beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect index 1c7456790ff2..7f54f3e9383a 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_if_case.dart.intertwined.expect @@ -61,21 +61,21 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.expect index e37b8ce79f3c..aaa22b607584 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.expect @@ -30,18 +30,18 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(&&) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) beginBinaryPattern(&&) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect index 71b1314df531..cc0ed4e97b00 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_and_lhs.dart.intertwined.expect @@ -69,30 +69,30 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) ensureColon(_) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.expect index a0d09fd7cb42..da67e08becc4 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.expect @@ -30,18 +30,18 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(&&) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) beginBinaryPattern(||) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(||) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect index 3fd44608fa46..de424ac0ec9f 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_lhs.dart.intertwined.expect @@ -69,30 +69,30 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(||) ensureColon(_) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.expect index 62b3b2a7fa5d..ea6cae19ad98 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.expect @@ -30,17 +30,17 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(||) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(&&) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(&&) endBinaryPattern(||) endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect index 0c70eaf05db8..1d9d713b6aa3 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_and_inside_logical_or_rhs.dart.intertwined.expect @@ -69,29 +69,29 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleNullableType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(&&) listener: endBinaryPattern(||) ensureColon(_) diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.expect index bee0cb6904a1..50919db71b4f 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.expect @@ -27,12 +27,12 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(||) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(||) handleParenthesizedCondition((, case, null) beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect index 270f6aff3fc3..90a7bfb089cc 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_if_case.dart.intertwined.expect @@ -61,21 +61,21 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(||) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.expect index 585ccbdc897a..7de3cead59c0 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.expect @@ -30,18 +30,18 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(?) handleType(int, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginBinaryPattern(||) handleIdentifier(double, typeReference) handleNoTypeArguments(?) handleType(double, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(||) beginBinaryPattern(||) handleIdentifier(Object, typeReference) handleNoTypeArguments(?) handleType(Object, ?) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endBinaryPattern(||) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect index 5f60873b1664..bf48544f4337 100644 --- a/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/logical_or_inside_logical_or_lhs.dart.intertwined.expect @@ -69,30 +69,30 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(||) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleNullableType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) listener: handleType(Object, ?) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: endBinaryPattern(||) ensureColon(_) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.expect index ba77159e0ed2..0bbb0aa01b91 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.expect @@ -28,12 +28,12 @@ beginCompilationUnit(void) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleMapPatternEntry(:, ,) beginLiteralString('b') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handleMapPatternEntry(:, }) handleMapPattern(2, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect index 0cc0b7ba41a4..2258fb0b02af 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_typed_nonEmpty.dart.intertwined.expect @@ -46,8 +46,8 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: beginTypeArguments(<) listener: handleIdentifier(String, typeReference) listener: handleNoTypeArguments(,) @@ -56,7 +56,7 @@ parseUnit(void) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(2, <, >) - parseMapPatternSuffix(>, isRefutableContext: false) + parseMapPatternSuffix(>, PatternContext.assignment) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -67,11 +67,11 @@ parseUnit(void) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) listener: handleMapPatternEntry(:, ,) parseExpression(,) looksLikeOuterPatternEquals(,) @@ -83,11 +83,11 @@ parseUnit(void) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(2, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect index aa5a74b1707a..537011cf1dbe 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty.dart.intertwined.expect @@ -55,10 +55,10 @@ parseUnit(void) looksLikeOuterPatternEquals(() skipOuterPattern(() parsePatternAssignment(() - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) + parsePattern((, PatternContext.assignment, precedence: 1) + parsePrimaryPattern((, PatternContext.assignment) listener: handleNoTypeArguments({) - parseMapPatternSuffix((, isRefutableContext: false) + parseMapPatternSuffix((, PatternContext.assignment) listener: handleMapPattern(0, {, }) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect index 46b43dbe507d..be77126449e5 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_empty_beginningOfStatement.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleNoTypeArguments({) - parseMapPatternSuffix({, isRefutableContext: false) + parseMapPatternSuffix({, PatternContext.assignment) listener: handleMapPattern(0, {, }) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.expect index c20886b2d4f9..4ece6138478d 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.expect @@ -22,12 +22,12 @@ beginCompilationUnit(void) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleMapPatternEntry(:, ,) beginLiteralString('b') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handleMapPatternEntry(:, }) handleMapPattern(2, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect index 85484c9b6c34..cf8b2e0867e3 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty.dart.intertwined.expect @@ -55,10 +55,10 @@ parseUnit(void) looksLikeOuterPatternEquals(() skipOuterPattern(() parsePatternAssignment(() - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) + parsePattern((, PatternContext.assignment, precedence: 1) + parsePrimaryPattern((, PatternContext.assignment) listener: handleNoTypeArguments({) - parseMapPatternSuffix((, isRefutableContext: false) + parseMapPatternSuffix((, PatternContext.assignment) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -69,11 +69,11 @@ parseUnit(void) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) listener: handleMapPatternEntry(:, ,) parseExpression(,) looksLikeOuterPatternEquals(,) @@ -85,11 +85,11 @@ parseUnit(void) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(2, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.expect index 1d37e828d2a9..80d63fd58e3a 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.expect @@ -21,12 +21,12 @@ beginCompilationUnit(void) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleMapPatternEntry(:, ,) beginLiteralString('b') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handleMapPatternEntry(:, }) handleMapPattern(2, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect index 3337095c2396..fbe6ce6aa362 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideAssignment_untyped_nonEmpty_beginningOfStatement.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleNoTypeArguments({) - parseMapPatternSuffix({, isRefutableContext: false) + parseMapPatternSuffix({, PatternContext.assignment) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -57,11 +57,11 @@ parseUnit(void) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) listener: handleMapPatternEntry(:, ,) parseExpression(,) looksLikeOuterPatternEquals(,) @@ -73,11 +73,11 @@ parseUnit(void) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(:, PatternContext.assignment) + parseVariablePattern(:, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(2, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.expect index b839413b128c..1efd19a014b8 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.expect @@ -30,12 +30,12 @@ beginCompilationUnit(void) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleMapPatternEntry(:, ,) beginLiteralString('b') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handleMapPatternEntry(:, }) handleMapPattern(2, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect index 4d7cb65ff535..473cc3d97d82 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_typed_nonEmpty.dart.intertwined.expect @@ -43,8 +43,8 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: beginTypeArguments(<) listener: handleIdentifier(String, typeReference) listener: handleNoTypeArguments(,) @@ -53,7 +53,7 @@ parseUnit(void) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(2, <, >) - parseMapPatternSuffix(>, isRefutableContext: false) + parseMapPatternSuffix(>, PatternContext.declaration) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -64,11 +64,11 @@ parseUnit(void) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleMapPatternEntry(:, ,) parseExpression(,) looksLikeOuterPatternEquals(,) @@ -80,11 +80,11 @@ parseUnit(void) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(2, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect index 50f397971b50..8877636a0ed8 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_empty.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments({) - parseMapPatternSuffix(var, isRefutableContext: false) + parseMapPatternSuffix(var, PatternContext.declaration) listener: handleMapPattern(0, {, }) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.expect index 4f4108890c84..bdb2c588788c 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.expect @@ -23,12 +23,12 @@ beginCompilationUnit(void) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleMapPatternEntry(:, ,) beginLiteralString('b') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handleMapPatternEntry(:, }) handleMapPattern(2, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect index de604f2d51b2..b19d2bc7bdd7 100644 --- a/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_insideDeclaration_untyped_nonEmpty.dart.intertwined.expect @@ -43,10 +43,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments({) - parseMapPatternSuffix(var, isRefutableContext: false) + parseMapPatternSuffix(var, PatternContext.declaration) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -57,11 +57,11 @@ parseUnit(void) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleMapPatternEntry(:, ,) parseExpression(,) looksLikeOuterPatternEquals(,) @@ -73,11 +73,11 @@ parseUnit(void) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(2, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect index 4d288c178458..3635047c5193 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -102,8 +102,8 @@ parseUnit(test) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect index 4fe01028442b..4178f511f3f0 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_empty.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) listener: handleMapPattern(0, {, }) ensureColon(}) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect index cbf3d1a568e3..a140d56502e4 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_case_with_type_arguments.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(String, typeReference) listener: handleNoTypeArguments(,) @@ -79,7 +79,7 @@ parseUnit(test) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(2, <, >) - parseMapPatternSuffix(>, isRefutableContext: true) + parseMapPatternSuffix(>, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -90,8 +90,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -109,8 +109,8 @@ parseUnit(test) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect index ea06d8b2398e..a2632c7cebf5 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_cast.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect index 5f2a2cdf1c02..177c91234236 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_assert.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect index a4defa854f37..47c348982cb5 100644 --- a/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/map_pattern_inside_null_check.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect index 8eb976cc0057..0edd0ab93aae 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_case.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect index 285cc521c404..7f82ff448f79 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.expect index 3e7390432c82..bf9caa7f249e 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.expect @@ -56,7 +56,7 @@ beginCompilationUnit(class) handleNoTypeArguments(() handleNoName(() handleNoType(var) - handleVariablePattern(var, f) + handleVariablePattern(var, f, false) handleNullAssertPattern(!) handlePatternField(:) handleObjectPatternFields(1, (, )) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect index 4ed032befc8e..4aaea540f136 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_extractor_pattern_implicitly_named.dart.intertwined.expect @@ -113,16 +113,16 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, f) + listener: handleVariablePattern(var, f, false) listener: handleNullAssertPattern(!) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.expect index b2d7bdb941f1..50e9e053cd9e 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(test) handleNoArguments(case) handleSend(x, case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleNullAssertPattern(!) handleParenthesizedCondition((, case, null) beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect index e16d3404f753..d94627849fec 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_if_case.dart.intertwined.expect @@ -61,11 +61,11 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleNullAssertPattern(!) ensureCloseParen(!, () listener: handleParenthesizedCondition((, case, null) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect index 0247763ccdf2..a94e34b83792 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_list_pattern.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect index 90ecf8f6df1d..a7426cc69588 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect index da8754e44e15..283fedf3148d 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_and_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect index 76c0a53c761c..c01c1a8d4360 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect index e5037f4e2fe2..38a236e1bd9a 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_logical_or_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect index d125efa93906..b863dd4656aa 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_map_pattern.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect index 8f344ec631c4..b0619fa6c2f8 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_parenthesized_pattern.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.expect index e5eb56e559a5..f9147dbd9b5b 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.expect @@ -29,7 +29,7 @@ beginCompilationUnit(test) beginCaseExpression(case) handleNoName(() handleNoType(var) - handleVariablePattern(var, n) + handleVariablePattern(var, n, false) handleNullAssertPattern(!) handlePatternField(:) handleLiteralInt(2) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect index fb30f4f5c87c..808aa29c16cb 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_implicitly_named.dart.intertwined.expect @@ -69,19 +69,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, n) + listener: handleVariablePattern(var, n, false) listener: handleNullAssertPattern(!) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect index 65e5bce73277..24214fc55fa0 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_named.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -84,8 +84,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect index af803695bee9..8d8f1243bdfd 100644 --- a/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_assert_inside_record_pattern_unnamed.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -82,8 +82,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect index e6eb3942ed0e..37406ac02221 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_case.dart.intertwined.expect @@ -98,8 +98,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect index 6047b927812e..43584a93f873 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.expect index 91fc022e13dc..f70fe792be2f 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.expect @@ -56,7 +56,7 @@ beginCompilationUnit(class) handleNoTypeArguments(() handleNoName(() handleNoType(var) - handleVariablePattern(var, f) + handleVariablePattern(var, f, false) handleNullCheckPattern(?) handlePatternField(:) handleObjectPatternFields(1, (, )) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect index 742ccec2f58a..7ff83df33b92 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_extractor_pattern_implicitly_named.dart.intertwined.expect @@ -113,16 +113,16 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, f) + listener: handleVariablePattern(var, f, false) listener: handleNullCheckPattern(?) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.expect index 00e9683fa347..f3fa1940c476 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(test) handleNoArguments(case) handleSend(x, case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleNullCheckPattern(?) handleParenthesizedCondition((, case, null) beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect index f28e4e914dad..c7d077b499bf 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_if_case.dart.intertwined.expect @@ -61,11 +61,11 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleNullCheckPattern(?) ensureCloseParen(?, () listener: handleParenthesizedCondition((, case, null) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect index 9ad5e5f69d47..6cb1fe2b2ea5 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_list_pattern.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression([, 17, false) parseUnaryExpression([, false) parsePrimary([, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect index 628460ea9990..002765db5609 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect index ce7fa20ae55b..6f85c7ca9238 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_and_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect index ee4de62f6b89..5a3d2d31b296 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect index c171ba957cb5..88b40c143c79 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_logical_or_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect index ee5071bd90c7..f76bdb139657 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_map_pattern.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect index e68c63b27610..8917aca1fe48 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_parenthesized_pattern.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.expect index 675b06e202e5..debfad2273f1 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.expect @@ -29,7 +29,7 @@ beginCompilationUnit(test) beginCaseExpression(case) handleNoName(() handleNoType(var) - handleVariablePattern(var, n) + handleVariablePattern(var, n, false) handleNullCheckPattern(?) handlePatternField(:) handleLiteralInt(2) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect index a967b683317b..0cc84b3bf6aa 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_implicitly_named.dart.intertwined.expect @@ -69,19 +69,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, n) + listener: handleVariablePattern(var, n, false) listener: handleNullCheckPattern(?) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect index f2c778e91713..29d6e35f4291 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_named.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(:, 17, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -84,8 +84,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect index 94fa2883330b..deb6809c6e14 100644 --- a/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_check_inside_record_pattern_unnamed.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -82,8 +82,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect index fb69cf4a1a46..0b112a6c25cb 100644 --- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_case.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect index a15d7dab21a8..b469529103ef 100644 --- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_cast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect index ae737f3296f7..5f4ef70cfa1b 100644 --- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect index fc60c6b80a8a..1ccabe5a2e4e 100644 --- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_assert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect index a9f117e54fda..5fe7a47e4cff 100644 --- a/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/null_literal_inside_null_check.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect index 1234770a9d6f..a05efc1ed981 100644 --- a/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_prefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect @@ -44,10 +44,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(Future, isRefutableContext: false) + parseObjectPatternRest(Future, PatternContext.declaration) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, ., Future) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect index 8171b605e141..e84eae557aea 100644 --- a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideAssignment.dart.intertwined.expect @@ -47,14 +47,14 @@ parseUnit(void) skipOuterPattern({) skipObjectPatternRest(Future) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: false) + parseObjectPatternRest(>, PatternContext.assignment) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect index e5d58eebf35d..9a0854c8bd45 100644 --- a/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_prefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect @@ -44,14 +44,14 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: false) + parseObjectPatternRest(>, PatternContext.declaration) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect index 430f2d7ba120..8e56a96855d4 100644 --- a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withTypeArgs_insideDeclaration.dart.intertwined.expect @@ -44,14 +44,14 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: false) + parseObjectPatternRest(>, PatternContext.declaration) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, null, null) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect index 838068888644..5be4c38deb3e 100644 --- a/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_unprefixedNamedUnderscore_withoutTypeArgs_insideDeclaration.dart.intertwined.expect @@ -44,10 +44,10 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(_, isRefutableContext: false) + parseObjectPatternRest(_, PatternContext.declaration) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(_, null, null) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect index a7b9b5ea9443..505a32f4e117 100644 --- a/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/object_unprefixed_withTypeArgs_insideDeclaration.dart.intertwined.expect @@ -79,14 +79,14 @@ parseUnit(class) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: false) + parseObjectPatternRest(>, PatternContext.declaration) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(C, null, null) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.expect index 99e8f880f43a..e65a41e94a30 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.expect @@ -18,7 +18,7 @@ beginCompilationUnit(f) handleAsyncModifier(null, null) beginBlockFunctionBody({) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handleParenthesizedPattern(() handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect index ab37f5d68d0a..ecba9591b1df 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideAssignment.dart.intertwined.expect @@ -47,14 +47,14 @@ parseUnit(f) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern({, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) + parseParenthesizedPatternOrRecordPattern({, PatternContext.assignment) + parsePattern((, PatternContext.assignment, precedence: 1) + parsePrimaryPattern((, PatternContext.assignment) + parseVariablePattern((, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) ensureCloseParen(a, () listener: handleParenthesizedPattern(() parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect index 6bd438b3c2f2..8797a4467772 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideCase.dart.intertwined.expect @@ -67,11 +67,11 @@ parseUnit(f) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.expect index 94335142e48b..ddbadb4314de 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(f) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleParenthesizedPattern(() handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect index 005421f747f1..a95645f11aab 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_insideDeclaration.dart.intertwined.expect @@ -44,14 +44,14 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) ensureCloseParen(a, () listener: handleParenthesizedPattern(() parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect index cffc2cf31ecc..129eacb8cd6e 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_cast.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect index 4b3656f9ca38..52cbc7f8292f 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_assert.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect index 5af2d8300b14..ad2f8165db74 100644 --- a/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/parenthesized_pattern_inside_null_check.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.expect index 68e1e4d0ae1e..e60b59eccc8c 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.expect @@ -22,7 +22,7 @@ beginCompilationUnit(f) handleNoTypeArguments(() handleIdentifier(f, namedArgumentReference) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect index 9fbb6809a1c2..f73b7b070a69 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_final_extractor.dart.intertwined.expect @@ -45,17 +45,17 @@ parseUnit(f) listener: beginMetadataStar(final) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: false) + parseObjectPatternRest(C, PatternContext.declaration) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.expect index f1cb460ff67f..d76039705fa8 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.expect @@ -22,7 +22,7 @@ beginCompilationUnit(f) handleNoTypeArguments(() handleIdentifier(f, namedArgumentReference) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect index 343b018ba417..aadc95465cba 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_extractor.dart.intertwined.expect @@ -45,17 +45,17 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: false) + parseObjectPatternRest(C, PatternContext.declaration) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.expect index 0e70c97d2b2c..5dfe3761a0ca 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.expect @@ -21,7 +21,7 @@ beginCompilationUnit(f) endMetadataStar(0) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleListPattern(1, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect index 935ec123db3a..b11d0befc85f 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_list.dart.intertwined.expect @@ -44,15 +44,15 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments([) - parseListPatternSuffix(var, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(var, PatternContext.declaration) + parsePattern([, PatternContext.declaration, precedence: 1) + parsePrimaryPattern([, PatternContext.declaration) + parseVariablePattern([, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleListPattern(1, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.expect index 46117ad4b415..b1d68da789b0 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.expect @@ -23,7 +23,7 @@ beginCompilationUnit(f) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleMapPatternEntry(:, }) handleMapPattern(1, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect index efbc9f3e0197..584da9d6970e 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_map.dart.intertwined.expect @@ -44,10 +44,10 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments({) - parseMapPatternSuffix(var, isRefutableContext: false) + parseMapPatternSuffix(var, PatternContext.declaration) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -58,11 +58,11 @@ parseUnit(f) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(1, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.expect index 94335142e48b..ddbadb4314de 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(f) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleParenthesizedPattern(() handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect index 005421f747f1..a95645f11aab 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_parenthesized.dart.intertwined.expect @@ -44,14 +44,14 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) ensureCloseParen(a, () listener: handleParenthesizedPattern(() parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.expect index 1a8c47a64569..73a7d538e263 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(f) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleRecordPattern((, 1) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect index e79dabed404e..5bf00806ab61 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_noMetadata_var_record.dart.intertwined.expect @@ -44,14 +44,14 @@ parseUnit(f) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) ensureCloseParen(,, () listener: handleRecordPattern((, 1) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.expect index fa819b750f1f..5c3a57c791a0 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(f) handleNoTypeArguments(() handleIdentifier(f, namedArgumentReference) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect index 38c8c17f31f1..c2f1ffa835cd 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_extractor.dart.intertwined.expect @@ -56,17 +56,17 @@ parseUnit(f) skipOuterPattern(final) skipObjectPatternRest(C) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: false) + parseObjectPatternRest(C, PatternContext.declaration) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.expect index c223f8a16343..3a515f4b4c32 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(f) endMetadataStar(1) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleListPattern(1, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect index bdf621ff1db3..4a4505022834 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_list.dart.intertwined.expect @@ -55,15 +55,15 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null) skipOuterPattern(final) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) listener: handleNoTypeArguments([) - parseListPatternSuffix(final, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(final, PatternContext.declaration) + parsePattern([, PatternContext.declaration, precedence: 1) + parsePrimaryPattern([, PatternContext.declaration) + parseVariablePattern([, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleListPattern(1, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.expect index e2a2e95945e0..0eb9ae97f040 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(f) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleMapPatternEntry(:, }) handleMapPattern(1, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect index abc339ed19bd..63dea9f4ecef 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_map.dart.intertwined.expect @@ -55,10 +55,10 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null) skipOuterPattern(final) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) listener: handleNoTypeArguments({) - parseMapPatternSuffix(final, isRefutableContext: false) + parseMapPatternSuffix(final, PatternContext.declaration) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -69,11 +69,11 @@ parseUnit(f) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(1, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.expect index 289c8d2b18ac..51c741737d14 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) endMetadata(@, null, final) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleParenthesizedPattern(() handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect index e8de68b97a64..b31dea6d0867 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_parenthesized.dart.intertwined.expect @@ -55,14 +55,14 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null) skipOuterPattern(final) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(final, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(final, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) ensureCloseParen(a, () listener: handleParenthesizedPattern(() parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.expect index beab5127ed07..0b64c138ea57 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) endMetadata(@, null, final) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleRecordPattern((, 1) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect index b3db92dce8b6..f0d647b927dc 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_final_record.dart.intertwined.expect @@ -55,14 +55,14 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(final, {, null, final, null, null) skipOuterPattern(final) parsePatternVariableDeclarationStatement(final, {, final) - parsePattern(final, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(final, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(final, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(final, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(final, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(final, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) ensureCloseParen(,, () listener: handleRecordPattern((, 1) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.expect index eb25e2436e39..63859cfb95ab 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(f) handleNoTypeArguments(() handleIdentifier(f, namedArgumentReference) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect index b425558ea36d..537eefc38e0c 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_extractor.dart.intertwined.expect @@ -56,17 +56,17 @@ parseUnit(f) skipOuterPattern(var) skipObjectPatternRest(C) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: false) + parseObjectPatternRest(C, PatternContext.declaration) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.expect index 9863e06de44f..89abea16631f 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(f) endMetadataStar(1) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleListPattern(1, [, ]) handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect index 6884531ed721..b3babc655b88 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_list.dart.intertwined.expect @@ -55,15 +55,15 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null) skipOuterPattern(var) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments([) - parseListPatternSuffix(var, isRefutableContext: false) - parsePattern([, precedence: 1, isRefutableContext: false) - parsePrimaryPattern([, isRefutableContext: false) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(var, PatternContext.declaration) + parsePattern([, PatternContext.declaration, precedence: 1) + parsePrimaryPattern([, PatternContext.declaration) + parseVariablePattern([, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleListPattern(1, [, ]) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.expect index a5e4077a305d..5698def67a22 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(f) beginLiteralString('a') endLiteralString(0, :) handleNoType(:) - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleMapPatternEntry(:, }) handleMapPattern(1, {, }) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect index aa22f1206192..4f9dbfa43b9a 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_map.dart.intertwined.expect @@ -55,10 +55,10 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null) skipOuterPattern(var) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleNoTypeArguments({) - parseMapPatternSuffix(var, isRefutableContext: false) + parseMapPatternSuffix(var, PatternContext.declaration) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -69,11 +69,11 @@ parseUnit(f) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(:, isRefutableContext: false) - parseVariablePattern(:, typeInfo: Instance of 'NoType') + parsePattern(:, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(:, PatternContext.declaration) + parseVariablePattern(:, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(:) - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(1, {, }) parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.expect index 3f694a5b6d50..f2ab180bbc58 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) endMetadata(@, null, var) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handleParenthesizedPattern(() handleIdentifier(x, expression) handleNoTypeArguments(;) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect index 5a2aa1cfb06a..3e51e3350b7a 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_parenthesized.dart.intertwined.expect @@ -55,14 +55,14 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null) skipOuterPattern(var) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) ensureCloseParen(a, () listener: handleParenthesizedPattern(() parseExpression(=) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.expect index 58b0912d2613..bf48b06aa9c9 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) endMetadata(@, null, var) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleRecordPattern((, 1) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect index 64161f0bd7c7..34152dcbbe58 100644 --- a/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/patternVariableDeclarationStatement_withMetadata_var_record.dart.intertwined.expect @@ -55,14 +55,14 @@ parseUnit(f) parseExpressionStatementOrDeclarationAfterModifiers(var, {, null, var, null, null) skipOuterPattern(var) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) ensureCloseParen(,, () listener: handleRecordPattern((, 1) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.expect index cf7b5c5ad79e..dce7a8f648c0 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.expect @@ -21,10 +21,10 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) beginForInExpression(x) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect index 50e3bc5440c4..e469acf155f0 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element.dart.intertwined.expect @@ -50,20 +50,20 @@ parseUnit(void) skipOuterPattern(var) listener: beginMetadataStar(var) listener: endMetadataStar(0) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.expect index d24ff18a9b16..b16e31c747be 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.expect @@ -26,10 +26,10 @@ beginCompilationUnit(void) endMetadata(@, null, var) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) beginForInExpression(x) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect index 11933762a0ae..96d9a603e290 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_element_withMetadata.dart.intertwined.expect @@ -60,20 +60,20 @@ parseUnit(void) listener: endMetadataStar(1) parseExpressionStatementOrDeclarationAfterModifiers(var, (, null, var, null, ForPartsContext(null)) skipOuterPattern(var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.expect index 9d6ceb6a3e13..988d2c35ab7f 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.expect @@ -21,10 +21,10 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) beginForInExpression(x) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect index d183f13910fc..120e29a4d364 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement.dart.intertwined.expect @@ -46,20 +46,20 @@ parseUnit(void) skipOuterPattern(var) listener: beginMetadataStar(var) listener: endMetadataStar(0) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.expect index d5e68a37f44a..e89cc6386b78 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.expect @@ -26,10 +26,10 @@ beginCompilationUnit(void) endMetadata(@, null, var) endMetadataStar(1) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) beginForInExpression(x) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect index 8a4314bd248d..d715215e5ad2 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForIn_statement_withMetadata.dart.intertwined.expect @@ -56,20 +56,20 @@ parseUnit(void) listener: endMetadataStar(1) parseExpressionStatementOrDeclarationAfterModifiers(var, (, null, var, null, ForPartsContext(null)) skipOuterPattern(var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.expect index 0617d4ad9ba4..bf4dbda9034e 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.expect @@ -21,10 +21,10 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect index bc80dba7b6eb..d4b0d3a16d6a 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_element.dart.intertwined.expect @@ -50,20 +50,20 @@ parseUnit(void) skipOuterPattern(var) listener: beginMetadataStar(var) listener: endMetadataStar(0) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.expect index 1ec7d1d35473..026d10335a84 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.expect @@ -21,10 +21,10 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect index c6de210fc284..8d6ad05468d7 100644 --- a/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/pattern_inForInitializer_statement.dart.intertwined.expect @@ -46,20 +46,20 @@ parseUnit(void) skipOuterPattern(var) listener: beginMetadataStar(var) listener: endMetadataStar(0) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect index 551f0e33f19a..89925efb704b 100644 --- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args.dart.intertwined.expect @@ -94,14 +94,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect index 3dbbf7afc42d..f51f6de5d9bb 100644 --- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_cast.dart.intertwined.expect @@ -94,14 +94,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) listener: beginAsOperatorType(as) diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect index f6e508992b1e..14a3d60cc054 100644 --- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_assert.dart.intertwined.expect @@ -94,14 +94,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) listener: handleNullAssertPattern(!) diff --git a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect index e8cddcc37732..38506f8b4f57 100644 --- a/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/prefixed_extractor_pattern_with_type_args_inside_null_check.dart.intertwined.expect @@ -94,14 +94,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseObjectPatternRest(>, isRefutableContext: true) + parseObjectPatternRest(>, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(async, ., Future) listener: handleNullCheckPattern(?) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect index 48b00102d2ce..7d5d6793a8e4 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_empty.dart.intertwined.expect @@ -46,8 +46,8 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) listener: handleRecordPattern((, 0) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.expect index be279f6619be..bb4b783a4fb8 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.expect @@ -18,7 +18,7 @@ beginCompilationUnit(void) handleAsyncModifier(null, null) beginBlockFunctionBody({) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handlePatternField(null) handleRecordPattern((, 1) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect index e81e57a1740c..203d542fd07c 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_oneField.dart.intertwined.expect @@ -46,14 +46,14 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern({, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) + parseParenthesizedPatternOrRecordPattern({, PatternContext.assignment) + parsePattern((, PatternContext.assignment, precedence: 1) + parsePrimaryPattern((, PatternContext.assignment) + parseVariablePattern((, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) listener: handlePatternField(null) ensureCloseParen(,, () listener: handleRecordPattern((, 1) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.expect index b095b19b1ebb..f2d965d230ec 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.expect @@ -18,10 +18,10 @@ beginCompilationUnit(void) handleAsyncModifier(null, null) beginBlockFunctionBody({) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, true) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, true) handlePatternField(null) handleRecordPattern((, 2) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect index f47a51b6ce05..2a87ab41d01c 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideAssignment_twoFields.dart.intertwined.expect @@ -46,20 +46,20 @@ parseUnit(void) looksLikeOuterPatternEquals({) skipOuterPattern({) parsePatternAssignment({) - parsePattern({, precedence: 1, isRefutableContext: false) - parsePrimaryPattern({, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern({, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.assignment, precedence: 1) + parsePrimaryPattern({, PatternContext.assignment) + parseParenthesizedPatternOrRecordPattern({, PatternContext.assignment) + parsePattern((, PatternContext.assignment, precedence: 1) + parsePrimaryPattern((, PatternContext.assignment) + parseVariablePattern((, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, true) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.assignment, precedence: 1) + parsePrimaryPattern(,, PatternContext.assignment) + parseVariablePattern(,, PatternContext.assignment, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, true) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect index 8dbab78327d0..a3ce115a780c 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_empty.dart.intertwined.expect @@ -43,8 +43,8 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) listener: handleRecordPattern((, 0) parseExpression(=) looksLikeOuterPatternEquals(=) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.expect index 703a2ce09578..9abd8483b9b0 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleRecordPattern((, 1) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect index d819fd59c698..e92604b88d36 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_oneField.dart.intertwined.expect @@ -43,14 +43,14 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) ensureCloseParen(,, () listener: handleRecordPattern((, 1) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.expect index 3a8bcc8503e5..979daccb9323 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.expect @@ -20,10 +20,10 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, a) + handleVariablePattern(null, a, false) handlePatternField(null) handleNoType(,) - handleVariablePattern(null, b) + handleVariablePattern(null, b, false) handlePatternField(null) handleRecordPattern((, 2) handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect index 05ff7af8156b..0e8675c3c7f0 100644 --- a/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_insideDeclaration_twoFields.dart.intertwined.expect @@ -43,20 +43,20 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, a) + listener: handleVariablePattern(null, a, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(,, isRefutableContext: false) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(,, PatternContext.declaration) + parseVariablePattern(,, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, b) + listener: handleVariablePattern(null, b, false) listener: handlePatternField(null) ensureCloseParen(b, () listener: handleRecordPattern((, 2) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect index de50760767ab..c6c3abfa0259 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect index cdcb8ff0ad1e..3bfec97e2d70 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_empty.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleRecordPattern((, 0) ensureColon()) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect index b0f156f68cf2..8cdd2f8f4003 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_case_singleton.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect index a4805ec3d079..690bdef63969 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_cast.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect index 829ec4a2ca93..d1221f259c58 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_assert.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect index 7f54fadc4962..2b5e21ccfba1 100644 --- a/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/record_pattern_inside_null_check.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression((, 17, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect index cb8463823c51..3002c0208771 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_equal.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect index 7cf536afb993..8f4d7bfcf28f 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(>, 12, false) parseUnaryExpression(>, false) parsePrimary(>, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect index cbbc975b7b4a..68631b09e7c1 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_greater_than_or_equal.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(>=, 12, false) parseUnaryExpression(>=, false) parsePrimary(>=, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect index 1628e7572533..83a89f5c4d12 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(<, 12, false) parseUnaryExpression(<, false) parsePrimary(<, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect index 8d31a4db8bd5..e3da00c36d70 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_less_than_or_equal.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(<=, 12, false) parseUnaryExpression(<=, false) parsePrimary(<=, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect index 735f72be1459..0a45d3b6155c 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_case_not_equal.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(!=, 12, false) parseUnaryExpression(!=, false) parsePrimary(!=, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect index db803df1848e..381db964cd8a 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_extractor_pattern.dart.intertwined.expect @@ -113,14 +113,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect index d816943d6264..b390bacbcac3 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect index 5f599d5a5269..76412b1b5c91 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_list_pattern.dart.intertwined.expect @@ -69,12 +69,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect index 9dd028200bbb..bfe462b27a52 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect index 627c28e9ddca..9f3bafc13e12 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_and_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect index 640530e9cca9..32073fb63dea 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_lhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect index 029c43af5d12..3423655cb5ab 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_logical_or_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect index e0f887a93b2e..f6b19d45d037 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_map_pattern.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,8 +83,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect index 9cf1de72255b..485d5e2ff93f 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_parenthesized_pattern.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect index 0f7f8ab68be2..8e1307a7c3d9 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_named.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -83,8 +83,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect index 4c864e0550e0..2fcd4398fe19 100644 --- a/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/relational_inside_record_pattern_unnamed.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.expect b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.expect index defb798cb0a9..0cfb59de57f9 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.expect @@ -140,14 +140,14 @@ beginCompilationUnit(void) beginCaseExpression(case) handleNoTypeArguments([) handleNoType(var) - handleVariablePattern(var, x) + handleVariablePattern(var, x, false) handleRestPattern(..., true) handleListPattern(1, [, ]) endCaseExpression(case, null, :) beginCaseExpression(case) handleNoTypeArguments([) handleNoType(final) - handleVariablePattern(final, x) + handleVariablePattern(final, x, false) handleRestPattern(..., true) handleListPattern(1, [, ]) endCaseExpression(case, null, :) @@ -156,21 +156,21 @@ beginCompilationUnit(void) handleIdentifier(List, typeReference) handleNoTypeArguments(x) handleType(List, null) - handleVariablePattern(null, x) + handleVariablePattern(null, x, false) handleRestPattern(..., true) handleListPattern(1, [, ]) endCaseExpression(case, null, :) beginCaseExpression(case) handleNoTypeArguments([) handleNoType(...) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleRestPattern(..., true) handleListPattern(1, [, ]) endCaseExpression(case, null, :) beginCaseExpression(case) handleNoTypeArguments([) handleNoType(() - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleParenthesizedPattern(() handleRestPattern(..., true) handleListPattern(1, [, ]) @@ -179,7 +179,7 @@ beginCompilationUnit(void) handleNoTypeArguments([) handleNoTypeArguments([) handleNoType([) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleListPattern(1, [, ]) handleRestPattern(..., true) handleListPattern(1, [, ]) diff --git a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect index fd443298df2c..314939f6db78 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_subpatternStartingTokens.dart.intertwined.expect @@ -66,12 +66,12 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(==, 12, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -84,12 +84,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(!=, 12, false) parseUnaryExpression(!=, false) parsePrimary(!=, expression) @@ -102,12 +102,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(<, 12, false) parseUnaryExpression(<, false) parsePrimary(<, expression) @@ -120,12 +120,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(>, 12, false) parseUnaryExpression(>, false) parsePrimary(>, expression) @@ -138,12 +138,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(<=, 12, false) parseUnaryExpression(<=, false) parsePrimary(<=, expression) @@ -156,12 +156,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(>=, 12, false) parseUnaryExpression(>=, false) parsePrimary(>=, expression) @@ -174,12 +174,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -192,12 +192,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -210,12 +210,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -228,12 +228,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -246,12 +246,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -264,12 +264,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -282,12 +282,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -302,12 +302,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(..., 17, false) parseUnaryExpression(..., false) parsePrimary(..., expression) @@ -327,12 +327,12 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) parsePrecedenceExpression(const, 17, false) parseUnaryExpression(const, false) parsePrimary(const, expression) @@ -356,80 +356,80 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'NoType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, x) + listener: handleVariablePattern(var, x, false) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'NoType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, x) + listener: handleVariablePattern(final, x, false) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'SimpleType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(List, typeReference) listener: handleNoTypeArguments(x) listener: handleType(List, null) - listener: handleVariablePattern(null, x) + listener: handleVariablePattern(null, x, false) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'NoType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(...) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(..., isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(..., PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) + parseVariablePattern((, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureCloseParen(_, () listener: handleParenthesizedPattern(() listener: handleRestPattern(..., true) @@ -438,19 +438,19 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(..., isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) - parseVariablePattern([, typeInfo: Instance of 'NoType') + parseListPatternSuffix(..., PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) + parseVariablePattern([, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType([) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleListPattern(1, [, ]) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) @@ -458,14 +458,14 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) listener: handleNoTypeArguments([]) - parseListPatternSuffix(..., isRefutableContext: true) + parseListPatternSuffix(..., PatternContext.matching) rewriteSquareBrackets(...) link([, ]) rewriter() @@ -476,18 +476,18 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseListPatternSuffix(>, isRefutableContext: true) + parseListPatternSuffix(>, PatternContext.matching) rewriteSquareBrackets(>) link([, ]) rewriter() @@ -498,14 +498,14 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(..., isRefutableContext: true) + parseMapPatternSuffix(..., PatternContext.matching) listener: handleMapPattern(0, {, }) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) @@ -513,14 +513,14 @@ parseUnit(void) listener: endCaseExpression(case, null, :) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(List, isRefutableContext: true) + parseObjectPatternRest(List, PatternContext.matching) listener: handleObjectPatternFields(0, (, )) listener: handleObjectPattern(List, null, null) listener: handleRestPattern(..., true) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.expect index fcea1c3f5277..2c55dc79c642 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(void) beginCaseExpression(case) handleNoTypeArguments([) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleRestPattern(..., true) handleListPattern(1, [, ]) endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect index 276cfe3482e2..ab2f88061aca 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideList.dart.intertwined.expect @@ -66,15 +66,15 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'NoType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleRestPattern(..., true) listener: handleListPattern(1, [, ]) ensureColon(]) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.expect index 19fc18ba7421..3acf44c6008e 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(void) beginCaseExpression(case) handleNoTypeArguments({) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleRestPattern(..., true) handleMapPattern(1, {, }) endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect index ac157365c04d..069304b7e34f 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withSubpattern_insideMap.dart.intertwined.expect @@ -66,15 +66,15 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) - parsePattern(..., precedence: 1, isRefutableContext: true) - parsePrimaryPattern(..., isRefutableContext: true) - parseVariablePattern(..., typeInfo: Instance of 'NoType') + parseMapPatternSuffix(case, PatternContext.matching) + parsePattern(..., PatternContext.matching, precedence: 1) + parsePrimaryPattern(..., PatternContext.matching) + parseVariablePattern(..., PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleRestPattern(..., true) listener: handleMapPattern(1, {, }) ensureColon(}) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect index ffc1408344bf..1b60eb70df01 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideList.dart.intertwined.expect @@ -66,10 +66,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) + parseListPatternSuffix(case, PatternContext.matching) listener: handleRestPattern(..., false) listener: handleListPattern(1, [, ]) ensureColon(]) diff --git a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect index 66ad0add779c..32012e59f821 100644 --- a/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/rest_withoutSubpattern_insideMap.dart.intertwined.expect @@ -66,10 +66,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) listener: handleRestPattern(..., false) listener: handleMapPattern(1, {, }) ensureColon(}) diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect index 7faeb94a18f2..e30b20426ef6 100644 --- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_case.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect index 5099fa2e0cbc..8bcf0e47278a 100644 --- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_cast.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect index 2f58582fa016..7a8c47db2ebc 100644 --- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_if_case.dart.intertwined.expect @@ -61,8 +61,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect index de1a7901650f..27fd80bb3514 100644 --- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_assert.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect index d37214cc1871..6f95e5326079 100644 --- a/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/string_literal_inside_null_check.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.expect index 63a1deb1f74d..35746eb1ad02 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralBool(true) handleLiteralInt(0) endSwitchExpressionCase(when, =>, 0) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect index 2856e276abaa..35f7578b0c2f 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_guarded.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.expect index 47a894c246eb..6d77bd19552f 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralInt(0) endSwitchExpressionCase(null, =>, 0) endSwitchExpressionBlock(1, {, }) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect index c49a1636588b..950bdcfd25d9 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_noTrailingComma.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.expect index 47a894c246eb..6d77bd19552f 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(f) beginSwitchExpressionBlock({) beginSwitchExpressionCase() handleNoType({) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralInt(0) endSwitchExpressionCase(null, =>, 0) endSwitchExpressionBlock(1, {, }) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect index c49a1636588b..950bdcfd25d9 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_onePattern_trailingComma.dart.intertwined.expect @@ -68,11 +68,11 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'NoType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType({) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.expect index cb8b9252f4df..af8753ff9c47 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.expect @@ -27,12 +27,12 @@ beginCompilationUnit(f) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralInt(0) endSwitchExpressionCase(null, =>, 0) beginSwitchExpressionCase() handleNoType(,) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralInt(1) endSwitchExpressionCase(null, =>, 1) endSwitchExpressionBlock(2, {, }) diff --git a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect index 7eb93b39d983..b0854f70138b 100644 --- a/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/switchExpression_twoPatterns.dart.intertwined.expect @@ -68,13 +68,13 @@ parseUnit(f) ensureBlock(), null, switch expression) listener: beginSwitchExpressionBlock({) listener: beginSwitchExpressionCase() - parsePattern({, precedence: 1, isRefutableContext: true) - parsePrimaryPattern({, isRefutableContext: true) - parseVariablePattern({, typeInfo: Instance of 'SimpleType') + parsePattern({, PatternContext.matching, precedence: 1) + parsePrimaryPattern({, PatternContext.matching) + parseVariablePattern({, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) @@ -86,11 +86,11 @@ parseUnit(f) listener: handleLiteralInt(0) listener: endSwitchExpressionCase(null, =>, 0) listener: beginSwitchExpressionCase() - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) - parseVariablePattern(,, typeInfo: Instance of 'NoType') + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) + parseVariablePattern(,, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(,) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureFunctionArrow(_) parseExpression(=>) looksLikeOuterPatternEquals(=>) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.expect index 596e195fc3c2..3ae67e79c6a2 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect index 25a5e4d54fc7..0b7e427591a4 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_case.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) ensureColon(y) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.expect index fca4e047495e..d943a81cb83a 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect index 6044f0250ab4..1ced8dc17f74 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_cast.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.expect index e78ddaf31c9d..512b27f73e0e 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect index 35abab9c66ae..1a748587c181 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_if_case.dart.intertwined.expect @@ -61,13 +61,13 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) ensureCloseParen(y, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.expect index 69101835b98e..0fa4b1fd23ef 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect index 107cb0ecc43d..de23b2a1010a 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_assert.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.expect index 62bae9d9b572..52913ac3d335 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(final, y) + handleVariablePattern(final, y, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect index 4671c05ad968..aaef33afbe24 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_final_variable_inside_null_check.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(final, y) + listener: handleVariablePattern(final, y, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.expect index 3417c2084142..d0e64e560411 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect index b89ab988f84f..f8e913bc4f6d 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_case.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) ensureColon(y) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.expect index 5e0206f138ef..1a6a8be7510f 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect index 39b50ec8fb85..b33ade9ac369 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_cast.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.expect index 21dc8919d577..8b813be75737 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect index 4f85e8663966..eefd06454755 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_if_case.dart.intertwined.expect @@ -61,13 +61,13 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) ensureCloseParen(y, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.expect index e23efb3ad6d7..a76a058d8b79 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect index b5b979216d14..94ea13911dbb 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_assert.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.expect index 8ccc145d646a..86abef0d028d 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(y) handleType(int, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect index 0cbed800fa31..0f6d547891d5 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_inside_null_check.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) listener: handleType(int, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.expect index 60ac9d5cb0e4..a864098655e0 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.intertwined.expect index 64b6ca8a2447..475809ca6aef 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_case.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) ensureColon(as) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.expect index 826a4e5e498a..46f0561121d5 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.intertwined.expect index b46724d744a0..5e72bfd35d54 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_cast.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.expect index 8f830f616de3..925258ea78b4 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.expect @@ -58,7 +58,7 @@ beginCompilationUnit(class) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.intertwined.expect index fc1c039d20fa..274873856fcd 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern.dart.intertwined.expect @@ -113,19 +113,19 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'SimpleType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.expect index bdad3978c460..34d0911a384d 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.expect @@ -58,7 +58,7 @@ beginCompilationUnit(class) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handlePatternField(:) handleObjectPatternFields(1, (, )) handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.intertwined.expect index 1be356fdf3e6..953c119b04af 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_extractor_pattern_implicitly_named.dart.intertwined.expect @@ -113,18 +113,18 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments(() - parseObjectPatternRest(C, isRefutableContext: true) + parseObjectPatternRest(C, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'SimpleType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handlePatternField(:) listener: handleObjectPatternFields(1, (, )) listener: handleObjectPattern(C, null, null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.expect index fcf10b5228ce..9a152a0a418c 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.expect @@ -27,7 +27,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.intertwined.expect index 375ff7bffc02..2671e525f29e 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_if_case.dart.intertwined.expect @@ -61,13 +61,13 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) ensureCloseParen(as, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.expect index fc6c8432ef61..d16a8fa2d9a8 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.expect @@ -31,7 +31,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleListPattern(1, [, ]) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.intertwined.expect index a8cc4aec8b0b..ebb66bf04882 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_list_pattern.dart.intertwined.expect @@ -69,17 +69,17 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments([) - parseListPatternSuffix(case, isRefutableContext: true) - parsePattern([, precedence: 1, isRefutableContext: true) - parsePrimaryPattern([, isRefutableContext: true) - parseVariablePattern([, typeInfo: Instance of 'SimpleType') + parseListPatternSuffix(case, PatternContext.matching) + parsePattern([, PatternContext.matching, precedence: 1) + parsePrimaryPattern([, PatternContext.matching) + parseVariablePattern([, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handleListPattern(1, [, ]) ensureColon(]) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.expect index 25bc0ff3e180..fc33a019e6c1 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) beginBinaryPattern(&&) handleLiteralInt(2) handleConstantPattern(null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.intertwined.expect index 8fc5f367e412..899c2d542eff 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_lhs.dart.intertwined.expect @@ -69,16 +69,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) parsePrecedenceExpression(&&, 17, false) parseUnaryExpression(&&, false) parsePrimary(&&, expression) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.expect index fb75ae0fbcae..2e506d2cbee6 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.expect @@ -33,7 +33,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) endBinaryPattern(&&) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.intertwined.expect index 5d1d765ba0f9..b544dd4c68e8 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_and_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,13 +78,13 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&&) - parsePattern(&&, precedence: 7, isRefutableContext: true) - parsePrimaryPattern(&&, isRefutableContext: true) - parseVariablePattern(&&, typeInfo: Instance of 'SimpleType') + parsePattern(&&, PatternContext.matching, precedence: 7) + parsePrimaryPattern(&&, PatternContext.matching) + parseVariablePattern(&&, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: endBinaryPattern(&&) ensureColon(as) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.expect index d6ddd32ccc2b..9d29ee186b52 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) beginBinaryPattern(||) handleLiteralInt(2) handleConstantPattern(null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.intertwined.expect index dd78502c850f..44d90bbef729 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_lhs.dart.intertwined.expect @@ -69,16 +69,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) parsePrecedenceExpression(||, 17, false) parseUnaryExpression(||, false) parsePrimary(||, expression) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.expect index 7efdc8b0b59c..0e5df4aaaae3 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.expect @@ -33,7 +33,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) endBinaryPattern(||) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.intertwined.expect index c878c9dfd9b1..1eae7e2da135 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_logical_or_rhs.dart.intertwined.expect @@ -69,8 +69,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) parsePrecedenceExpression(case, 17, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -78,13 +78,13 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(||) - parsePattern(||, precedence: 6, isRefutableContext: true) - parsePrimaryPattern(||, isRefutableContext: true) - parseVariablePattern(||, typeInfo: Instance of 'SimpleType') + parsePattern(||, PatternContext.matching, precedence: 6) + parsePrimaryPattern(||, PatternContext.matching) + parseVariablePattern(||, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: endBinaryPattern(||) ensureColon(as) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.expect index cc0d6166a57a..3aa8245acc74 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.expect @@ -33,7 +33,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleMapPatternEntry(:, }) handleMapPattern(1, {, }) endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.intertwined.expect index 7793305987e0..c0d356822aed 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_map_pattern.dart.intertwined.expect @@ -69,10 +69,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case, isRefutableContext: true) + parseMapPatternSuffix(case, PatternContext.matching) parseExpression({) looksLikeOuterPatternEquals({) skipOuterPattern({) @@ -83,13 +83,13 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'SimpleType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handleMapPatternEntry(:, }) listener: handleMapPattern(1, {, }) ensureColon(}) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.expect index 2b033bc243a2..f5c3d10a438f 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.intertwined.expect index 09057e047b11..8abffc7f0451 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_assert.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.expect index 348b60276268..c8abc1d98b60 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.intertwined.expect index 4d3b2fde1312..21d23b77564b 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_null_check.dart.intertwined.expect @@ -69,13 +69,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.expect index ca127fd5fb96..f3405b2a8cc8 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleParenthesizedPattern(() endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.intertwined.expect index a18b0d7733d4..4444b7e871ee 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_parenthesized_pattern.dart.intertwined.expect @@ -69,16 +69,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) - parseVariablePattern((, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) + parseVariablePattern((, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) ensureCloseParen(as, () listener: handleParenthesizedPattern(() ensureColon()) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.expect index 5df8df231d9f..5adc0ac28983 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.expect @@ -31,7 +31,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handlePatternField(:) handleLiteralInt(2) handleConstantPattern(null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.intertwined.expect index f1e2939f8d8f..781d8ddda06c 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_implicitly_named.dart.intertwined.expect @@ -69,20 +69,20 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) listener: handleNoName(() - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'SimpleType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.expect index e7596ccfb4cd..6413dfb30f0e 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.expect @@ -31,7 +31,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handlePatternField(:) handleLiteralInt(2) handleConstantPattern(null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.intertwined.expect index 9cf8b605498a..3e619f57bfcf 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_named.dart.intertwined.expect @@ -69,21 +69,21 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(:, isRefutableContext: true) - parseVariablePattern(:, typeInfo: Instance of 'SimpleType') + parsePattern(:, PatternContext.matching, precedence: 1) + parsePrimaryPattern(:, PatternContext.matching) + parseVariablePattern(:, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handlePatternField(:) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.expect index ddb6cd73bf8d..7d3dc386ef22 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.expect @@ -30,7 +30,7 @@ beginCompilationUnit(test) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handlePatternField(null) handleLiteralInt(2) handleConstantPattern(null) diff --git a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.intertwined.expect index cee025894bf2..83478ddce8b3 100644 --- a/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/typed_variable_named_as_inside_record_pattern_unnamed.dart.intertwined.expect @@ -69,19 +69,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) - parsePattern((, precedence: 1, isRefutableContext: true) - parsePrimaryPattern((, isRefutableContext: true) - parseVariablePattern((, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseParenthesizedPatternOrRecordPattern(case, PatternContext.matching) + parsePattern((, PatternContext.matching, precedence: 1) + parsePrimaryPattern((, PatternContext.matching) + parseVariablePattern((, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: handlePatternField(null) - parsePattern(,, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(,, isRefutableContext: true) + parsePattern(,, PatternContext.matching, precedence: 1) + parsePrimaryPattern(,, PatternContext.matching) parsePrecedenceExpression(,, 17, false) parseUnaryExpression(,, false) parsePrimary(,, expression) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.expect index a24021e56a23..9edfb727f561 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect index 28b8b38a61da..6efa133326c9 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_case.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) ensureColon(y) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.expect index 0b2137bf0fd0..5eafc6b59177 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect index 97623b46aa67..f2581033337d 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_cast.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.expect index 35e81a1a5924..099c8c678432 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(test) handleNoArguments(case) handleSend(x, case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect index 63bdaec8c5ff..19a111f531eb 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_if_case.dart.intertwined.expect @@ -61,11 +61,11 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) ensureCloseParen(y, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.expect index 23e1545dc69d..ebbdf18cd865 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect index 9aebd7a8ca5b..1df60f868ff6 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_assert.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.expect index 8a314d4b5977..74eb962e673e 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(test) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, y) + handleVariablePattern(var, y, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect index ba37e50e890b..4ed8e70087a8 100644 --- a/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/var_variable_inside_null_check.dart.intertwined.expect @@ -69,11 +69,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, y) + listener: handleVariablePattern(var, y, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.expect index e4df700e7094..8e896c4232fd 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments()) diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect index 04b93d1cb50d..743884499d21 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideCast.dart.intertwined.expect @@ -43,14 +43,14 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.expect index 55aa98dc4161..fdf90812fb5b 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.expect @@ -20,7 +20,7 @@ beginCompilationUnit(void) beginMetadataStar(var) endMetadataStar(0) handleNoType(() - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) handleNullAssertPattern(!) handleParenthesizedPattern(() handleIdentifier(x, expression) diff --git a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect index 57506352c9ae..25e92a9ad80c 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_bare_insideNullAssert.dart.intertwined.expect @@ -43,14 +43,14 @@ parseUnit(void) listener: beginMetadataStar(var) listener: endMetadataStar(0) parsePatternVariableDeclarationStatement(var, {, var) - parsePattern(var, precedence: 1, isRefutableContext: false) - parsePrimaryPattern(var, isRefutableContext: false) - parseParenthesizedPatternOrRecordPattern(var, isRefutableContext: false) - parsePattern((, precedence: 1, isRefutableContext: false) - parsePrimaryPattern((, isRefutableContext: false) - parseVariablePattern((, typeInfo: Instance of 'NoType') + parsePattern(var, PatternContext.declaration, precedence: 1) + parsePrimaryPattern(var, PatternContext.declaration) + parseParenthesizedPatternOrRecordPattern(var, PatternContext.declaration) + parsePattern((, PatternContext.declaration, precedence: 1) + parsePrimaryPattern((, PatternContext.declaration) + parseVariablePattern((, PatternContext.declaration, typeInfo: Instance of 'NoType') listener: handleNoType(() - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) listener: handleNullAssertPattern(!) ensureCloseParen(!, () listener: handleParenthesizedPattern(() diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.expect index 13285e626e11..c00527ac5d9c 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(when, typeReference) handleNoTypeArguments(as) handleType(when, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) beginAsOperatorType(as) handleIdentifier(when, typeReference) handleNoTypeArguments(when) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.intertwined.expect index 3a5ebc64a3a4..664c49c0db23 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_absurd.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(when, typeReference) listener: handleNoTypeArguments(as) listener: handleType(when, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(when, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.expect index 14f4083d641c..1b0e83a80f59 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(as) handleType(int, null) - handleVariablePattern(null, as) + handleVariablePattern(null, as, false) handleLiteralBool(true) endCaseExpression(case, when, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.intertwined.expect index 21039e2a7e7d..fed5462abdff 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedAs_beforeWhen.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) - listener: handleVariablePattern(null, as) + listener: handleVariablePattern(null, as, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.expect index cff09b1c086c..ab1df053b0c3 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(_, typeReference) handleNoTypeArguments(y) handleType(_, null) - handleVariablePattern(null, y) + handleVariablePattern(null, y, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.intertwined.expect index c432898b3ebc..03fecc37a625 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedUnderscore_insideCase.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(_, typeReference) listener: handleNoTypeArguments(y) listener: handleType(_, null) - listener: handleVariablePattern(null, y) + listener: handleVariablePattern(null, y, false) ensureColon(y) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.expect index 91783162fb76..f725b818a0a7 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(when) handleType(int, null) - handleVariablePattern(null, when) + handleVariablePattern(null, when, false) handleIdentifier(when, expression) handleNoTypeArguments(>) handleNoArguments(>) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.intertwined.expect index 1a60140bf3a6..154fbdb143f0 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_absurd.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(when) listener: handleType(int, null) - listener: handleVariablePattern(null, when) + listener: handleVariablePattern(null, when, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.expect index 917df1b50bd8..c96ab9bea2dd 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(when) handleType(int, null) - handleVariablePattern(null, when) + handleVariablePattern(null, when, false) handleLiteralBool(true) endCaseExpression(case, when, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.intertwined.expect index 45e16c6679a8..7c4fdab1f5ca 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_beforeWhen.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(when) listener: handleType(int, null) - listener: handleVariablePattern(null, when) + listener: handleVariablePattern(null, when, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.expect index 60738b597bfc..8fb17cd7b12f 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(when) handleType(int, null) - handleVariablePattern(null, when) + handleVariablePattern(null, when, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.intertwined.expect index 04d4933a8ccb..3df47a417d4d 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCase.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(when) listener: handleType(int, null) - listener: handleVariablePattern(null, when) + listener: handleVariablePattern(null, when, false) ensureColon(when) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.expect index 23a828b40619..8afdf7452e85 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(when) handleType(int, null) - handleVariablePattern(null, when) + handleVariablePattern(null, when, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.intertwined.expect index c8875c2a01d5..f10f7e50e103 100644 --- a/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/variable_typedNamedWhen_insideCast.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(when) listener: handleType(int, null) - listener: handleVariablePattern(null, when) + listener: handleVariablePattern(null, when, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.expect index f46d1088d2f6..3e2413f37fd8 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleLiteralBool(true) endCaseExpression(case, when, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect index 834f982739f7..ee295f1c1437 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_beforeWhen.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) parseExpression(when) looksLikeOuterPatternEquals(when) skipOuterPattern(when) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.expect index 79ab344326a4..cc77baff49b0 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect index 8e18b62265a2..d951e7506a7e 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCase.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureColon(_) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.expect index 57a6a7c3b4c3..cec3c66618be 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect index d5713b4c6044..c2b3d1f83962 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideCast.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.expect index 69c2a6eef128..64d472ef3681 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.expect @@ -23,7 +23,7 @@ beginCompilationUnit(void) handleNoArguments(case) handleSend(x, case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect index da25590dcf84..e62a8bc98be6 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideIfCase.dart.intertwined.expect @@ -58,11 +58,11 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.expect index 8fc402bd980b..a92ee56898da 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect index 32f7146f76e2..bc3db43c1f81 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullAssert.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.expect index 6173c1dafd6a..c2a622555622 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(case) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect index 47e4ca87f74d..b71581637e81 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_bare_insideNullCheck.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(case) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.expect index 30ca722bd55c..b3e862ee64f1 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect index d9928faebeab..0ca52d2bd9e5 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCase.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) ensureColon(_) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.expect index 386d32c91332..4922e956fafd 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect index 595e205bf717..4880b96e85b7 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideCast.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.expect index 0da0ee416ddf..32cc4f141e8d 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect index ce2f6ce37083..92bf338abff7 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideIfCase.dart.intertwined.expect @@ -58,13 +58,13 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.expect index 457968ab8b1b..498b71a6dd0b 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect index a286af732771..eb70e8b49e1d 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullAssert.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.expect index ffb5838b7810..da4d00d9c972 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect index 8c9bf8601a5f..913a32e7c8af 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_typed_insideNullCheck.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.expect index 9501ba993e3a..e71fb0b7f3be 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect index bdf5f1819569..284e8c5a2b96 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCase.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) ensureColon(_) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.expect index a10616e04ee1..e1723dacfb52 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect index 938b63946405..f5005ab19e00 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideCast.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.expect index cba2ec31745f..918226cbcad2 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.expect @@ -23,7 +23,7 @@ beginCompilationUnit(void) handleNoArguments(case) handleSend(x, case) handleNoType(final) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect index a64ce731806d..d7fcd80825f2 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideIfCase.dart.intertwined.expect @@ -58,11 +58,11 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.expect index afe67b83ae78..60cb3ccb1a01 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect index 1348b6c4a185..6f5dec9f2fd4 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullAssert.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.expect index 10d05e190b79..d9ff7a2b4dc1 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(final) - handleVariablePattern(final, _) + handleVariablePattern(final, _, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect index 0e6cfaeb5f82..57ab3d62f657 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_final_untyped_insideNullCheck.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(final) - listener: handleVariablePattern(final, _) + listener: handleVariablePattern(final, _, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.expect index 13dfb1709ead..76836d4fe968 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect index 2d39ff2501f9..26dfe9c1ecad 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCase.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureColon(_) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.expect index c9b9f6b3657a..e13df50b862e 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect index 09045711f8c1..d1abfe65e37b 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideCast.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.expect index 08609ddc1bcb..df8ef1fc78e0 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.expect @@ -25,7 +25,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect index 9c1c22081e84..c64245a13a1a 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideIfCase.dart.intertwined.expect @@ -58,13 +58,13 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.expect index ebe7f204d1b6..f68dffdf26dd 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect index 9387d6c244a6..4586cd0750b2 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullAssert.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.expect index cc0b1c406e4a..89f7dd87ddd6 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.expect @@ -28,7 +28,7 @@ beginCompilationUnit(void) handleIdentifier(int, typeReference) handleNoTypeArguments(_) handleType(int, null) - handleVariablePattern(null, _) + handleVariablePattern(null, _, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect index 144dc83eb645..e6b27d969662 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_typed_insideNullCheck.dart.intertwined.expect @@ -66,13 +66,13 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'SimpleType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) listener: handleType(int, null) - listener: handleVariablePattern(null, _) + listener: handleVariablePattern(null, _, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.expect index e60492a808de..f354621dfa6c 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, _) + handleVariablePattern(var, _, false) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) handleBreakStatement(false, break, ;) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect index 37d2829aa213..2175d5668d44 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCase.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, _) + listener: handleVariablePattern(var, _, false) ensureColon(_) listener: endCaseExpression(case, null, :) peekPastLabels(break) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.expect index e59f822c917e..1948141dd16c 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, _) + handleVariablePattern(var, _, false) beginAsOperatorType(as) handleIdentifier(Object, typeReference) handleNoTypeArguments(:) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect index 6f4748c73ebe..356da03d52e1 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideCast.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, _) + listener: handleVariablePattern(var, _, false) listener: beginAsOperatorType(as) computeTypeAfterIsOrAs(as) listener: handleIdentifier(Object, typeReference) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.expect index 476a0225d25c..39c2813e9dc4 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.expect @@ -23,7 +23,7 @@ beginCompilationUnit(void) handleNoArguments(case) handleSend(x, case) handleNoType(var) - handleVariablePattern(var, _) + handleVariablePattern(var, _, false) handleParenthesizedCondition((, case, null) beginThenStatement({) beginBlock({, BlockKind(statement)) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect index 50241ab5fcd5..6b0cdf93dd42 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideIfCase.dart.intertwined.expect @@ -58,11 +58,11 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, _) + listener: handleVariablePattern(var, _, false) ensureCloseParen(_, () listener: handleParenthesizedCondition((, case, null) listener: beginThenStatement({) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.expect index 5da84196a548..d3f45ee5e6b2 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, _) + handleVariablePattern(var, _, false) handleNullAssertPattern(!) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect index 1067c1b7d7e6..9cfb26a2c63f 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullAssert.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, _) + listener: handleVariablePattern(var, _, false) listener: handleNullAssertPattern(!) ensureColon(!) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.expect index fa6db209c630..fd66968c8d17 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.expect @@ -26,7 +26,7 @@ beginCompilationUnit(void) beginSwitchBlock({) beginCaseExpression(case) handleNoType(var) - handleVariablePattern(var, _) + handleVariablePattern(var, _, false) handleNullCheckPattern(?) endCaseExpression(case, null, :) beginSwitchCase(0, 1, case) diff --git a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect index 6fafc1670813..0ee6c7bd61d0 100644 --- a/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect +++ b/pkg/front_end/parser_testcases/patterns/wildcard_var_insideNullCheck.dart.intertwined.expect @@ -66,11 +66,11 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1, isRefutableContext: true) - parsePrimaryPattern(case, isRefutableContext: true) - parseVariablePattern(case, typeInfo: Instance of 'NoType') + parsePattern(case, PatternContext.matching, precedence: 1) + parsePrimaryPattern(case, PatternContext.matching) + parseVariablePattern(case, PatternContext.matching, typeInfo: Instance of 'NoType') listener: handleNoType(var) - listener: handleVariablePattern(var, _) + listener: handleVariablePattern(var, _, false) listener: handleNullCheckPattern(?) ensureColon(?) listener: endCaseExpression(case, null, :) diff --git a/pkg/front_end/test/parser_test_listener.dart b/pkg/front_end/test/parser_test_listener.dart index eda5d69b88eb..ddd9b6d5e591 100644 --- a/pkg/front_end/test/parser_test_listener.dart +++ b/pkg/front_end/test/parser_test_listener.dart @@ -2074,10 +2074,14 @@ class ParserTestListener implements Listener { } @override - void handleVariablePattern(Token? keyword, Token variable) { + void handleVariablePattern(Token? keyword, Token variable, + {required bool inAssignmentPattern}) { seen(keyword); seen(variable); - doPrint('handleVariablePattern(' '$keyword, ' '$variable)'); + doPrint('handleVariablePattern(' + '$keyword, ' + '$variable, ' + '$inAssignmentPattern)'); } @override diff --git a/pkg/front_end/test/parser_test_parser.dart b/pkg/front_end/test/parser_test_parser.dart index e5d192d9f9b2..366425b675b3 100644 --- a/pkg/front_end/test/parser_test_parser.dart +++ b/pkg/front_end/test/parser_test_parser.dart @@ -14,7 +14,7 @@ import 'package:_fe_analyzer_shared/src/parser/listener.dart' show Listener; import 'package:_fe_analyzer_shared/src/parser/member_kind.dart'; import 'package:_fe_analyzer_shared/src/parser/parser.dart' show Parser; import 'package:_fe_analyzer_shared/src/parser/parser_impl.dart' - show AwaitOrYieldContext, ForPartsContext; + show AwaitOrYieldContext, ForPartsContext, PatternContext; import 'package:_fe_analyzer_shared/src/parser/token_stream_rewriter.dart'; import 'package:_fe_analyzer_shared/src/parser/type_info.dart'; import 'package:_fe_analyzer_shared/src/scanner/token.dart'; @@ -2667,87 +2667,78 @@ class TestParser extends Parser { } @override - Token parsePattern(Token token, - {int precedence = 1, required bool isRefutableContext}) { + Token parsePattern(Token token, PatternContext patternContext, + {int precedence = 1}) { doPrint('parsePattern(' '$token, ' - 'precedence: $precedence, ' - 'isRefutableContext: $isRefutableContext)'); + '$patternContext, ' + 'precedence: $precedence)'); indent++; - var result = super.parsePattern(token, - precedence: precedence, isRefutableContext: isRefutableContext); + var result = + super.parsePattern(token, patternContext, precedence: precedence); indent--; return result; } @override - Token parsePrimaryPattern(Token token, {required bool isRefutableContext}) { - doPrint('parsePrimaryPattern(' - '$token, ' - 'isRefutableContext: $isRefutableContext)'); + Token parsePrimaryPattern(Token token, PatternContext patternContext) { + doPrint('parsePrimaryPattern(' '$token, ' '$patternContext)'); indent++; - var result = super - .parsePrimaryPattern(token, isRefutableContext: isRefutableContext); + var result = super.parsePrimaryPattern(token, patternContext); indent--; return result; } @override - Token parseVariablePattern(Token token, {TypeInfo typeInfo = noType}) { - doPrint('parseVariablePattern(' '$token, ' 'typeInfo: $typeInfo)'); + Token parseVariablePattern(Token token, PatternContext patternContext, + {TypeInfo typeInfo = noType}) { + doPrint('parseVariablePattern(' + '$token, ' + '$patternContext, ' + 'typeInfo: $typeInfo)'); indent++; - var result = super.parseVariablePattern(token, typeInfo: typeInfo); + var result = + super.parseVariablePattern(token, patternContext, typeInfo: typeInfo); indent--; return result; } @override - Token parseListPatternSuffix(Token token, - {required bool isRefutableContext}) { - doPrint('parseListPatternSuffix(' - '$token, ' - 'isRefutableContext: $isRefutableContext)'); + Token parseListPatternSuffix(Token token, PatternContext patternContext) { + doPrint('parseListPatternSuffix(' '$token, ' '$patternContext)'); indent++; - var result = super - .parseListPatternSuffix(token, isRefutableContext: isRefutableContext); + var result = super.parseListPatternSuffix(token, patternContext); indent--; return result; } @override - Token parseMapPatternSuffix(Token token, {required bool isRefutableContext}) { - doPrint('parseMapPatternSuffix(' - '$token, ' - 'isRefutableContext: $isRefutableContext)'); + Token parseMapPatternSuffix(Token token, PatternContext patternContext) { + doPrint('parseMapPatternSuffix(' '$token, ' '$patternContext)'); indent++; - var result = super - .parseMapPatternSuffix(token, isRefutableContext: isRefutableContext); + var result = super.parseMapPatternSuffix(token, patternContext); indent--; return result; } @override - Token parseParenthesizedPatternOrRecordPattern(Token token, - {required bool isRefutableContext}) { + Token parseParenthesizedPatternOrRecordPattern( + Token token, PatternContext patternContext) { doPrint('parseParenthesizedPatternOrRecordPattern(' '$token, ' - 'isRefutableContext: $isRefutableContext)'); + '$patternContext)'); indent++; - var result = super.parseParenthesizedPatternOrRecordPattern(token, - isRefutableContext: isRefutableContext); + var result = + super.parseParenthesizedPatternOrRecordPattern(token, patternContext); indent--; return result; } @override - Token parseObjectPatternRest(Token token, - {required bool isRefutableContext}) { - doPrint('parseObjectPatternRest(' - '$token, ' - 'isRefutableContext: $isRefutableContext)'); + Token parseObjectPatternRest(Token token, PatternContext patternContext) { + doPrint('parseObjectPatternRest(' '$token, ' '$patternContext)'); indent++; - var result = super - .parseObjectPatternRest(token, isRefutableContext: isRefutableContext); + var result = super.parseObjectPatternRest(token, patternContext); indent--; return result; } diff --git a/pkg/front_end/test/parser_test_parser_creator.dart b/pkg/front_end/test/parser_test_parser_creator.dart index 5715d21c6ff2..c3459005a316 100644 --- a/pkg/front_end/test/parser_test_parser_creator.dart +++ b/pkg/front_end/test/parser_test_parser_creator.dart @@ -51,7 +51,7 @@ import 'package:_fe_analyzer_shared/src/parser/identifier_context.dart'; import 'package:_fe_analyzer_shared/src/parser/listener.dart' show Listener; import 'package:_fe_analyzer_shared/src/parser/member_kind.dart'; import 'package:_fe_analyzer_shared/src/parser/parser.dart' show Parser; -import 'package:_fe_analyzer_shared/src/parser/parser_impl.dart' show AwaitOrYieldContext, ForPartsContext; +import 'package:_fe_analyzer_shared/src/parser/parser_impl.dart' show AwaitOrYieldContext, ForPartsContext, PatternContext; import 'package:_fe_analyzer_shared/src/parser/token_stream_rewriter.dart'; import 'package:_fe_analyzer_shared/src/parser/type_info.dart'; import 'package:_fe_analyzer_shared/src/scanner/token.dart';