| 1692 | |
| 1693 | |
| 1694 | static void ifstat (LexState *ls, int line) { |
| 1695 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ |
| 1696 | FuncState *fs = ls->fs; |
| 1697 | int escapelist = NO_JUMP; /* exit list for finished parts */ |
| 1698 | test_then_block(ls, &escapelist); /* IF cond THEN block */ |
| 1699 | while (ls->t.token == TK_ELSEIF) |
| 1700 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ |
| 1701 | if (testnext(ls, TK_ELSE)) |
| 1702 | block(ls); /* 'else' part */ |
| 1703 | check_match(ls, TK_END, TK_IF, line); |
| 1704 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ |
| 1705 | } |
| 1706 | |
| 1707 | |
| 1708 | static void localfunc (LexState *ls) { |
no test coverage detected