diff --git a/source/runtime.cpp b/source/runtime.cpp index 05a93ed..29c2cd4 100644 --- a/source/runtime.cpp +++ b/source/runtime.cpp @@ -4,6 +4,7 @@ import app; import coral; import coral.files; +import coral.io; import coral.math; import coral.sequence; @@ -29,7 +30,6 @@ extern "C" int main(int argc, char const * const * argv) { } coral::stack script_source{allocator}; - { coral::u8 stream_buffer[1024]{0}; coral::sequence_writer script_writer{&script_source}; @@ -38,7 +38,7 @@ extern "C" int main(int argc, char const * const * argv) { } vm.with_object(vm.compile(coral::slice{script_source.begin(), script_source.end()}.as_chars()), [&](kym::bound_object & script) { - vm.with_object(script.call({}), [&](kym::bound_object config) { + vm.with_object(script.call({}), [&](kym::bound_object & config) { constexpr auto as_u16 = [](coral::i64 value) -> coral::optional { if ((value >= 0) && (value <= coral::u16_max)) return static_cast(value); @@ -62,16 +62,7 @@ extern "C" int main(int argc, char const * const * argv) { return system.log(app::log_level::error, "failed to initialize window"); vm.with_object(config.get_field("title"), [&](kym::bound_object & title) { - coral::stack title_buffer{&system.thread_safe_allocator()}; - coral::sequence_writer title_writer{&title_buffer}; - - if (!title.stringify(title_writer).is_ok()) { - system.log(app::log_level::error, - "failed to decode `title` property of config"); - - return; - } - + // TODO: implement. is_config_loaded = true; }); }); @@ -80,7 +71,6 @@ extern "C" int main(int argc, char const * const * argv) { if (!is_config_loaded) { coral::stack error_message{&system.thread_safe_allocator()}; - { coral::sequence_writer error_writer{&error_message};