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

Function custombinaryoperator

src/lparser.cpp:3991–4012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3989
3990
3991static BinOpr custombinaryoperator (LexState *ls, expdesc *v, int flags, TString *impl) {
3992 FuncState *fs = ls->fs;
3993 int line = ls->getLineNumber();
3994
3995 expdesc func;
3996 singlevaraux(fs, impl, &func, 1);
3997 lua_assert(v->k != VVOID);
3998 luaK_prepcallfirstarg(fs, v, &func);
3999 lua_assert(v->k == VNONRELOC);
4000 int base = v->u.reg; /* base register for call */
4001
4002 expdesc arg2;
4003 auto nextop = subexpr(ls, &arg2, 3, nullptr, nullptr, flags | E_NESTED);
4004 luaK_exp2nextreg(fs, &arg2);
4005
4006 int nparams = fs->freereg - (base + 1);
4007 init_exp(v, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams + 1, 2));
4008 luaK_fixline(fs, line);
4009 fs->freereg = base + 1;
4010
4011 return nextop;
4012}
4013
4014
4015static std::vector<int> casecond (LexState *ls, const expdesc& ctrl, int tk) {

Callers 1

subexprFunction · 0.85

Calls 7

singlevarauxFunction · 0.85
luaK_prepcallfirstargFunction · 0.85
subexprFunction · 0.85
luaK_exp2nextregFunction · 0.85
init_expFunction · 0.85
luaK_fixlineFunction · 0.85
getLineNumberMethod · 0.80

Tested by

no test coverage detected