MCPcopy Create free account
hub / github.com/F-Stack/f-stack / statement

Function statement

freebsd/contrib/openzfs/module/lua/lparser.c:1534–1600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

statlistFunction · 0.70
skipnoopstatFunction · 0.70

Calls 15

labelstatFunction · 0.85
gotostatFunction · 0.85
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

Tested by

no test coverage detected