Added some initial directive code. Don't quite like the way it's done

This commit is contained in:
2025-09-03 21:05:00 +02:00
parent 603b625e21
commit 4924b01eac
4 changed files with 50 additions and 29 deletions

View File

@@ -55,6 +55,9 @@ Typenames :: string.[
"bool" ,
];
//@Incomplete(niels): We can vastly simplify type handling
// There's really no reason to have these type variables anymore now that we don't do union find
// We can just have the built-in types and then we can declare structs, functions, buffers etc. as one time things.
Type_Variable :: struct {
type : Type_Kind;
kind : Type_Variable_Kind;
@@ -1432,8 +1435,6 @@ check_node :: (checker : *Semantic_Checker, node : *AST_Node) -> Type_Variable_H
lhs_type := from_handle(checker, lhs_var);
rhs_type := from_handle(checker, rhs_var);
variable.type = lhs_type.type;
variable.typename = lhs_type.typename;
variable.scope = lhs_type.scope;
@@ -1532,6 +1533,10 @@ check_node :: (checker : *Semantic_Checker, node : *AST_Node) -> Type_Variable_H
}
}
}
case .If_Directive; {
cond_var := check_node(checker, node.children[0]);
assert(false, "Not implemented yet\n");
}
case .Variable; {
return check_variable(checker, node);
}