MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / createlabel

Function createlabel

third-party/lua-5.5.0/src/lparser.c:678–686  ·  view source on GitHub ↗

** Create a new label with the given 'name' at the given 'line'. ** 'last' tells whether label is the last non-op statement in its ** block. Solves all pending gotos to this new label and adds ** a close instruction if necessary. ** Returns true iff it added a close instruction. */

Source from the content-addressed store, hash-verified

676** Returns true iff it added a close instruction.
677*/
678static void createlabel (LexState *ls, TString *name, int line, int last) {
679 FuncState *fs = ls->fs;
680 Labellist *ll = &ls->dyd->label;
681 int l = newlabelentry(ls, ll, name, line, luaK_getlabel(fs));
682 if (last) { /* label is last no-op statement in the block? */
683 /* assume that locals are already out of scope */
684 ll->arr[l].nactvar = fs->bl->nactvar;
685 }
686}
687
688
689/*

Callers 2

leaveblockFunction · 0.70
labelstatFunction · 0.70

Calls 2

newlabelentryFunction · 0.70
luaK_getlabelFunction · 0.70

Tested by

no test coverage detected