MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / solvegotos

Function solvegotos

3rd/lua-5.4.3/src/lparser.c:573–586  ·  view source on GitHub ↗

** Solves forward jumps. Check whether new label 'lb' matches any ** pending gotos in current block and solves them. Return true ** if any of the goto's need to close upvalues. */

Source from the content-addressed store, hash-verified

571** if any of the goto's need to close upvalues.
572*/
573static int solvegotos (LexState *ls, Labeldesc *lb) {
574 Labellist *gl = &ls->dyd->gt;
575 int i = ls->fs->bl->firstgoto;
576 int needsclose = 0;
577 while (i < gl->n) {
578 if (eqstr(gl->arr[i].name, lb->name)) {
579 needsclose |= gl->arr[i].close;
580 solvegoto(ls, i, lb); /* will remove 'i' from the list */
581 }
582 else
583 i++;
584 }
585 return needsclose;
586}
587
588
589/*

Callers 1

createlabelFunction · 0.85

Calls 1

solvegotoFunction · 0.85

Tested by

no test coverage detected