MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / forstat

Function forstat

src/Chain/libraries/glua/lparser.cpp:1421–1436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1419
1420
1421static void forstat(LexState *ls, int line) {
1422 /* forstat -> FOR (fornum | forlist) END */
1423 FuncState *fs = ls->fs;
1424 TString *varname;
1425 BlockCnt bl;
1426 enterblock(fs, &bl, 1); /* scope for loop and control variables */
1427 luaX_next(ls); /* skip 'for' */
1428 varname = str_checkname(ls); /* first variable name */
1429 switch (ls->t.token) {
1430 case '=': fornum(ls, varname, line); break;
1431 case ',': case TK_IN: forlist(ls, varname); break;
1432 default: luaX_syntaxerror(ls, "'=' or 'in' expected");
1433 }
1434 check_match(ls, TK_END, TK_FOR, line);
1435 leaveblock(fs); /* loop scope ('break' jumps to this point) */
1436}
1437
1438
1439static 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