Abbreviate "parameter" -> "param" (#3392)

Part of switching to the [abbreviations we've decided to
use](https://docs.google.com/document/d/1RRYMm42osyqhI2LyjrjockYCutQ5dOf8Abu50kTrkX0/edit?resourcekey=0-kHyqOESbOHmzZphUbtLrTw#heading=h.pph7i5m5un7q).

I will rename files in a follow-up PR.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
josh11bandJon Ross-Perkins authored and GitHub committed 2023-11-13 19:06:54 +00:00
1 parent 522dcc44c5
commit c53b248800
142 files changed
+614 -640

No files matched your search

+12 -13
View File
@@ -13,13 +13,13 @@ auto HandleAddress(Context& context, Parse::Node parse_node) -> bool {
auto self_param_id =
context.node_stack().Peek<Parse::NodeKind::PatternBinding>();
if (auto self_param =
context.insts().Get(self_param_id).TryAs<SemIR::SelfParameter>()) {
context.insts().Get(self_param_id).TryAs<SemIR::SelfParam>()) {
self_param->is_addr_self = SemIR::BoolValue::True;
context.insts().Set(self_param_id, *self_param);
} else {
CARBON_DIAGNOSTIC(AddrOnNonSelfParameter, Error,
CARBON_DIAGNOSTIC(AddrOnNonSelfParam, Error,
"`addr` can only be applied to a `self` parameter.");
context.emitter().Emit(parse_node, AddrOnNonSelfParameter);
context.emitter().Emit(parse_node, AddrOnNonSelfParam);
}
return true;
}
@@ -40,16 +40,15 @@ auto HandlePatternBinding(Context& context, Parse::Node parse_node) -> bool {
context.node_stack()
.PopForSoloParseNodeIf<Parse::NodeKind::SelfValueName>()) {
if (context.parse_tree().node_kind(context.node_stack().PeekParseNode()) !=
Parse::NodeKind::ImplicitParameterListStart) {
Parse::NodeKind::ImplicitParamListStart) {
CARBON_DIAGNOSTIC(
SelfOutsideImplicitParameterList, Error,
SelfOutsideImplicitParamList, Error,
"`self` can only be declared in an implicit parameter list.");
context.emitter().Emit(parse_node, SelfOutsideImplicitParameterList);
context.emitter().Emit(parse_node, SelfOutsideImplicitParamList);
}
context.AddInstAndPush(
parse_node,
SemIR::SelfParameter{*self_node, cast_type_id,
/*is_addr_self=*/SemIR::BoolValue::False});
parse_node, SemIR::SelfParam{*self_node, cast_type_id,
/*is_addr_self=*/SemIR::BoolValue::False});
return true;
}
@@ -115,12 +114,12 @@ auto HandlePatternBinding(Context& context, Parse::Node parse_node) -> bool {
break;
}
case Parse::NodeKind::ImplicitParameterListStart:
case Parse::NodeKind::ParameterListStart:
case Parse::NodeKind::ImplicitParamListStart:
case Parse::NodeKind::ParamListStart:
// Parameters can have incomplete types in a function declaration, but not
// in a function definition. We don't know which kind we have here.
context.AddInstAndPush(
parse_node, SemIR::Parameter{name_node, cast_type_id, name_id});
context.AddInstAndPush(parse_node,
SemIR::Param{name_node, cast_type_id, name_id});
// TODO: Create a `BindName` instruction.
break;