| 1673 | |
| 1674 | |
| 1675 | static void ifstat (LexState *ls, int line) { |
| 1676 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ |
| 1677 | FuncState *fs = ls->fs; |
| 1678 | int escapelist = NO_JUMP; /* exit list for finished parts */ |
| 1679 | test_then_block(ls, &escapelist); /* IF cond THEN block */ |
| 1680 | while (ls->t.token == TK_ELSEIF) |
| 1681 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ |
| 1682 | if (testnext(ls, TK_ELSE)) |
| 1683 | block(ls); /* 'else' part */ |
| 1684 | check_match(ls, TK_END, TK_IF, line); |
| 1685 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ |
| 1686 | } |
| 1687 | |
| 1688 | |
| 1689 | static void localfunc (LexState *ls) { |
no test coverage detected