mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 20:46:42 +00:00
Unify DeclaredName and DesignatedName as just Identifier (#2939)
This is just a simplification: I think these different forms are getting in the way more than they're helping, particularly as I was looking into namespace functionality. The handling in semantics can be identical, providing a more uniform behavior.
This commit is contained in:
1 parent
2e7ce09c34
commit
5a90f660b9
188 files changed
+487
-498
No files matched your search
@@ -21,7 +21,7 @@ auto SemanticsHandleStructFieldDesignator(SemanticsContext& context,
|
||||
// This leaves the designated name on top because the `.` isn't interesting.
|
||||
CARBON_CHECK(
|
||||
context.parse_tree().node_kind(context.node_stack().PeekParseNode()) ==
|
||||
ParseNodeKind::DesignatedName);
|
||||
ParseNodeKind::Identifier);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ auto SemanticsHandleStructFieldType(SemanticsContext& context,
|
||||
|
||||
auto [name_node, name_id] =
|
||||
context.node_stack().PopWithParseNode<SemanticsStringId>(
|
||||
ParseNodeKind::DesignatedName);
|
||||
ParseNodeKind::Identifier);
|
||||
|
||||
context.AddNode(
|
||||
SemanticsNode::StructTypeField::Make(name_node, cast_type_id, name_id));
|
||||
@@ -50,8 +50,8 @@ auto SemanticsHandleStructFieldValue(SemanticsContext& context,
|
||||
ParseTree::Node parse_node) -> bool {
|
||||
auto [value_parse_node, value_node_id] =
|
||||
context.node_stack().PopWithParseNode<SemanticsNodeId>();
|
||||
auto name_id = context.node_stack().Pop<SemanticsStringId>(
|
||||
ParseNodeKind::DesignatedName);
|
||||
auto name_id =
|
||||
context.node_stack().Pop<SemanticsStringId>(ParseNodeKind::Identifier);
|
||||
|
||||
// Store the name for the type.
|
||||
auto type_block_id = context.args_type_info_stack().PeekForAdd();
|
||||
|
||||
Reference in new issue
Block a user