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

Function statement

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

Source from the content-addressed store, hash-verified

1535
1536
1537static void statement (LexState *ls) {
1538 int line = ls->linenumber; /* may be needed for error messages */
1539 enterlevel(ls);
1540 switch (ls->t.token) {
1541 case ';': { /* stat -> ';' (empty statement) */
1542 luaX_next(ls); /* skip ';' */
1543 break;
1544 }
1545 case TK_IF: { /* stat -> ifstat */
1546 ifstat(ls, line);
1547 break;
1548 }
1549 case TK_WHILE: { /* stat -> whilestat */
1550 whilestat(ls, line);
1551 break;
1552 }
1553 case TK_DO: { /* stat -> DO block END */
1554 luaX_next(ls); /* skip DO */
1555 block(ls);
1556 check_match(ls, TK_END, TK_DO, line);
1557 break;
1558 }
1559 case TK_FOR: { /* stat -> forstat */
1560 forstat(ls, line);
1561 break;
1562 }
1563 case TK_REPEAT: { /* stat -> repeatstat */
1564 repeatstat(ls, line);
1565 break;
1566 }
1567 case TK_FUNCTION: { /* stat -> funcstat */
1568 funcstat(ls, line);
1569 break;
1570 }
1571 case TK_LOCAL: { /* stat -> localstat */
1572 luaX_next(ls); /* skip LOCAL */
1573 if (testnext(ls, TK_FUNCTION)) /* local function? */
1574 localfunc(ls);
1575 else
1576 localstat(ls);
1577 break;
1578 }
1579 case TK_DBCOLON: { /* stat -> label */
1580 luaX_next(ls); /* skip double colon */
1581 labelstat(ls, str_checkname(ls), line);
1582 break;
1583 }
1584 case TK_RETURN: { /* stat -> retstat */
1585 luaX_next(ls); /* skip RETURN */
1586 retstat(ls);
1587 break;
1588 }
1589 case TK_BREAK: /* stat -> breakstat */
1590 case TK_GOTO: { /* stat -> 'goto' NAME */
1591 gotostat(ls, luaK_jump(ls->fs));
1592 break;
1593 }
1594 default: { /* stat -> func | assignment */

Callers 2

statlistFunction · 0.70
skipnoopstatFunction · 0.70

Calls 15

enterlevelFunction · 0.70
luaX_nextFunction · 0.70
ifstatFunction · 0.70
whilestatFunction · 0.70
blockFunction · 0.70
check_matchFunction · 0.70
forstatFunction · 0.70
repeatstatFunction · 0.70
funcstatFunction · 0.70
testnextFunction · 0.70
localfuncFunction · 0.70
localstatFunction · 0.70

Tested by

no test coverage detected