mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:21:21 +01:00
Refactor subpattern logic out of Context (#4929)
Note this is building on #4927 which factors out RegionStack, because this heavily uses the region stack. However, it's a more complex level of logic that appears specific to pattern handling. I've moved InsertHere to pattern_match.cpp because it appears to be in specific use there.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "toolchain/check/handle.h"
|
||||
#include "toolchain/check/interface.h"
|
||||
#include "toolchain/check/return.h"
|
||||
#include "toolchain/check/subpattern.h"
|
||||
#include "toolchain/check/type_completion.h"
|
||||
#include "toolchain/diagnostics/format_providers.h"
|
||||
#include "toolchain/sem_ir/ids.h"
|
||||
@@ -24,7 +25,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
// TODO: Handle `_` bindings.
|
||||
|
||||
SemIR::ExprRegionId type_expr_region_id =
|
||||
context.EndSubpatternAsExpr(cast_type_inst_id);
|
||||
EndSubpatternAsExpr(context, cast_type_inst_id);
|
||||
|
||||
// Every other kind of pattern binding has a name.
|
||||
auto [name_node, name_id] = context.node_stack().PopNameWithNodeId();
|
||||
|
||||
Reference in New Issue
Block a user