| 1661 | |
| 1662 | |
| 1663 | static void ifstat (LexState *ls, int line) { |
| 1664 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ |
| 1665 | FuncState *fs = ls->fs; |
| 1666 | int escapelist = NO_JUMP; /* exit list for finished parts */ |
| 1667 | test_then_block(ls, &escapelist); /* IF cond THEN block */ |
| 1668 | while (ls->t.token == TK_ELSEIF) |
| 1669 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ |
| 1670 | if (testnext(ls, TK_ELSE)) |
| 1671 | block(ls); /* 'else' part */ |
| 1672 | check_match(ls, TK_END, TK_IF, line); |
| 1673 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ |
| 1674 | } |
| 1675 | |
| 1676 | |
| 1677 | static void localfunc (LexState *ls) { |
no test coverage detected