📝 little change
This commit is contained in:
parent
feea8f8d66
commit
2937c10c77
6
main.cpp
6
main.cpp
|
@ -22,7 +22,7 @@ void help()
|
||||||
#endif
|
#endif
|
||||||
<<"nasal <option>\n"
|
<<"nasal <option>\n"
|
||||||
<<"option:\n"
|
<<"option:\n"
|
||||||
<<" -h, --help | get this help.\n"
|
<<" -h, --help | get this help and exit.\n"
|
||||||
<<" -v, --version | get version of nasal interpreter.\n\n"
|
<<" -v, --version | get version of nasal interpreter.\n\n"
|
||||||
<<"nasal [option...] <file> [argv...]\n"
|
<<"nasal [option...] <file> [argv...]\n"
|
||||||
<<"option:\n"
|
<<"option:\n"
|
||||||
|
@ -161,8 +161,6 @@ i32 main(i32 argc,const char* argv[])
|
||||||
}
|
}
|
||||||
if(!filename.length())
|
if(!filename.length())
|
||||||
err();
|
err();
|
||||||
if(!cmd)
|
execute(filename,vm_argv,cmd?cmd:cmd|VM_EXEC);
|
||||||
cmd|=VM_EXEC;
|
|
||||||
execute(filename,vm_argv,cmd);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -12,20 +12,20 @@ nas_ref nas_err(const string& err_f,const string& info)
|
||||||
return {vm_none};
|
return {vm_none};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void print_core(std::vector<nas_ref>& elems)
|
void print_core(std::vector<nas_ref>& elems)
|
||||||
{
|
{
|
||||||
for(auto& i:elems)
|
for(auto& i:elems)
|
||||||
switch(i.type)
|
switch(i.type)
|
||||||
{
|
{
|
||||||
case vm_none: std::cout<<"null"; break;
|
case vm_none:std::cout<<"null"; break;
|
||||||
case vm_nil: std::cout<<"nil"; break;
|
case vm_nil: std::cout<<"nil"; break;
|
||||||
case vm_num: std::cout<<i.num(); break;
|
case vm_num: std::cout<<i.num(); break;
|
||||||
case vm_str: std::cout<<i.str(); break;
|
case vm_str: std::cout<<i.str(); break;
|
||||||
case vm_vec: i.vec().print(); break;
|
case vm_vec: i.vec().print(); break;
|
||||||
case vm_hash: i.hash().print(); break;
|
case vm_hash:i.hash().print(); break;
|
||||||
case vm_func: std::cout<<"func(..){..}";break;
|
case vm_func:std::cout<<"func(..){..}";break;
|
||||||
case vm_obj: std::cout<<"<object>"; break;
|
case vm_obj: std::cout<<"<object>"; break;
|
||||||
case vm_co: std::cout<<"<coroutine>"; break;
|
case vm_co: std::cout<<"<coroutine>"; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nas_ref builtin_print(nas_ref* local,nasal_gc& gc)
|
nas_ref builtin_print(nas_ref* local,nasal_gc& gc)
|
||||||
|
|
Loading…
Reference in New Issue