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

Function parlist

third-party/lua-5.3.5/src/lparser.c:753–779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

751
752
753static void parlist (LexState *ls) {
754 /* parlist -> [ param { ',' param } ] */
755 FuncState *fs = ls->fs;
756 Proto *f = fs->f;
757 int nparams = 0;
758 f->is_vararg = 0;
759 if (ls->t.token != ')') { /* is 'parlist' not empty? */
760 do {
761 switch (ls->t.token) {
762 case TK_NAME: { /* param -> NAME */
763 new_localvar(ls, str_checkname(ls));
764 nparams++;
765 break;
766 }
767 case TK_DOTS: { /* param -> '...' */
768 luaX_next(ls);
769 f->is_vararg = 1; /* declared vararg */
770 break;
771 }
772 default: luaX_syntaxerror(ls, "<name> or '...' expected");
773 }
774 } while (!f->is_vararg && testnext(ls, ','));
775 }
776 adjustlocalvars(ls, nparams);
777 f->numparams = cast_byte(fs->nactvar);
778 luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */
779}
780
781
782static 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