MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / addprototype

Function addprototype

3rd/lua-5.4.3/src/lparser.c:686–700  ·  view source on GitHub ↗

** adds a new prototype into list of prototypes */

Source from the content-addressed store, hash-verified

684** adds a new prototype into list of prototypes
685*/
686static Proto *addprototype (LexState *ls) {
687 Proto *clp;
688 lua_State *L = ls->L;
689 FuncState *fs = ls->fs;
690 Proto *f = fs->f; /* prototype of current function */
691 if (fs->np >= f->sizep) {
692 int oldsize = f->sizep;
693 luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions");
694 while (oldsize < f->sizep)
695 f->p[oldsize++] = NULL;
696 }
697 f->p[fs->np++] = clp = luaF_newproto(L);
698 luaC_objbarrier(L, f, clp);
699 return clp;
700}
701
702
703/*

Callers 1

bodyFunction · 0.85

Calls 1

luaF_newprotoFunction · 0.85

Tested by

no test coverage detected