MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / forstat

Function forstat

ThirdParty/lua/lua/lparser.c:1361–1376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

statementFunction · 0.85

Calls 8

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

Tested by

no test coverage detected