Binding pattern naming cleanup (#3410)

- Rename `PatternBinding` to `BindingPattern`.
- Use `BindingPattern` rather than `Pattern` in the names of
binding-pattern-specific parse states.
This commit is contained in:
Geoff Romer
2023-12-01 21:36:51 +00:00
committed by GitHub
parent 18c3622bec
commit b8d4e2f41b
131 changed files with 349 additions and 278 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ auto HandleVariableDecl(Context& context, Parse::NodeId parse_node) -> bool {
auto init_id = SemIR::InstId::Invalid;
bool has_init =
context.parse_tree().node_kind(context.node_stack().PeekParseNode()) !=
Parse::NodeKind::PatternBinding;
Parse::NodeKind::BindingPattern;
if (has_init) {
init_id = context.node_stack().PopExpr();
context.node_stack()
@@ -42,7 +42,7 @@ auto HandleVariableDecl(Context& context, Parse::NodeId parse_node) -> bool {
}
// Extract the name binding.
auto value_id = context.node_stack().Pop<Parse::NodeKind::PatternBinding>();
auto value_id = context.node_stack().Pop<Parse::NodeKind::BindingPattern>();
if (auto bind_name = context.insts().Get(value_id).TryAs<SemIR::BindName>()) {
// Form a corresponding name in the current context, and bind the name to
// the variable.