| 1765 | |
| 1766 | |
| 1767 | static void ifstat (LexState *ls, int line) { |
| 1768 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ |
| 1769 | FuncState *fs = ls->fs; |
| 1770 | int escapelist = NO_JUMP; /* exit list for finished parts */ |
| 1771 | test_then_block(ls, &escapelist); /* IF cond THEN block */ |
| 1772 | while (ls->t.token == TK_ELSEIF) |
| 1773 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ |
| 1774 | if (testnext(ls, TK_ELSE)) |
| 1775 | block(ls); /* 'else' part */ |
| 1776 | check_match(ls, TK_END, TK_IF, line); |
| 1777 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ |
| 1778 | } |
| 1779 | |
| 1780 | |
| 1781 | static void localfunc (LexState *ls) { |
no test coverage detected