MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / funcstat

Function funcstat

src/lparser.cpp:5790–5808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5788
5789
5790static void funcstat (LexState *ls, int line, const bool global) {
5791 /* funcstat -> FUNCTION funcname body */
5792 int ismethod;
5793 expdesc v, b;
5794 ismethod = funcname(ls, &v);
5795 if (!global)
5796 check_assignment(ls, &v);
5797 check_readonly(ls, &v);
5798 TypeDesc td;
5799 body(ls, &b, ismethod, line, &td);
5800 if (v.k == VINDEXUP) {
5801 TValue *key = &ls->fs->f->k[v.u.ind.idx];
5802 TypeHint& th = get_global_prop(ls, tsvalue(key));
5803 th.clear();
5804 th.emplaceTypeDesc(std::move(td));
5805 }
5806 luaK_storevar(ls->fs, &v, &b);
5807 luaK_fixline(ls->fs, line); /* definition "happens" in the first line */
5808}
5809
5810
5811static void exprstat (LexState *ls) {

Callers 1

statementFunction · 0.85

Calls 8

funcnameFunction · 0.85
check_assignmentFunction · 0.85
check_readonlyFunction · 0.85
bodyFunction · 0.85
luaK_storevarFunction · 0.85
luaK_fixlineFunction · 0.85
clearMethod · 0.80
emplaceTypeDescMethod · 0.80

Tested by

no test coverage detected