Change error printing to use colors, enable colors on windows cmd, print bytecode instruction line
This commit is contained in:
24
main.cpp
24
main.cpp
@@ -41,6 +41,12 @@ want to export all the symbols, we can namespace them optionally.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
@todo
|
||||
[ ] - Add token information to instructions
|
||||
[ ] - print those token lines nicely
|
||||
[ ] - Implement functions
|
||||
[ ] - Improve the python metaprogram
|
||||
|
||||
|
||||
[ ] - Probably need to give Ast_Expr a Value field, then I can express Type nicely
|
||||
[ ] - I would love for String, slice, Any etc. to have their struct declarations in source files, I also would want for stuff like string.str to work without weird special cases
|
||||
[ ] - Var args with Any
|
||||
@@ -168,6 +174,24 @@ want to export all the symbols, we can namespace them optionally.
|
||||
|
||||
int main(int argument_count, char **arguments){
|
||||
|
||||
#if OS_WINDOWS
|
||||
// Set output mode to handle virtual terminal sequences
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (hOut == INVALID_HANDLE_VALUE) {
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
DWORD dwMode = 0;
|
||||
if (!GetConsoleMode(hOut, &dwMode)) {
|
||||
return GetLastError();
|
||||
}
|
||||
|
||||
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
if (!SetConsoleMode(hOut, dwMode)) {
|
||||
return GetLastError();
|
||||
}
|
||||
#endif
|
||||
|
||||
test_os_memory();
|
||||
thread_ctx_init();
|
||||
test_unicode();
|
||||
|
||||
Reference in New Issue
Block a user