Rename Name -> IdentifierName given that we have several other kinds of parse nodes that represent names. (#3453)

Factor out common checking handling for the different kinds of
unqualified names
This commit is contained in:
Richard Smith
2023-12-07 01:48:14 +00:00
committed by GitHub
parent bf8697113a
commit fe6f7b4330
201 changed files with 712 additions and 725 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ static auto HandleBindingPattern(Context& context,
// The first item should be an identifier or `self`.
bool has_name = false;
if (auto identifier = context.ConsumeIf(Lex::TokenKind::Identifier)) {
context.AddLeafNode(NodeKind::Name, *identifier);
context.AddLeafNode(NodeKind::IdentifierName, *identifier);
has_name = true;
} else if (auto self =
context.ConsumeIf(Lex::TokenKind::SelfValueIdentifier)) {
@@ -68,7 +68,7 @@ static auto HandleBindingPattern(Context& context,
}
if (!has_name) {
// Add a placeholder for the name.
context.AddLeafNode(NodeKind::Name, *context.position(),
context.AddLeafNode(NodeKind::IdentifierName, *context.position(),
/*has_error=*/true);
on_error();
return;