MCPcopy Create free account
hub / github.com/DFHack/dfhack / body

Function body

depends/lua/src/lparser.c:783–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781
782
783static void body (LexState *ls, expdesc *e, int ismethod, int line) {
784 /* body -> '(' parlist ')' block END */
785 FuncState new_fs;
786 BlockCnt bl;
787 new_fs.f = addprototype(ls);
788 new_fs.f->linedefined = line;
789 open_func(ls, &new_fs, &bl);
790 checknext(ls, '(');
791 if (ismethod) {
792 new_localvarliteral(ls, "self"); /* create 'self' parameter */
793 adjustlocalvars(ls, 1);
794 }
795 parlist(ls);
796 checknext(ls, ')');
797 statlist(ls);
798 new_fs.f->lastlinedefined = ls->linenumber;
799 check_match(ls, TK_END, TK_FUNCTION, line);
800 codeclosure(ls, e);
801 close_func(ls);
802}
803
804
805static 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