mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-29 22:02:42 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user