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

Function forstat

third-party/lua-5.3.5/src/lparser.c:1364–1379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1362
1363
1364static void forstat (LexState *ls, int line) {
1365 /* forstat -> FOR (fornum | forlist) END */
1366 FuncState *fs = ls->fs;
1367 TString *varname;
1368 BlockCnt bl;
1369 enterblock(fs, &bl, 1); /* scope for loop and control variables */
1370 luaX_next(ls); /* skip 'for' */
1371 varname = str_checkname(ls); /* first variable name */
1372 switch (ls->t.token) {
1373 case '=': fornum(ls, varname, line); break;
1374 case ',': case TK_IN: forlist(ls, varname); break;
1375 default: luaX_syntaxerror(ls, "'=' or 'in' expected");
1376 }
1377 check_match(ls, TK_END, TK_FOR, line);
1378 leaveblock(fs); /* loop scope ('break' jumps to this point) */
1379}
1380
1381
1382static void test_then_block (LexState *ls, int *escapelist) {

Callers 1

statementFunction · 0.70

Calls 8

enterblockFunction · 0.70
luaX_nextFunction · 0.70
str_checknameFunction · 0.70
fornumFunction · 0.70
forlistFunction · 0.70
luaX_syntaxerrorFunction · 0.70
check_matchFunction · 0.70
leaveblockFunction · 0.70

Tested by

no test coverage detected