Add Properties prefix. Fix semantic check regression.
This commit is contained in:
17
Codegen.jai
17
Codegen.jai
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user