Support tuple patterns outside parameter lists (#4923)

Parameter lists need substantially different treatment than tuple
patterns in other contexts, so this change splits them into separate
parse node kinds.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Geoff Romer
2025-02-20 03:17:45 +00:00
committed by GitHub
co-authored by Jon Ross-Perkins
parent 35f5a7f115
commit 74e1a9949f
201 changed files with 1680 additions and 860 deletions
+3 -2
View File
@@ -16,11 +16,12 @@ auto PopNameComponent(Context& context, SemIR::InstId return_slot_pattern_id)
// Explicit params.
auto [params_loc_id, param_patterns_id] =
context.node_stack().PopWithNodeIdIf<Parse::NodeKind::TuplePattern>();
context.node_stack()
.PopWithNodeIdIf<Parse::NodeKind::ExplicitParamList>();
if (param_patterns_id) {
first_param_node_id =
context.node_stack()
.PopForSoloNodeId<Parse::NodeKind::TuplePatternStart>();
.PopForSoloNodeId<Parse::NodeKind::ExplicitParamListStart>();
last_param_node_id = params_loc_id;
} else {
param_patterns_id = SemIR::InstBlockId::None;