Add Properties prefix. Fix semantic check regression.

This commit is contained in:
2024-09-26 16:47:34 +02:00
parent e365067354
commit 90fb1a035e
5 changed files with 28 additions and 17 deletions

View File

@@ -91,11 +91,15 @@ emit_field :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
field := h2tv(state.type_variables, find_result.type_variable);
indent(state, indentation);
print_to_builder(*state.builder, "% ", dx11_type_to_string(field));
print("% %", node.parent.kind, node.parent.parent.kind);
if node.parent.parent.kind == .Properties {
// append(*state.builder, "__PROPERTIES__");
if field.struct_field_parent {
parent_tv := h2tv(state.type_variables, field.struct_field_parent.type_variable);
if parent_tv.typename == "properties" {
append(*state.builder, "__PROPERTIES__");
}
}
print_to_builder(*state.builder, "%", node.name);
@@ -379,6 +383,13 @@ emit_node :: (state : *Codegen_State, node : *AST_Node, indentation : int) {
is_properties := type_var.typename == "properties";
if !is_properties {
if type_var.struct_field_parent {
parent_tv := h2tv(state.type_variables, type_var.struct_field_parent.type_variable);
if parent_tv.typename == "properties" {
append(*state.builder, "__PROPERTIES__");
}
}
print_to_builder(*state.builder, "%", node.name);
}