mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:54:47 +01:00
Add a Field node for fields in a class. (#3332)
This replaces the use of `VarStorage` in this case. Add an `UnboundFieldType` type as the type of a field, in cases where it's referenced without an accompanying object. Add a `BindName` node to describe the name binding performed for both variables and fields so that we can handle them more uniformly.
This commit is contained in:
@@ -103,8 +103,9 @@ auto HandleClassDefinitionStart(Context& context, Parse::Node parse_node)
|
||||
}
|
||||
|
||||
// Enter the class scope.
|
||||
context.PushScope(class_info.scope_id);
|
||||
context.PushScope(class_decl_id, class_info.scope_id);
|
||||
context.node_block_stack().Push();
|
||||
context.node_stack().Push(parse_node, class_id);
|
||||
|
||||
// TODO: Handle the case where there's control flow in the class body. For
|
||||
// example:
|
||||
@@ -120,6 +121,7 @@ auto HandleClassDefinitionStart(Context& context, Parse::Node parse_node)
|
||||
|
||||
auto HandleClassDefinition(Context& context, Parse::Node /*parse_node*/)
|
||||
-> bool {
|
||||
context.node_stack().Pop<Parse::NodeKind::ClassDefinitionStart>();
|
||||
context.node_block_stack().Pop();
|
||||
context.PopScope();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user