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

Function codeclosure

src/lparser.cpp:1495–1499  ·  view source on GitHub ↗

** codes instruction to create new closure in parent function. ** The OP_CLOSURE instruction uses the last available register, ** so that, if it invokes the GC, the GC knows which registers ** are in use at that time. */

Source from the content-addressed store, hash-verified

1493
1494*/
1495static void codeclosure (LexState *ls, expdesc *v) {
1496 FuncState *fs = ls->fs->prev;
1497 init_exp(v, VRELOC, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1));
1498 luaK_exp2nextreg(fs, v); /* fix it at the last register */
1499}
1500
1501
1502static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) {

Callers 4

bodyFunction · 0.85
lambdabodyFunction · 0.85
prefixplusplusFunction · 0.85
postfixplusplusFunction · 0.85

Calls 3

init_expFunction · 0.85
luaK_codeABxFunction · 0.85
luaK_exp2nextregFunction · 0.85

Tested by

no test coverage detected