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:
Richard Smith
2023-10-25 18:49:36 +00:00
committed by GitHub
parent 74c3c665fa
commit 7f2f4bec4f
107 changed files with 792 additions and 450 deletions
+3 -1
View File
@@ -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();