mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Put check stage handle functions in execution order (#3573)
No changes other than moving code and adding section comments.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user