🚀 change cpp standard to c++14 & add command line colorful info output.

and fix a bug that program may crash if there's an error when coroutine is running
This commit is contained in:
ValKmjolnir
2022-08-31 23:24:41 +08:00
parent e61e596b2a
commit 2da3be7fc4
6 changed files with 93 additions and 42 deletions
+6 -1
View File
@@ -4,6 +4,8 @@
#include <queue>
#include <unordered_map>
#include "nasal_err.h"
enum vm_type:u8{
/* none-gc object */
vm_none=0,
@@ -721,7 +723,10 @@ void nasal_gc::ctxreserve()
// use to print error log and return error value
nas_ref nas_err(const string& err_f,const string& info)
{
std::cerr<<"[vm] "<<err_f<<": "<<info<<"\n";
std::cerr<<bold_cyan<<"[vm] "
<<bold_red<<err_f<<": "
<<bold_white<<info<<"\n"
<<reset;
return {vm_none};
}
#endif