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

Function statement

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

Source from the content-addressed store, hash-verified

1602
1603
1604static void statement(LexState *ls) {
1605 int line = ls->linenumber; /* may be needed for error messages */
1606 enterlevel(ls);
1607 switch (ls->t.token) {
1608 case ';': { /* stat -> ';' (empty statement) */
1609 luaX_next(ls); /* skip ';' */
1610 break;
1611 }
1612 case TK_IF: { /* stat -> ifstat */
1613 ifstat(ls, line);
1614 break;
1615 }
1616 case TK_WHILE: { /* stat -> whilestat */
1617 whilestat(ls, line);
1618 break;
1619 }
1620 case TK_DO: { /* stat -> DO block END */
1621 luaX_next(ls); /* skip DO */
1622 block(ls);
1623 check_match(ls, TK_END, TK_DO, line);
1624 break;
1625 }
1626 case TK_FOR: { /* stat -> forstat */
1627 forstat(ls, line);
1628 break;
1629 }
1630 case TK_REPEAT: { /* stat -> repeatstat */
1631 repeatstat(ls, line);
1632 break;
1633 }
1634 case TK_FUNCTION: { /* stat -> funcstat */
1635 funcstat(ls, line);
1636 break;
1637 }
1638 case TK_LOCAL: { /* stat -> localstat */
1639 luaX_next(ls); /* skip LOCAL */
1640 if (testnext(ls, TK_FUNCTION)) /* local function? */
1641 localfunc(ls);
1642 else
1643 localstat(ls);
1644 break;
1645 }
1646 case TK_DBCOLON: { /* stat -> label */
1647 luaX_next(ls); /* skip double colon */
1648 labelstat(ls, str_checkname(ls), line);
1649 break;
1650 }
1651 case TK_RETURN: { /* stat -> retstat */
1652 luaX_next(ls); /* skip RETURN */
1653 retstat(ls);
1654 break;
1655 }
1656 case TK_BREAK: /* stat -> breakstat */
1657 case TK_GOTO: { /* stat -> 'goto' NAME */
1658 gotostat(ls, luaK_jump(ls->fs));
1659 break;
1660 }
1661 default: { /* stat -> func | assignment */

Callers 2

statlistFunction · 0.85
skipnoopstatFunction · 0.85

Calls 15

enterlevelFunction · 0.85
luaX_nextFunction · 0.85
ifstatFunction · 0.85
whilestatFunction · 0.85
forstatFunction · 0.85
repeatstatFunction · 0.85
funcstatFunction · 0.85
testnextFunction · 0.85
localfuncFunction · 0.85
localstatFunction · 0.85
labelstatFunction · 0.85
str_checknameFunction · 0.85

Tested by

no test coverage detected