📝 doc fix

This commit is contained in:
ValKmjolnir 2022-07-23 17:21:44 +08:00
parent 99a131c552
commit 5dcf2ede66
3 changed files with 19 additions and 22 deletions

View File

@ -21,7 +21,7 @@ void help()
#endif
<<"nasal <option>\n"
<<"option:\n"
<<" -h, --help | get help.\n"
<<" -h, --help | get this help.\n"
<<" -v, --version | get version of nasal interpreter.\n\n"
<<"nasal <file>\n"
<<"file:\n"
@ -102,12 +102,9 @@ void execute(const string& file,const std::vector<string>& argv,const u32 cmd)
if(cmd&VM_CODEINFO)
gen.print();
// run bytecode
// run
if(cmd&VM_DEBUG)
{
nasal_dbg debugger(nerr);
debugger.run(gen,linker,argv,cmd&VM_OPCALLNUM);
}
nasal_dbg(nerr).run(gen,linker,argv,cmd&VM_OPCALLNUM);
else if(cmd&VM_EXECTIME)
{
auto start=std::chrono::high_resolution_clock::now();

View File

@ -248,7 +248,7 @@ void nasal_dbg::run(
typedef void (nasal_dbg::*nafunc)();
const nafunc oprs[]=
{
nullptr, &nasal_dbg::o_intg,
nullptr, &nasal_dbg::o_intg,
&nasal_dbg::o_intl, &nasal_dbg::o_loadg,
&nasal_dbg::o_loadl, &nasal_dbg::o_loadu,
&nasal_dbg::o_pnum, &nasal_dbg::o_pnil,

View File

@ -893,20 +893,20 @@ inline void nasal_vm::o_mcallh()
}
inline void nasal_vm::o_ret()
{
/* +-----------------+
* | return value | <- top[0]
* +-----------------+
* | old pc | <- top[-1]
* +-----------------+
* | old localr | <- top[-2]
* +-----------------+
* | old upvalr | <- top[-3]
* +-----------------+
* | local scope |
* | ... |
* +-----------------+ <- local pointer stored in localr
* | old funcr | <- old function stored in funcr
* +-----------------+
/* +-------------+
* | return value| <- top[0]
* +-------------+
* | old pc | <- top[-1]
* +-------------+
* | old localr | <- top[-2]
* +-------------+
* | old upvalr | <- top[-3]
* +-------------+
* | local scope |
* | ... |
* +-------------+ <- local pointer stored in localr
* | old funcr | <- old function stored in funcr
* +-------------+
*/
nas_ref ret =top[0];
nas_ref* local=localr;
@ -930,7 +930,7 @@ inline void nasal_vm::o_ret()
for(u32 i=0;i<size;++i)
upval.elems.push_back(local[i]);
}
// cannot use gc.coroutine to judge,
// cannot use gc.cort to judge,
// because there maybe another function call inside
if(!pc)
gc.ctxreserve();