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

Function forstat

third-party/lua-5.4.6/src/lparser.c:1619–1634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1617
1618
1619static void forstat (LexState *ls, int line) {
1620 /* forstat -> FOR (fornum | forlist) END */
1621 FuncState *fs = ls->fs;
1622 TString *varname;
1623 BlockCnt bl;
1624 enterblock(fs, &bl, 1); /* scope for loop and control variables */
1625 luaX_next(ls); /* skip 'for' */
1626 varname = str_checkname(ls); /* first variable name */
1627 switch (ls->t.token) {
1628 case '=': fornum(ls, varname, line); break;
1629 case ',': case TK_IN: forlist(ls, varname); break;
1630 default: luaX_syntaxerror(ls, "'=' or 'in' expected");
1631 }
1632 check_match(ls, TK_END, TK_FOR, line);
1633 leaveblock(fs); /* loop scope ('break' jumps to this point) */
1634}
1635
1636
1637static 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