Import message
This commit is contained in:
@@ -217,6 +217,8 @@ note_struct :: (code_struct: *Code_Struct) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import: *Message_Import;
|
||||||
|
|
||||||
message_loop :: () {
|
message_loop :: () {
|
||||||
while true {
|
while true {
|
||||||
message := compiler_wait_for_message();
|
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
|
// 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.
|
// being typechecked, we want to generate our new code.
|
||||||
if message.kind == {
|
if message.kind == {
|
||||||
|
case .IMPORT; {
|
||||||
|
import := cast(*Message_Import)message;
|
||||||
|
if import.module_name == "Coven" {
|
||||||
|
message = import;
|
||||||
|
}
|
||||||
|
}
|
||||||
case .TYPECHECKED;
|
case .TYPECHECKED;
|
||||||
typechecked := cast(*Message_Typechecked) message;
|
typechecked := cast(*Message_Typechecked) message;
|
||||||
for typechecked.structs {
|
for typechecked.structs {
|
||||||
@@ -293,7 +301,7 @@ generate_code :: (w: Workspace) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
build_string := sprint(INIT_SCENE, builder_to_string(*builder));
|
build_string := sprint(INIT_SCENE, builder_to_string(*builder));
|
||||||
add_build_string(build_string, w);
|
add_build_string(build_string, w, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user