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

Function body

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

Source from the content-addressed store, hash-verified

976
977
978static void body (LexState *ls, expdesc *e, int ismethod, int line) {
979 /* body -> '(' parlist ')' block END */
980 FuncState new_fs;
981 BlockCnt bl;
982 new_fs.f = addprototype(ls);
983 new_fs.f->linedefined = line;
984 open_func(ls, &new_fs, &bl);
985 checknext(ls, '(');
986 if (ismethod) {
987 new_localvarliteral(ls, "self"); /* create 'self' parameter */
988 adjustlocalvars(ls, 1);
989 }
990 parlist(ls);
991 checknext(ls, ')');
992 statlist(ls);
993 new_fs.f->lastlinedefined = ls->linenumber;
994 check_match(ls, TK_END, TK_FUNCTION, line);
995 codeclosure(ls, e);
996 close_func(ls);
997}
998
999
1000static int explist (LexState *ls, expdesc *v) {

Callers 3

simpleexpFunction · 0.85
localfuncFunction · 0.85
funcstatFunction · 0.85

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