From a975bf07371d7b1b12c4da601d436c1034f5b48e Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 21 Nov 2022 14:30:16 +0000 Subject: [PATCH] Parser API changes in preparation for supporting patternVariableDeclaration. Bug: https://github.com/dart-lang/sdk/issues/50035 Change-Id: I2661b7cbe60815b6232a165d56a478d8975aa6c2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270228 Reviewed-by: Jens Johansen Reviewed-by: Konstantin Shcheglov Commit-Queue: Paul Berry --- .../lib/src/parser/parser_impl.dart | 56 ++++++++++++------ ...iteral_inside_case.dart.intertwined.expect | 4 +- ...iteral_inside_cast.dart.intertwined.expect | 4 +- ...ral_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ..._insideIfStatement.dart.intertwined.expect | 4 +- ...ideSwitchStatement.dart.intertwined.expect | 4 +- ..._insideIfStatement.dart.intertwined.expect | 4 +- ...ideSwitchStatement.dart.intertwined.expect | 4 +- ..._insideIfStatement.dart.intertwined.expect | 4 +- ...ideSwitchStatement.dart.intertwined.expect | 4 +- ..._insideIfStatement.dart.intertwined.expect | 4 +- ...ideSwitchStatement.dart.intertwined.expect | 4 +- .../cast_inside_case.dart.intertwined.expect | 4 +- ..._extractor_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 10 ++-- ...ast_inside_if_case.dart.intertwined.expect | 4 +- ...nside_list_pattern.dart.intertwined.expect | 10 ++-- ...de_logical_and_lhs.dart.intertwined.expect | 8 +-- ...de_logical_and_rhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_rhs.dart.intertwined.expect | 8 +-- ...inside_map_pattern.dart.intertwined.expect | 10 ++-- ...enthesized_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 14 ++--- ...cord_pattern_named.dart.intertwined.expect | 14 ++--- ...rd_pattern_unnamed.dart.intertwined.expect | 14 ++--- ...lyPrefixed_builtin.dart.intertwined.expect | 4 +- ...refixed_insideCase.dart.intertwined.expect | 4 +- ...refixed_insideCast.dart.intertwined.expect | 4 +- ...fixed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...ixed_pseudoKeyword.dart.intertwined.expect | 4 +- ...tifier_inside_case.dart.intertwined.expect | 4 +- ...tifier_inside_cast.dart.intertwined.expect | 4 +- ...ier_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...erscore_insideCase.dart.intertwined.expect | 4 +- ...r_prefixed_builtin.dart.intertwined.expect | 4 +- ...refixed_insideCase.dart.intertwined.expect | 4 +- ...refixed_insideCast.dart.intertwined.expect | 4 +- ...fixed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...ixed_pseudoKeyword.dart.intertwined.expect | 4 +- ...unprefixed_builtin.dart.intertwined.expect | 4 +- ...ixed_pseudoKeyword.dart.intertwined.expect | 4 +- ...d_empty_insideCase.dart.intertwined.expect | 4 +- ...d_empty_insideCast.dart.intertwined.expect | 4 +- ...empty_insideIfCase.dart.intertwined.expect | 4 +- ...y_insideNullAssert.dart.intertwined.expect | 4 +- ...ty_insideNullCheck.dart.intertwined.expect | 4 +- ...onEmpty_insideCase.dart.intertwined.expect | 4 +- ...onEmpty_insideCast.dart.intertwined.expect | 4 +- ...Empty_insideIfCase.dart.intertwined.expect | 4 +- ...y_insideNullAssert.dart.intertwined.expect | 4 +- ...ty_insideNullCheck.dart.intertwined.expect | 4 +- ...d_empty_insideCase.dart.intertwined.expect | 4 +- ...d_empty_insideCast.dart.intertwined.expect | 4 +- ...empty_insideIfCase.dart.intertwined.expect | 4 +- ...y_insideNullAssert.dart.intertwined.expect | 4 +- ...ty_insideNullCheck.dart.intertwined.expect | 4 +- ...onEmpty_insideCase.dart.intertwined.expect | 4 +- ...onEmpty_insideCast.dart.intertwined.expect | 4 +- ...Empty_insideIfCase.dart.intertwined.expect | 4 +- ...y_insideNullAssert.dart.intertwined.expect | 4 +- ...ty_insideNullCheck.dart.intertwined.expect | 4 +- ...p_typed_insideCase.dart.intertwined.expect | 4 +- ...p_typed_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...untyped_insideCase.dart.intertwined.expect | 4 +- ...untyped_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...ression_insideCase.dart.intertwined.expect | 4 +- ...ression_insideCast.dart.intertwined.expect | 4 +- ...ssion_insideIfCase.dart.intertwined.expect | 4 +- ...n_insideNullAssert.dart.intertwined.expect | 4 +- ...on_insideNullCheck.dart.intertwined.expect | 4 +- ...hesized_insideCase.dart.intertwined.expect | 4 +- ...hesized_insideCast.dart.intertwined.expect | 4 +- ...sized_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...t_typed_insideCase.dart.intertwined.expect | 4 +- ...t_typed_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...untyped_insideCase.dart.intertwined.expect | 4 +- ...untyped_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...iteral_inside_case.dart.intertwined.expect | 4 +- ...iteral_inside_cast.dart.intertwined.expect | 4 +- ...ral_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...attern_inside_cast.dart.intertwined.expect | 10 ++-- ...inside_null_assert.dart.intertwined.expect | 10 ++-- ..._inside_null_check.dart.intertwined.expect | 10 ++-- ...ern_with_type_args.dart.intertwined.expect | 6 +- ...inside_null_assert.dart.intertwined.expect | 10 ++-- ...ypeArgs_insideCase.dart.intertwined.expect | 6 +- ...ypeArgs_insideCase.dart.intertwined.expect | 6 +- ...ypeArgs_insideCase.dart.intertwined.expect | 6 +- ...ypeArgs_insideCase.dart.intertwined.expect | 6 +- ...riable_inside_case.dart.intertwined.expect | 4 +- ...riable_inside_cast.dart.intertwined.expect | 4 +- ...ble_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...iteral_inside_case.dart.intertwined.expect | 4 +- ...iteral_inside_cast.dart.intertwined.expect | 4 +- ...ral_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...attern_inside_case.dart.intertwined.expect | 14 ++--- ..._inside_case_empty.dart.intertwined.expect | 6 +- ...e_empty_whitespace.dart.intertwined.expect | 6 +- ...ith_type_arguments.dart.intertwined.expect | 14 ++--- ...attern_inside_cast.dart.intertwined.expect | 10 ++-- ...inside_null_assert.dart.intertwined.expect | 10 ++-- ..._inside_null_check.dart.intertwined.expect | 10 ++-- ...and_inside_if_case.dart.intertwined.expect | 8 +-- ...de_logical_and_lhs.dart.intertwined.expect | 12 ++-- ...ide_logical_or_lhs.dart.intertwined.expect | 12 ++-- ...ide_logical_or_rhs.dart.intertwined.expect | 12 ++-- ..._or_inside_if_case.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 12 ++-- ...attern_inside_case.dart.intertwined.expect | 14 ++--- ..._inside_case_empty.dart.intertwined.expect | 6 +- ...ith_type_arguments.dart.intertwined.expect | 14 ++--- ...attern_inside_cast.dart.intertwined.expect | 10 ++-- ...inside_null_assert.dart.intertwined.expect | 10 ++-- ..._inside_null_check.dart.intertwined.expect | 10 ++-- ...assert_inside_case.dart.intertwined.expect | 4 +- ..._extractor_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 10 ++-- ...ert_inside_if_case.dart.intertwined.expect | 4 +- ...nside_list_pattern.dart.intertwined.expect | 10 ++-- ...de_logical_and_lhs.dart.intertwined.expect | 8 +-- ...de_logical_and_rhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_rhs.dart.intertwined.expect | 8 +-- ...inside_map_pattern.dart.intertwined.expect | 10 ++-- ...enthesized_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 14 ++--- ...cord_pattern_named.dart.intertwined.expect | 14 ++--- ...rd_pattern_unnamed.dart.intertwined.expect | 14 ++--- ..._check_inside_case.dart.intertwined.expect | 4 +- ..._extractor_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 10 ++-- ...eck_inside_if_case.dart.intertwined.expect | 4 +- ...nside_list_pattern.dart.intertwined.expect | 10 ++-- ...de_logical_and_lhs.dart.intertwined.expect | 8 +-- ...de_logical_and_rhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_rhs.dart.intertwined.expect | 8 +-- ...inside_map_pattern.dart.intertwined.expect | 10 ++-- ...enthesized_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 14 ++--- ...cord_pattern_named.dart.intertwined.expect | 14 ++--- ...rd_pattern_unnamed.dart.intertwined.expect | 14 ++--- ...iteral_inside_case.dart.intertwined.expect | 4 +- ...iteral_inside_cast.dart.intertwined.expect | 4 +- ...ral_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...hesized_insideCase.dart.intertwined.expect | 10 ++-- ...attern_inside_cast.dart.intertwined.expect | 10 ++-- ...inside_null_assert.dart.intertwined.expect | 10 ++-- ..._inside_null_check.dart.intertwined.expect | 10 ++-- ...ern_with_type_args.dart.intertwined.expect | 6 +- ...e_args_inside_cast.dart.intertwined.expect | 6 +- ...inside_null_assert.dart.intertwined.expect | 6 +- ..._inside_null_check.dart.intertwined.expect | 6 +- ...attern_inside_case.dart.intertwined.expect | 14 ++--- ..._inside_case_empty.dart.intertwined.expect | 4 +- ...ide_case_singleton.dart.intertwined.expect | 10 ++-- ...attern_inside_cast.dart.intertwined.expect | 14 ++--- ...inside_null_assert.dart.intertwined.expect | 14 ++--- ..._inside_null_check.dart.intertwined.expect | 14 ++--- ..._inside_case_equal.dart.intertwined.expect | 4 +- ..._case_greater_than.dart.intertwined.expect | 4 +- ...ater_than_or_equal.dart.intertwined.expect | 4 +- ...ide_case_less_than.dart.intertwined.expect | 4 +- ...less_than_or_equal.dart.intertwined.expect | 4 +- ...ide_case_not_equal.dart.intertwined.expect | 4 +- ..._extractor_pattern.dart.intertwined.expect | 10 ++-- ...nal_inside_if_case.dart.intertwined.expect | 4 +- ...nside_list_pattern.dart.intertwined.expect | 10 ++-- ...de_logical_and_lhs.dart.intertwined.expect | 8 +-- ...de_logical_and_rhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_rhs.dart.intertwined.expect | 8 +-- ...inside_map_pattern.dart.intertwined.expect | 10 ++-- ...enthesized_pattern.dart.intertwined.expect | 10 ++-- ...cord_pattern_named.dart.intertwined.expect | 14 ++--- ...rd_pattern_unnamed.dart.intertwined.expect | 14 ++--- ...iteral_inside_case.dart.intertwined.expect | 4 +- ...iteral_inside_cast.dart.intertwined.expect | 4 +- ...ral_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...riable_inside_case.dart.intertwined.expect | 4 +- ...riable_inside_cast.dart.intertwined.expect | 4 +- ...ble_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...riable_inside_case.dart.intertwined.expect | 4 +- ...riable_inside_cast.dart.intertwined.expect | 4 +- ...ble_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...med_as_inside_case.dart.intertwined.expect | 4 +- ...med_as_inside_cast.dart.intertwined.expect | 4 +- ..._extractor_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 10 ++-- ..._as_inside_if_case.dart.intertwined.expect | 4 +- ...nside_list_pattern.dart.intertwined.expect | 10 ++-- ...de_logical_and_lhs.dart.intertwined.expect | 8 +-- ...de_logical_and_rhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_lhs.dart.intertwined.expect | 8 +-- ...ide_logical_or_rhs.dart.intertwined.expect | 8 +-- ...inside_map_pattern.dart.intertwined.expect | 10 ++-- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...enthesized_pattern.dart.intertwined.expect | 10 ++-- ...n_implicitly_named.dart.intertwined.expect | 14 ++--- ...cord_pattern_named.dart.intertwined.expect | 14 ++--- ...rd_pattern_unnamed.dart.intertwined.expect | 14 ++--- ...riable_inside_case.dart.intertwined.expect | 4 +- ...riable_inside_cast.dart.intertwined.expect | 4 +- ...ble_inside_if_case.dart.intertwined.expect | 4 +- ...inside_null_assert.dart.intertwined.expect | 4 +- ..._inside_null_check.dart.intertwined.expect | 4 +- ...erscore_insideCase.dart.intertwined.expect | 4 +- ...rd_bare_insideCase.dart.intertwined.expect | 4 +- ...rd_bare_insideCast.dart.intertwined.expect | 4 +- ..._bare_insideIfCase.dart.intertwined.expect | 4 +- ...e_insideNullAssert.dart.intertwined.expect | 4 +- ...re_insideNullCheck.dart.intertwined.expect | 4 +- ...l_typed_insideCase.dart.intertwined.expect | 4 +- ...l_typed_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...untyped_insideCase.dart.intertwined.expect | 4 +- ...untyped_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...d_typed_insideCase.dart.intertwined.expect | 4 +- ...d_typed_insideCast.dart.intertwined.expect | 4 +- ...typed_insideIfCase.dart.intertwined.expect | 4 +- ...d_insideNullAssert.dart.intertwined.expect | 4 +- ...ed_insideNullCheck.dart.intertwined.expect | 4 +- ...ard_var_insideCase.dart.intertwined.expect | 4 +- ...ard_var_insideCast.dart.intertwined.expect | 4 +- ...d_var_insideIfCase.dart.intertwined.expect | 4 +- ...r_insideNullAssert.dart.intertwined.expect | 4 +- ...ar_insideNullCheck.dart.intertwined.expect | 4 +- pkg/front_end/test/parser_test_parser.dart | 59 +++++++++++++------ .../test/spell_checking_list_code.txt | 1 + 272 files changed, 917 insertions(+), 873 deletions(-) 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 e28ed69da58b..ba55ba040cc1 100644 --- a/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart +++ b/pkg/_fe_analyzer_shared/lib/src/parser/parser_impl.dart @@ -6274,7 +6274,7 @@ class Parser { Token next = token.next!; if (allowPatterns && optional('case', next)) { Token case_ = token = next; - token = parsePattern(token); + token = parsePattern(token, isRefutableContext: true); next = token.next!; Token? when; if (optional('when', next)) { @@ -8295,7 +8295,7 @@ class Parser { } listener.beginCaseExpression(caseKeyword); if (allowPatterns) { - token = parsePattern(caseKeyword); + token = parsePattern(caseKeyword, isRefutableContext: true); } else { token = parseExpression(caseKeyword); } @@ -9157,10 +9157,21 @@ class Parser { /// castPattern ::= primaryPattern 'as' type /// nullAssertPattern ::= primaryPattern '!' /// nullCheckPattern ::= primaryPattern '?' - Token parsePattern(Token token, {int precedence = 1}) { + /// + /// [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}) { assert(precedence >= 1); assert(precedence <= SELECTOR_PRECEDENCE); - token = parsePrimaryPattern(token); + token = parsePrimaryPattern(token, isRefutableContext: isRefutableContext); while (true) { Token next = token.next!; int tokenLevel = _computePrecedence(next, forPattern: true); @@ -9191,7 +9202,9 @@ class Parser { case '|': listener.beginBinaryPattern(next); // Left associative so we parse the RHS one precedence level higher - token = parsePattern(next, precedence: tokenLevel + 1); + token = parsePattern(next, + precedence: tokenLevel + 1, + isRefutableContext: isRefutableContext); listener.endBinaryPattern(next); break; default: @@ -9229,7 +9242,7 @@ class Parser { /// extractorPattern ::= extractorName typeArguments? /// '(' patternFields? ')' /// extractorName ::= typeIdentifier | qualifiedName - Token parsePrimaryPattern(Token token) { + Token parsePrimaryPattern(Token token, {required bool isRefutableContext}) { TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token, /* inDeclaration = */ true); Token next = typeArg.skip(token).next!; @@ -9238,13 +9251,15 @@ class Parser { case '[': // listPattern ::= typeArguments? '[' patterns? ']' token = typeArg.parseArguments(token, this); - return parseListPatternSuffix(token); + return parseListPatternSuffix(token, + isRefutableContext: isRefutableContext); case '{': // mapPattern ::= typeArguments? '{' mapPatternEntries? '}' // mapPatternEntries ::= mapPatternEntry ( ',' mapPatternEntry )* ','? // mapPatternEntry ::= expression ':' pattern token = typeArg.parseArguments(token, this); - return parseMapPatternSuffix(token); + return parseMapPatternSuffix(token, + isRefutableContext: isRefutableContext); } // Whatever was after the optional type arguments didn't parse as a pattern // that can start with type arguments, so back up and reparse assuming that @@ -9265,7 +9280,8 @@ class Parser { listener.handleRecordPattern(next, /* count = */ 0); return nextNext; } else { - return parseParenthesizedPatternOrRecordPattern(token); + return parseParenthesizedPatternOrRecordPattern(token, + isRefutableContext: isRefutableContext); } case 'const': // constantPattern ::= booleanLiteral @@ -9335,7 +9351,8 @@ class Parser { if (optional('(', afterToken) && !potentialTypeArg.recovered) { TypeParamOrArgInfo typeArg = potentialTypeArg; token = typeArg.parseArguments(token, this); - token = parseExtractorPatternRest(token); + token = parseExtractorPatternRest(token, + isRefutableContext: isRefutableContext); listener.handleExtractorPattern(firstIdentifier, dot, secondIdentifier); return token; } else if (firstIdentifier.lexeme == '_' && dot == null) { @@ -9393,7 +9410,8 @@ class Parser { /// bracket. /// /// listPattern ::= typeArguments? '[' patterns? ']' - Token parseListPatternSuffix(Token token) { + Token parseListPatternSuffix(Token token, + {required bool isRefutableContext}) { Token beforeToken = token; Token beginToken = token = token.next!; assert(optional('[', token) || optional('[]', token)); @@ -9413,7 +9431,7 @@ class Parser { token = next; break; } - token = parsePattern(token); + token = parsePattern(token, isRefutableContext: isRefutableContext); next = token.next!; ++count; if (!optional(',', next)) { @@ -9455,7 +9473,7 @@ class Parser { /// mapPattern ::= typeArguments? '{' mapPatternEntries? '}' /// mapPatternEntries ::= mapPatternEntry ( ',' mapPatternEntry )* ','? /// mapPatternEntry ::= expression ':' pattern - Token parseMapPatternSuffix(Token token) { + Token parseMapPatternSuffix(Token token, {required bool isRefutableContext}) { Token leftBrace = token = token.next!; assert(optional('{', leftBrace)); Token next = token.next!; @@ -9476,7 +9494,7 @@ class Parser { codes.templateExpectedButGot.withArguments(':'), new SyntheticToken(TokenType.PERIOD, next.charOffset)); } - token = parsePattern(colon); + token = parsePattern(colon, isRefutableContext: isRefutableContext); listener.handleMapPatternEntry(colon, token.next!); ++count; next = token.next!; @@ -9520,7 +9538,8 @@ class Parser { /// recordPattern ::= '(' patternFields? ')' /// patternFields ::= patternField ( ',' patternField )* ','? /// patternField ::= ( identifier? ':' )? pattern - Token parseParenthesizedPatternOrRecordPattern(Token token) { + Token parseParenthesizedPatternOrRecordPattern(Token token, + {required bool isRefutableContext}) { Token begin = token.next!; assert(optional('(', begin)); @@ -9551,7 +9570,7 @@ class Parser { colon = token; wasValidRecord = true; } - token = parsePattern(token); + token = parsePattern(token, isRefutableContext: isRefutableContext); next = token.next!; if (wasRecord || colon != null) { listener.handlePatternField(colon); @@ -9594,7 +9613,8 @@ class Parser { /// /// extractorPattern ::= extractorName typeArguments? /// '(' patternFields? ')' - Token parseExtractorPatternRest(Token token) { + Token parseExtractorPatternRest(Token token, + {required bool isRefutableContext}) { Token begin = token = token.next!; assert(optional('(', begin)); int argumentCount = 0; @@ -9616,7 +9636,7 @@ class Parser { .next!; colon = token; } - token = parsePattern(token); + token = parsePattern(token, isRefutableContext: isRefutableContext); next = token.next!; listener.handlePatternField(colon); ++argumentCount; 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 868dc53f3756..3f92140bdd01 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 7996aaf5ea9e..3fbfc982e512 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 5009087c2882..fc5ed3ee1064 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 1c84a71fa90e..3748082a7635 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 86b41da2068f..c395f8691972 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 8930d0984931..fd1298cc36ef 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 ad43f1923e9e..5486447c34ce 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 975d0cee30c2..b74bd392866a 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 f0f83666ec08..16c402568e9c 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 9797f8bc42ce..7cab89c26cf4 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 9af53cc7c010..91512c6cadd8 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 41bea3439e90..a065cb627568 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 12c9b6c7db12..35564dec6edd 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 2d5363d21a9c..979d0e7805e3 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 30826493788c..defe4b81d3ed 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) 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 45ea09313fd5..6bb703da7c4b 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 @@ -110,13 +110,13 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, f) 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 b83f84cf2236..08b4a4672ba3 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 3257cb369648..c46ba3f0fe58 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, false) parseUnaryExpression([, false) parsePrimary([, expression) 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 8d5e4c5cb5da..c96c65bc0b29 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) @@ -81,8 +81,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: 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 69abbb335748..efda11138618 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) 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 af19e4c22c92..a0877120d4e9 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) @@ -81,8 +81,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: 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 8100474d4ca7..cd96946710d8 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) 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 399132c3ca20..3b038000faf9 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 e5e6e7c5ae22..6a42479dd636 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) 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 ead732091d2c..66311a9bc6eb 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, n) @@ -83,8 +83,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 ac02dd4f0cc4..b00ca6be9394 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 @@ -66,13 +66,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -87,8 +87,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 76aa2eb55082..da3a61987dac 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -85,8 +85,8 @@ parseUnit(test) listener: endAsOperatorType(as) listener: handleCastPattern(as) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 0e169f3aa9cb..3e14a371ad32 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 @@ -125,8 +125,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 0dc00e867779..743835a5fd69 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 2971f53f6654..a00fc6337ca0 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 aeb047d123d1..c57b7c19399d 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 c4a574252a8d..bbefd546aa5d 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 a88abe2d0329..eb768e6f3a81 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 4e8583c2700f..abb19d1dd662 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 @@ -125,8 +125,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 e813925c6cac..6e9c45f47af2 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 be768533a8d8..b75e11bf40e9 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 d3f376fc8267..d80aa31507ce 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 @@ -85,8 +85,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 8b7eb5db4a95..368ec52ce59a 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 75c5cb9cf0e7..828523b48d8c 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 768b4fdc2a76..6c82a3c6e99c 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 61f8eb293429..b1807df210a2 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 @@ -112,8 +112,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 583f782f9df7..6b8b02d3fc76 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 b0254249f2c6..238de782a23c 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 042359e718db..56adbd36c06a 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 98379af3d35a..8de5a6747ec7 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 0731a6a22bd2..d368ed60ae38 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 1ec022136725..1a3b7ab599c4 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 @@ -112,8 +112,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 7595c105d7b6..4d39de063ff8 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 @@ -99,8 +99,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, 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 ad4fbcae42ee..09bfb8e10355 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 @@ -99,8 +99,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 2c450672dcaf..37b88caec4d2 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 92f0c005eb31..515ca906a519 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 12e284af5e59..2e8504078535 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 bf78bf516d28..619a27a2e97a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 25113aaee83b..c4b26a2de0f6 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 685ebb33f1d2..ff82b600346a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 5d943a847fb0..feff29233482 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 a2fd81ee1cad..17fe59d4cb92 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 38e65785f328..12f0abb489f2 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 779c18ec787e..f6656100ab8a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 8723e0d76ff4..14d9f068e4eb 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 85e606a8406f..24eaaca4e5b3 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 f531f1252b94..6c0c03a579ad 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 0561593666a6..19e7ed863aed 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 95a52c6aaea0..39a37e132025 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 717753c78b51..46fde67de948 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 b77ab04a821f..b263742a535a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 0213d06090ab..313d165fef58 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 ee59b05c54af..9e53892365d9 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 99f329fb52bf..d4bd4bb7bee2 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 d4dc21259c25..f16257625ead 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 fedcdcf6e386..423bd717f6fc 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 09871bbfc422..25bc73e23b48 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 0d6653c0b9f1..d481b5f67902 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 27b171222200..ddac5ff739e0 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 9d055d39fa46..66feac7e829a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 fcabfdfb1612..24fe99d86133 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 850bd12cb7d7..00abf811f74b 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 d3e33b9d48c2..32b463fac08d 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 b5cf32bc375b..dfabc708911f 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 21c635de9c3a..178b9d0aee69 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 fd13ae8e1957..f8d86d1ecbd1 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 1b3926da0341..8bd540878e3a 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 63f019ae2f88..e009b2247f6f 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 2b1bc48b045b..83f9f77ab667 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 df46abd1d1bc..ece2d8177d91 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 81ae82c68386..ede2f866c17a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 aa5cd0a828c2..202355189267 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 18fa24cd8ca5..abf54e693577 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 80cbe50007fc..82c577e7c3a8 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 8beac7c90102..a569b7aa7540 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 0160f94b78f0..290d3df1b5d5 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 c64782c41cb0..189c35aa68ab 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 2d703cdbd2f6..41c2a635c126 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 497132e8d4c8..a6287ecd3f1d 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 5e8a01b1bf9b..eddfb0b5fc96 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 9bc194764e0c..65ad9fc0ac27 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 2c43f6d0a8a5..2b4e5a60ad4b 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 a1c32b29b787..266fdbef1b73 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 975ebe75a376..430729404e0e 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(const, 18, 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 e0d3d288f0a9..bdf3355a1d72 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 d98b164d356f..79eff8cdc099 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 22d940dc9b25..6d7546a79387 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 ce1b3e6926b7..4332ce742586 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 018394371de9..263c1b7c7644 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 46a13b6503d2..22b0d17e7e8d 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 dda0f22cb096..9d61ba1857f5 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 82878a2e80c3..374ca1537694 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 2054eb1bea21..18f9784e64fc 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 @@ -101,14 +101,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(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 20dfe6edf2ee..476ac825defa 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 @@ -118,18 +118,18 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 815e1eed0323..786790a7ebff 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 @@ -63,14 +63,14 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(_, ., 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 5c10837498d6..f211563dcfe8 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 @@ -63,10 +63,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(Future) + parseExtractorPatternRest(Future, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(_, ., 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 2a448db35588..a64c5cd737b4 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 @@ -63,14 +63,14 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(_, 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 d986d1a64c82..90ac1aa42777 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 @@ -63,10 +63,10 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(_) + parseExtractorPatternRest(_, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(_, null, null) ensureColon()) 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 ecab1c9b329f..94a611a59154 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, y) 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 f5f84cb17b14..42e0f01aa4bf 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, y) 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 4de8c545aff4..eae45995bcb4 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, y) 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 0b7c30a44050..5db860963bea 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, y) 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 9603bd27d396..ea87d4c6728d 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, y) 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 1f5762a7e03a..a358486a5ca5 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 c88cf9e10eb2..c1197a8f713d 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 614c4adc10d4..054537910c7b 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 f4cf9bf7b705..824e5e165b77 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 ceea25d4d7bc..46c6fe9acedc 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) 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 60ebb41e43d6..a4283d7fd9a3 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 @@ -66,20 +66,20 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, false) parseUnaryExpression([, false) parsePrimary([, expression) parseLiteralInt([) listener: handleLiteralInt(1) listener: handleConstantPattern(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 a98151dde25a..26318b4afcad 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([]) - parseListPatternSuffix(case) + parseListPatternSuffix(case, isRefutableContext: true) 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 79474fce3fcb..f17557919c47 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) + parseListPatternSuffix(case, isRefutableContext: true) 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 952bcd2c0fe7..5316bdebc1f3 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 @@ -66,24 +66,24 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseListPatternSuffix(>) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(>, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, false) parseUnaryExpression([, false) parsePrimary([, expression) parseLiteralInt([) listener: handleLiteralInt(1) listener: handleConstantPattern(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 6e80e126fba4..0ad447cac946 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, 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 1c4d23f28f39..c1a967a867c3 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, 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 ca9514f4971e..ba548a96c16e 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, false) parseUnaryExpression([, false) parsePrimary([, expression) 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 e771ddb2e67f..4b79461a1130 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 @@ -58,16 +58,16 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) 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 71ea2fe54f19..dca0d50bfa6c 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) @@ -83,8 +83,8 @@ parseUnit(test) listener: handleVariablePattern(null, _) listener: endBinaryPattern(&) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) 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 fe2d21235354..8fc5859703d5 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) @@ -83,8 +83,8 @@ parseUnit(test) listener: handleVariablePattern(null, _) listener: endBinaryPattern(&) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) 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 07d942c281fa..da5fba5c9612 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 @@ -66,24 +66,24 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) listener: handleType(double, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) 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 cdb314f9bec6..6bc0f976937d 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 @@ -58,16 +58,16 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) 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 39c78442696d..7dc91d3e0afd 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(?) listener: handleType(int, ?) listener: handleVariablePattern(null, _) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(double, typeReference) listener: handleNoTypeArguments(?) @@ -83,8 +83,8 @@ parseUnit(test) listener: handleVariablePattern(null, _) listener: endBinaryPattern(|) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleNullableType') listener: handleIdentifier(Object, typeReference) listener: handleNoTypeArguments(?) 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 390aa00207b4..39a37dad7cff 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -95,8 +95,8 @@ parseUnit(test) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 08f1d5501038..cdac22abd883 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) 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 afe592368c5c..3eb4d353aee3 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(String, typeReference) listener: handleNoTypeArguments(,) @@ -76,7 +76,7 @@ parseUnit(test) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(2, <, >) - parseMapPatternSuffix(>) + parseMapPatternSuffix(>, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -85,8 +85,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -102,8 +102,8 @@ parseUnit(test) parseSingleLiteralString(,) listener: beginLiteralString('b') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 45ff66fcb87c..26410df43c66 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 9a901d5f9453..33616fac1b9e 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 05722bd48502..5fead1d32715 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 8b7eb5db4a95..368ec52ce59a 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 a44f5f6a4dbe..dc785591d790 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) 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 7eda2ab74d6c..0161253229ea 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 @@ -110,13 +110,13 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, f) 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 1d4736ef989c..f21460d01ddf 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 32d738aa8cef..887baf9df0af 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, 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 6e096e797dbc..2dc68e0ffad9 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -76,8 +76,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, 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 9000f33c52f7..c26b62b149bd 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, 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 c781a145c3b7..61e77c15f415 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -76,8 +76,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, 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 77250b0edee0..289a90ea3185 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, 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 094806cf0749..14c391fb470a 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 6d6bf9cc75e1..cbff5d9669ed 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) 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 f3010895b1d5..67cf0d6ff7dd 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 @@ -66,19 +66,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, n) listener: handleNullAssertPattern(!) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 5f9ce6693f5b..49a4c403eec4 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 @@ -66,13 +66,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 bfe538e6cda1..7a007b0af3b0 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullAssertPattern(!) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 75c5cb9cf0e7..828523b48d8c 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 @@ -93,8 +93,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 d211e594701a..f8bb90d8f63f 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) 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 374eb1b015a7..8afc97e48766 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 @@ -110,13 +110,13 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, f) 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 5e55dc1f0106..4e308b39e3c5 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 b9d1b92dc68b..b401a3f6b205 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression([, 18, 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 c57cd6f12a87..40fd7a4e9180 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -76,8 +76,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, 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 c6d989f120e2..900135c2d3e3 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, 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 8aaf078f3b70..de6981e5baba 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -76,8 +76,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, 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 f570d85b15fd..8b1ac063afce 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, 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 24749af721f2..52b08bc6b454 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, 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 ac1f04bb4ecd..c31a963ee37e 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) 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 1b8f16df453c..5c1c33d9c99b 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 @@ -66,19 +66,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, n) listener: handleNullCheckPattern(?) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 d877ad6b81d7..49878a78c27a 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 @@ -66,13 +66,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(:, 18, false) parseUnaryExpression(:, false) parsePrimary(:, expression) @@ -81,8 +81,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 da807a7d7103..0d495712db15 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -79,8 +79,8 @@ parseUnit(test) listener: handleConstantPattern(null) listener: handleNullCheckPattern(?) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 0ca2f479ccd9..21ac9e44683a 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 99ea01db822f..77a1e5dfa02b 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 b43ee8ceb0a8..bfaad525c853 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 ecbc8e24b918..58c2cacff4c2 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 9b83ac60ce48..c358c9fd1a12 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) 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 0fdde0fbf040..47e1c9c090ee 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 @@ -64,11 +64,11 @@ parseUnit(f) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) 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 0314a37a7123..d7657d2e12ae 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, 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 b63a647b98c3..e122d373b305 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, 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 7de1b158cb19..2a1fb93ef246 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) 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 a7f6a9f2d800..6ed5860414ed 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 @@ -91,14 +91,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(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 fca1fe025a1a..54fe65f0f6e6 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 @@ -91,14 +91,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(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 4802b86f7085..a866dbacf09f 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 @@ -91,14 +91,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(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 80ba0d79d484..0d5e89368b93 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 @@ -91,14 +91,14 @@ parseUnit(import) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: beginTypeArguments(<) listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(>) listener: handleType(int, null) listener: endTypeArguments(1, <, >) - parseExtractorPatternRest(>) + parseExtractorPatternRest(>, isRefutableContext: true) listener: handleExtractorPatternFields(0, (, )) listener: handleExtractorPattern(async, ., Future) listener: handleNullCheckPattern(?) 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 8e7696c2fb23..041c0e2e36ec 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 e5565e4c8e6b..8ed5525a0b67 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) 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 b642c990037d..0b43ded4394f 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, 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 6c1796fbc21e..6f10b80cca5e 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 13a29178ed28..8a21872058a0 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 0776db57183c..8f1bbdf1414c 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression((, 18, false) parseUnaryExpression((, false) parsePrimary((, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 760d6ba9c0fd..5340923b117f 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 ce1cd58f113d..86d95db01680 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(>, 13, 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 869f89dd84bf..fe90943ff06f 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(>=, 13, 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 064a12e34029..7853f9f7a2b6 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(<, 13, 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 ead5a39b0bda..8cccb35de803 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(<=, 13, 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 cf5c6748f983..916befcadb60 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(!=, 13, 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 d876757ed9d0..0714d7689406 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 4895a5dbe45d..718f4463ed6e 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 dab52143a30c..bb7e9c340153 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 ab4f90dba077..914d5d093c85 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(==, 13, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, 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 b9793579b8b1..ae034b4b4341 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 27239967f149..dd65e02bd4c8 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(==, 13, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, 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 e41a46f17b93..36486f265048 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 31c109efa568..63d206e54af5 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 b250706bf478..948b22b028d9 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression(==, 13, 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 7faea0255ccd..5917779ec09e 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 @@ -66,13 +66,13 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parsePrecedenceExpression(==, 13, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -80,8 +80,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, 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 611f7faf02c0..9297798ae8cd 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) + parsePattern((, precedence: 1, isRefutableContext: true) + parsePrimaryPattern((, isRefutableContext: true) parsePrecedenceExpression(==, 13, false) parseUnaryExpression(==, false) parsePrimary(==, expression) @@ -78,8 +78,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleRelationalPattern(==) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, false) parseUnaryExpression(,, false) parsePrimary(,, expression) 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 8f86e8aa1508..6973a1ea0c75 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 9edeefd53ad5..89e33d91dc0c 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 a17b01ccd0f9..2f3bd0394b29 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 168df474f886..3e4f1e6d027c 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, 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 1ae834df2268..fa3b28e90873 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) 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 841595d71313..26adc447d9eb 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 e5d412086734..a5e6002440f2 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 2ad29dcaebaf..198b840ff023 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 531c8c39ec40..8ecdc638a9c0 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 97877d01cb3d..b7fa4fe463b8 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 f225c24d9ca5..9d0ebe309d07 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 c693dc6493c4..32b657dc6dc0 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 9e1537960837..57845a163a3c 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 9d2b5983703c..692a7904683c 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 8dd691804135..10c010c9b68f 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(y) 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 427306949c88..0a599acb03c0 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 1a663ac2857c..cc3937477fc9 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 7112a0eb43f3..c77fb011fe3f 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 @@ -110,14 +110,14 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) ensureIdentifier((, namedArgumentReference) listener: handleIdentifier(f, namedArgumentReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 9a8c294c2722..2e691b50dba4 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 @@ -110,13 +110,13 @@ parseUnit(class) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments(() - parseExtractorPatternRest(C) + parseExtractorPatternRest(C, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 dafb05b12b7e..87a2b8d443e1 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 520510091e09..280b02689ae3 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 @@ -66,12 +66,12 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments([) - parseListPatternSuffix(case) - parsePattern([, precedence: 1) - parsePrimaryPattern([) + parseListPatternSuffix(case, isRefutableContext: true) + parsePattern([, precedence: 1, isRefutableContext: true) + parsePrimaryPattern([, isRefutableContext: true) parseVariablePattern([, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 83daa6e76677..4d10152057c7 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) listener: handleVariablePattern(null, as) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parsePrecedenceExpression(&, 18, false) parseUnaryExpression(&, false) parsePrimary(&, expression) 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 00a714361434..811f26d1f207 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(&) - parsePattern(&, precedence: 12) - parsePrimaryPattern(&) + parsePattern(&, precedence: 12, isRefutableContext: true) + parsePrimaryPattern(&, isRefutableContext: true) parseVariablePattern(&, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 54d3c673bbbb..038fdfa6504a 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 @@ -66,16 +66,16 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) listener: handleVariablePattern(null, as) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parsePrecedenceExpression(|, 18, false) parseUnaryExpression(|, false) parsePrimary(|, expression) 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 3ef35e85e8e1..a0530cbe07b7 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parsePrecedenceExpression(case, 18, false) parseUnaryExpression(case, false) parsePrimary(case, expression) @@ -75,8 +75,8 @@ parseUnit(test) listener: handleLiteralInt(1) listener: handleConstantPattern(null) listener: beginBinaryPattern(|) - parsePattern(|, precedence: 10) - parsePrimaryPattern(|) + parsePattern(|, precedence: 10, isRefutableContext: true) + parsePrimaryPattern(|, isRefutableContext: true) parseVariablePattern(|, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 dab797af1a8c..fa4cd2be8864 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 @@ -66,10 +66,10 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) listener: handleNoTypeArguments({) - parseMapPatternSuffix(case) + parseMapPatternSuffix(case, isRefutableContext: true) parseExpression({) parsePrecedenceExpression({, 1, true) parseUnaryExpression({, true) @@ -78,8 +78,8 @@ parseUnit(test) parseSingleLiteralString({) listener: beginLiteralString('a') listener: endLiteralString(0, :) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 11050e4da378..79cb5255cbae 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 916fa3618b1c..468aaf3a4004 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 c1e5da36fdaf..b92aabd9cf60 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 @@ -66,11 +66,11 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + 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') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) 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 19a18fe7cacf..fb58b0749854 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 @@ -66,20 +66,20 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) listener: handleNoName(() - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) listener: handleVariablePattern(null, as) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, false) parseUnaryExpression(,, false) parsePrimary(,, expression) 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 40834e4728cb..bac9c0243e96 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 @@ -66,21 +66,21 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) + parseParenthesizedPatternOrRecordPattern(case, isRefutableContext: true) ensureIdentifier((, namedRecordFieldReference) listener: handleIdentifier(n, namedRecordFieldReference) - parsePattern(:, precedence: 1) - parsePrimaryPattern(:) + parsePattern(:, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(:, isRefutableContext: true) parseVariablePattern(:, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) listener: handleVariablePattern(null, as) listener: handlePatternField(:) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, false) parseUnaryExpression(,, false) parsePrimary(,, expression) 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 69628f9d7cfb..40d5ae037ea2 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 @@ -66,19 +66,19 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) - parseParenthesizedPatternOrRecordPattern(case) - parsePattern((, precedence: 1) - parsePrimaryPattern(() + 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') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(as) listener: handleType(int, null) listener: handleVariablePattern(null, as) listener: handlePatternField(null) - parsePattern(,, precedence: 1) - parsePrimaryPattern(,) + parsePattern(,, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(,, isRefutableContext: true) parsePrecedenceExpression(,, 18, false) parseUnaryExpression(,, false) parsePrimary(,, expression) 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 b6ceb40a3538..2c66d0f396be 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 334007180cf9..424d45bc1125 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 b2860b84aaa2..f68d9bc16175 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 @@ -58,8 +58,8 @@ parseUnit(test) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 f9f4eb52f0fa..ae4824643d27 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 2b1bef637328..0705abf61140 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 @@ -66,8 +66,8 @@ parseUnit(test) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, y) 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 8040281c634c..d82cfb4f517e 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(_, typeReference) listener: handleNoTypeArguments(y) 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 503e8bf0cb38..680404893ef4 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(case) listener: handleVariablePattern(null, _) 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 45e6e84e151b..d773f2906536 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(case) listener: handleVariablePattern(null, _) 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 8844412e736a..18392441b912 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(case) listener: handleVariablePattern(null, _) 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 09635f991c95..68a5dc24286c 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(case) listener: handleVariablePattern(null, _) 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 36be354aba5b..de53c919fce4 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(case) listener: handleVariablePattern(null, _) 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 11195aa7f889..8e80138f8a14 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: 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 394238add29d..d698d6fbb9cf 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 e045e2ca9c56..7c30472ac6c0 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 6f4c2ee0856f..c83bdc1530cf 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 2581ab3cb376..8da3764a0376 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 6684d36a304e..d284938c5b0d 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, _) 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 4f74bea61434..f732604dde10 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, _) 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 395432affa69..2e7ad3c9fa10 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, _) 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 c8cf3d20c145..397f084d1ce7 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, _) 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 fbe75e4d915f..385282b40e0d 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(final) listener: handleVariablePattern(final, _) 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 034dd74db95b..df1580e6d902 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: 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 b901db3efa48..f0eacebef482 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 e04032067039..e0200ee3f261 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 8109b57a3aa4..4e011f8062fd 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 fc4869e8b6f1..598dd9230032 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'SimpleType') listener: handleIdentifier(int, typeReference) listener: handleNoTypeArguments(_) 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 107b7509ea28..725ffbe14315 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, _) 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 a8c88a3b7b3d..a3ca0154caa2 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, _) 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 2b383bb45a8b..b928f91f5338 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 @@ -55,8 +55,8 @@ parseUnit(void) parseArgumentsOpt(x) listener: handleNoArguments(case) listener: handleSend(x, case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, _) 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 988667e9a1ab..7e7b70c3bb6e 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, _) 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 673783d0a6ce..b91b6f7a99bf 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 @@ -63,8 +63,8 @@ parseUnit(void) notEofOrValue(}, case) peekPastLabels(case) listener: beginCaseExpression(case) - parsePattern(case, precedence: 1) - parsePrimaryPattern(case) + parsePattern(case, precedence: 1, isRefutableContext: true) + parsePrimaryPattern(case, isRefutableContext: true) parseVariablePattern(case, typeInfo: Instance of 'NoType') listener: handleNoType(var) listener: handleVariablePattern(var, _) diff --git a/pkg/front_end/test/parser_test_parser.dart b/pkg/front_end/test/parser_test_parser.dart index 27b9baf62696..6a0635a6852b 100644 --- a/pkg/front_end/test/parser_test_parser.dart +++ b/pkg/front_end/test/parser_test_parser.dart @@ -2641,19 +2641,27 @@ class TestParser extends Parser { } @override - Token parsePattern(Token token, {int precedence = 1}) { - doPrint('parsePattern(' '$token, ' 'precedence: $precedence)'); + Token parsePattern(Token token, + {int precedence = 1, required bool isRefutableContext}) { + doPrint('parsePattern(' + '$token, ' + 'precedence: $precedence, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parsePattern(token, precedence: precedence); + var result = super.parsePattern(token, + precedence: precedence, isRefutableContext: isRefutableContext); indent--; return result; } @override - Token parsePrimaryPattern(Token token) { - doPrint('parsePrimaryPattern(' '$token)'); + Token parsePrimaryPattern(Token token, {required bool isRefutableContext}) { + doPrint('parsePrimaryPattern(' + '$token, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parsePrimaryPattern(token); + var result = super + .parsePrimaryPattern(token, isRefutableContext: isRefutableContext); indent--; return result; } @@ -2668,37 +2676,52 @@ class TestParser extends Parser { } @override - Token parseListPatternSuffix(Token token) { - doPrint('parseListPatternSuffix(' '$token)'); + Token parseListPatternSuffix(Token token, + {required bool isRefutableContext}) { + doPrint('parseListPatternSuffix(' + '$token, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parseListPatternSuffix(token); + var result = super + .parseListPatternSuffix(token, isRefutableContext: isRefutableContext); indent--; return result; } @override - Token parseMapPatternSuffix(Token token) { - doPrint('parseMapPatternSuffix(' '$token)'); + Token parseMapPatternSuffix(Token token, {required bool isRefutableContext}) { + doPrint('parseMapPatternSuffix(' + '$token, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parseMapPatternSuffix(token); + var result = super + .parseMapPatternSuffix(token, isRefutableContext: isRefutableContext); indent--; return result; } @override - Token parseParenthesizedPatternOrRecordPattern(Token token) { - doPrint('parseParenthesizedPatternOrRecordPattern(' '$token)'); + Token parseParenthesizedPatternOrRecordPattern(Token token, + {required bool isRefutableContext}) { + doPrint('parseParenthesizedPatternOrRecordPattern(' + '$token, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parseParenthesizedPatternOrRecordPattern(token); + var result = super.parseParenthesizedPatternOrRecordPattern(token, + isRefutableContext: isRefutableContext); indent--; return result; } @override - Token parseExtractorPatternRest(Token token) { - doPrint('parseExtractorPatternRest(' '$token)'); + Token parseExtractorPatternRest(Token token, + {required bool isRefutableContext}) { + doPrint('parseExtractorPatternRest(' + '$token, ' + 'isRefutableContext: $isRefutableContext)'); indent++; - var result = super.parseExtractorPatternRest(token); + var result = super.parseExtractorPatternRest(token, + isRefutableContext: isRefutableContext); indent--; return result; } diff --git a/pkg/front_end/test/spell_checking_list_code.txt b/pkg/front_end/test/spell_checking_list_code.txt index 5ca9410c423d..9862f6d4728d 100644 --- a/pkg/front_end/test/spell_checking_list_code.txt +++ b/pkg/front_end/test/spell_checking_list_code.txt @@ -1056,6 +1056,7 @@ producers product profile progresses +prohibited promo promotability proof