MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / breakstat

Function breakstat

deps/lua/src/lparser.c:975–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

973
974
975static void breakstat (LexState *ls) {
976 FuncState *fs = ls->fs;
977 BlockCnt *bl = fs->bl;
978 int upval = 0;
979 while (bl && !bl->isbreakable) {
980 upval |= bl->upval;
981 bl = bl->previous;
982 }
983 if (!bl)
984 luaX_syntaxerror(ls, "no loop to break");
985 if (upval)
986 luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0);
987 luaK_concat(fs, &bl->breaklist, luaK_jump(fs));
988}
989
990
991static void whilestat (LexState *ls, int line) {

Callers 2

repeatstatFunction · 0.85
statementFunction · 0.85

Calls 4

luaX_syntaxerrorFunction · 0.85
luaK_codeABCFunction · 0.85
luaK_concatFunction · 0.85
luaK_jumpFunction · 0.85

Tested by

no test coverage detected