Put check stage handle functions in execution order (#3573)

No changes other than moving code and adding section comments.
This commit is contained in:
josh11b
2024-01-09 02:46:10 +00:00
committed by GitHub
parent a196b9840f
commit 0b9e73ab07
8 changed files with 223 additions and 211 deletions
+22 -22
View File
@@ -6,17 +6,6 @@
namespace Carbon::Check {
auto HandleImplicitParamList(Context& context,
Parse::ImplicitParamListId parse_node) -> bool {
auto refs_id = context.ParamOrArgEnd(Parse::NodeKind::ImplicitParamListStart);
context.node_stack()
.PopAndDiscardSoloParseNode<Parse::NodeKind::ImplicitParamListStart>();
context.node_stack().Push(parse_node, refs_id);
// The implicit parameter list's scope extends to the end of the following
// parameter list.
return true;
}
auto HandleImplicitParamListStart(Context& context,
Parse::ImplicitParamListStartId parse_node)
-> bool {
@@ -26,19 +15,14 @@ auto HandleImplicitParamListStart(Context& context,
return true;
}
auto HandleTuplePattern(Context& context, Parse::TuplePatternId parse_node)
-> bool {
auto refs_id = context.ParamOrArgEnd(Parse::NodeKind::TuplePatternStart);
context.PopScope();
auto HandleImplicitParamList(Context& context,
Parse::ImplicitParamListId parse_node) -> bool {
auto refs_id = context.ParamOrArgEnd(Parse::NodeKind::ImplicitParamListStart);
context.node_stack()
.PopAndDiscardSoloParseNode<Parse::NodeKind::TuplePatternStart>();
.PopAndDiscardSoloParseNode<Parse::NodeKind::ImplicitParamListStart>();
context.node_stack().Push(parse_node, refs_id);
return true;
}
auto HandlePatternListComma(Context& context,
Parse::PatternListCommaId /*parse_node*/) -> bool {
context.ParamOrArgComma();
// The implicit parameter list's scope extends to the end of the following
// parameter list.
return true;
}
@@ -61,4 +45,20 @@ auto HandleTuplePatternStart(Context& context,
return true;
}
auto HandlePatternListComma(Context& context,
Parse::PatternListCommaId /*parse_node*/) -> bool {
context.ParamOrArgComma();
return true;
}
auto HandleTuplePattern(Context& context, Parse::TuplePatternId parse_node)
-> bool {
auto refs_id = context.ParamOrArgEnd(Parse::NodeKind::TuplePatternStart);
context.PopScope();
context.node_stack()
.PopAndDiscardSoloParseNode<Parse::NodeKind::TuplePatternStart>();
context.node_stack().Push(parse_node, refs_id);
return true;
}
} // namespace Carbon::Check