mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 11:55:51 +01:00
Factor param/arg ref logic to a class. (#3728)
Just segmenting out a chunk of logic while I'm thinking about function parameters.
This commit is contained in:
@@ -16,7 +16,7 @@ auto HandleStructLiteralOrStructTypeLiteralStart(
|
||||
// so we push onto args irrespective. It just won't be used for a type
|
||||
// literal.
|
||||
context.args_type_info_stack().Push();
|
||||
context.ParamOrArgStart();
|
||||
context.param_and_arg_refs_stack().Push();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ auto HandleStructFieldDesignator(Context& context,
|
||||
|
||||
auto HandleStructComma(Context& context, Parse::StructCommaId /*parse_node*/)
|
||||
-> bool {
|
||||
context.ParamOrArgComma();
|
||||
context.param_and_arg_refs_stack().ApplyComma();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ static auto DiagnoseDuplicateNames(Context& context,
|
||||
|
||||
auto HandleStructLiteral(Context& context, Parse::StructLiteralId parse_node)
|
||||
-> bool {
|
||||
auto refs_id = context.ParamOrArgEnd(
|
||||
auto refs_id = context.param_and_arg_refs_stack().EndAndPop(
|
||||
Parse::NodeKind::StructLiteralOrStructTypeLiteralStart);
|
||||
|
||||
context.scope_stack().Pop();
|
||||
@@ -114,7 +114,7 @@ auto HandleStructLiteral(Context& context, Parse::StructLiteralId parse_node)
|
||||
|
||||
auto HandleStructTypeLiteral(Context& context,
|
||||
Parse::StructTypeLiteralId parse_node) -> bool {
|
||||
auto refs_id = context.ParamOrArgEnd(
|
||||
auto refs_id = context.param_and_arg_refs_stack().EndAndPop(
|
||||
Parse::NodeKind::StructLiteralOrStructTypeLiteralStart);
|
||||
|
||||
context.scope_stack().Pop();
|
||||
|
||||
Reference in New Issue
Block a user