MCPcopy Create free account
hub / github.com/DFHack/dfhack / open_func

Function open_func

depends/lua/src/lparser.c:529–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527
528
529static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) {
530 Proto *f;
531 fs->prev = ls->fs; /* linked list of funcstates */
532 fs->ls = ls;
533 ls->fs = fs;
534 fs->pc = 0;
535 fs->lasttarget = 0;
536 fs->jpc = NO_JUMP;
537 fs->freereg = 0;
538 fs->nk = 0;
539 fs->np = 0;
540 fs->nups = 0;
541 fs->nlocvars = 0;
542 fs->nactvar = 0;
543 fs->firstlocal = ls->dyd->actvar.n;
544 fs->bl = NULL;
545 f = fs->f;
546 f->source = ls->source;
547 luaC_objbarrier(ls->L, f, f->source);
548 f->maxstacksize = 2; /* registers 0/1 are always valid */
549 enterblock(fs, bl, 0);
550}
551
552
553static void close_func (LexState *ls) {

Callers 2

bodyFunction · 0.85
mainfuncFunction · 0.85

Calls 1

enterblockFunction · 0.85

Tested by

no test coverage detected