update
This commit is contained in:
parent
240670ca85
commit
c186d3b030
|
@ -20,6 +20,10 @@ nasal_runtime runtime;
|
||||||
std::string command;
|
std::string command;
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
// use chcp 65001 to use unicode io
|
||||||
|
system("chcp 65001");
|
||||||
|
#endif
|
||||||
// this curve looks really cool
|
// this curve looks really cool
|
||||||
std::cout<<" __ _ "<<std::endl;
|
std::cout<<" __ _ "<<std::endl;
|
||||||
std::cout<<" /\\ \\ \\__ _ ___ __ _| | "<<std::endl;
|
std::cout<<" /\\ \\ \\__ _ ___ __ _| | "<<std::endl;
|
||||||
|
@ -27,13 +31,13 @@ int main()
|
||||||
std::cout<<" / /\\ / (_| \\__ \\ (_| | | "<<std::endl;
|
std::cout<<" / /\\ / (_| \\__ \\ (_| | | "<<std::endl;
|
||||||
std::cout<<" \\_\\ \\/ \\__,_|___/\\__,_|_|"<<std::endl;
|
std::cout<<" \\_\\ \\/ \\__,_|___/\\__,_|_|"<<std::endl;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
std::cout<<">> [system] Windows system."<<std::endl;
|
std::cout<<">> [system] Windows system."<<std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef _linux_
|
#ifdef _linux_
|
||||||
std::cout<<">> [system] Linux system."<<std::endl;
|
std::cout<<">> [system] Linux system."<<std::endl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef TARGET_OS_MAC
|
#ifdef TARGET_OS_MAC
|
||||||
std::cout<<">> [system] MacOS system."<<std::endl;
|
std::cout<<">> [system] MacOS system."<<std::endl;
|
||||||
#endif
|
#endif
|
||||||
std::cout<<">> Nasal interpreter ver 2.0 ."<<std::endl;
|
std::cout<<">> Nasal interpreter ver 2.0 ."<<std::endl;
|
||||||
std::cout<<">> Code: https://github.com/ValKmjolnir/Nasal-Interpreter"<<std::endl;
|
std::cout<<">> Code: https://github.com/ValKmjolnir/Nasal-Interpreter"<<std::endl;
|
||||||
|
|
|
@ -158,7 +158,8 @@ void resource_file::input_file(std::string filename)
|
||||||
c=fin.get();
|
c=fin.get();
|
||||||
if(fin.eof())
|
if(fin.eof())
|
||||||
break;
|
break;
|
||||||
source_code.push_back(c<0? '?':c);
|
//source_code.push_back(c<0? '?':c);
|
||||||
|
source_code.push_back(c);
|
||||||
}
|
}
|
||||||
fin.close();
|
fin.close();
|
||||||
return;
|
return;
|
||||||
|
@ -198,6 +199,17 @@ void resource_file::print_resource()
|
||||||
{
|
{
|
||||||
if(32<=source_code[i])
|
if(32<=source_code[i])
|
||||||
std::cout<<source_code[i];
|
std::cout<<source_code[i];
|
||||||
|
else if(source_code[i]<0)
|
||||||
|
{
|
||||||
|
std::string tmp="";
|
||||||
|
for(;i<source_code.size();++i)
|
||||||
|
{
|
||||||
|
if(source_code[i]>=0)
|
||||||
|
break;
|
||||||
|
tmp.push_back(source_code[i]);
|
||||||
|
}
|
||||||
|
std::cout<<tmp;--i;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
std::cout<<" ";
|
std::cout<<" ";
|
||||||
if(source_code[i]=='\n')
|
if(source_code[i]=='\n')
|
||||||
|
|
|
@ -4786,7 +4786,7 @@ void nasal_runtime::main_proc(abstract_syntax_tree& root)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
end_time=std::time(NULL);
|
end_time=std::time(NULL);
|
||||||
std::cout<<">> [Runtime] process exited after "<<end_time-begin_time<<" s ."<<std::endl;
|
std::cout<<std::endl<<">> [Runtime] process exited after "<<end_time-begin_time<<" s ."<<std::endl;
|
||||||
global_scope.clear();
|
global_scope.clear();
|
||||||
main_local_scope.clear();
|
main_local_scope.clear();
|
||||||
nasal_gc.gc_init();
|
nasal_gc.gc_init();
|
||||||
|
|
Loading…
Reference in New Issue