MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / body

Function body

lib/lua/src/lparser.c:990–1009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

988
989
990static void body (LexState *ls, expdesc *e, int ismethod, int line) {
991 /* body -> '(' parlist ')' block END */
992 FuncState new_fs;
993 BlockCnt bl;
994 new_fs.f = addprototype(ls);
995 new_fs.f->linedefined = line;
996 open_func(ls, &new_fs, &bl);
997 checknext(ls, '(');
998 if (ismethod) {
999 new_localvarliteral(ls, "self"); /* create 'self' parameter */
1000 adjustlocalvars(ls, 1);
1001 }
1002 parlist(ls);
1003 checknext(ls, ')');
1004 statlist(ls);
1005 new_fs.f->lastlinedefined = ls->linenumber;
1006 check_match(ls, TK_END, TK_FUNCTION, line);
1007 codeclosure(ls, e);
1008 close_func(ls);
1009}
1010
1011
1012static int explist (LexState *ls, expdesc *v) {

Callers 3

simpleexpFunction · 0.70
localfuncFunction · 0.70
funcstatFunction · 0.70

Calls 9

addprototypeFunction · 0.85
open_funcFunction · 0.85
checknextFunction · 0.85
adjustlocalvarsFunction · 0.85
parlistFunction · 0.85
statlistFunction · 0.85
check_matchFunction · 0.85
codeclosureFunction · 0.85
close_funcFunction · 0.85

Tested by

no test coverage detected