MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / forstat

Function forstat

lib/lua/src/lparser.c:1620–1635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Tested by

no test coverage detected