MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / parlist

Function parlist

third-party/lua-5.2.4/src/lparser.c:759–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757
758
759static void parlist (LexState *ls) {
760 /* parlist -> [ param { `,' param } ] */
761 FuncState *fs = ls->fs;
762 Proto *f = fs->f;
763 int nparams = 0;
764 f->is_vararg = 0;
765 if (ls->t.token != ')') { /* is `parlist' not empty? */
766 do {
767 switch (ls->t.token) {
768 case TK_NAME: { /* param -> NAME */
769 new_localvar(ls, str_checkname(ls));
770 nparams++;
771 break;
772 }
773 case TK_DOTS: { /* param -> `...' */
774 luaX_next(ls);
775 f->is_vararg = 1;
776 break;
777 }
778 default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected");
779 }
780 } while (!f->is_vararg && testnext(ls, ','));
781 }
782 adjustlocalvars(ls, nparams);
783 f->numparams = cast_byte(fs->nactvar);
784 luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */
785}
786
787
788static void body (LexState *ls, expdesc *e, int ismethod, int line) {

Callers 1

bodyFunction · 0.70

Calls 7

new_localvarFunction · 0.70
str_checknameFunction · 0.70
luaX_nextFunction · 0.70
luaX_syntaxerrorFunction · 0.70
testnextFunction · 0.70
adjustlocalvarsFunction · 0.70
luaK_reserveregsFunction · 0.70

Tested by

no test coverage detected