Import message

This commit is contained in:
2024-12-01 21:32:35 +01:00
parent ff74156d60
commit 6d91122f08

View File

@@ -217,6 +217,8 @@ note_struct :: (code_struct: *Code_Struct) {
}
}
import: *Message_Import;
message_loop :: () {
while true {
message := compiler_wait_for_message();
@@ -224,6 +226,12 @@ message_loop :: () {
// so that we can look for the data structures we care about; or, when all the code is done
// being typechecked, we want to generate our new code.
if message.kind == {
case .IMPORT; {
import := cast(*Message_Import)message;
if import.module_name == "Coven" {
message = import;
}
}
case .TYPECHECKED;
typechecked := cast(*Message_Typechecked) message;
for typechecked.structs {
@@ -293,7 +301,7 @@ generate_code :: (w: Workspace) {
}
build_string := sprint(INIT_SCENE, builder_to_string(*builder));
add_build_string(build_string, w);
add_build_string(build_string, w, message);
}
{