diff --git a/build.bat b/build.bat index 2ca6f08..7f72eeb 100644 --- a/build.bat +++ b/build.bat @@ -2,6 +2,9 @@ pushd %~dp0 rem cl main.cpp -I.. user32.lib -clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o main.exe -Wl,user32.lib +rem clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o main.exe -Wl,user32.lib rem ubuntu run clang core_main.cpp -O0 -Wall -Wno-unused-function -fno-exceptions -fdiagnostics-absolute-paths -g -o core.out + +main examples/language_basics.core + popd diff --git a/core_main.cpp b/core_main.cpp index 52c92dc..cba0201 100644 --- a/core_main.cpp +++ b/core_main.cpp @@ -2,11 +2,16 @@ Current: +- [ ] Maybe wait to implement WASM / bytecode emitter before doing this? + Probably need some UInt Int types and those should be default, target + decides the size of these +- [ ] Fix adressing void is possible, maybe make it possible to address void + using bytes + * a.void + 10 + * a.void[10] - [ ] String declaration in Language.core - [ ] Way to import and force evaluate #import_lazy #import ? -- [ ] Typeof operator - [ ] Test and bulletproof any, slices - - [ ] Need tests that make sure stuff errors out Memory: @@ -258,24 +263,28 @@ int main(int argument_count, char **arguments){ if(!args.len){ log_info("Please specify a file to compile!"); + return 0; } #if OS_WINDOWS // Set output mode to handle virtual terminal sequences HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); - if (hOut == INVALID_HANDLE_VALUE) { - return GetLastError(); + if (hOut != INVALID_HANDLE_VALUE) { + DWORD dwMode = 0; + if (GetConsoleMode(hOut, &dwMode)) { + dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; + if (!SetConsoleMode(hOut, dwMode)) { + log_info("Failed to enable colored terminal output C"); + } + } + else{ + log_info("Failed to enable colored terminal output B"); + } + } + else { + log_info("Failed to enable colored terminal output A"); } - DWORD dwMode = 0; - if (!GetConsoleMode(hOut, &dwMode)) { - return GetLastError(); - } - - dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - if (!SetConsoleMode(hOut, dwMode)) { - return GetLastError(); - } test_os_memory(); #endif @@ -286,6 +295,7 @@ int main(int argument_count, char **arguments){ test_string_builder(); test_intern_table(); + log_info("Test"); // emit_line_directives = false; // emit_type_info = false; For(args){