| 1616 | |
| 1617 | |
| 1618 | static Instruction *repeats (lua_State *L, Instruction *p1, int l1, int n) { |
| 1619 | /* e; ...; e; choice L1; L2: e; partialcommit L2; L1: ... */ |
| 1620 | int i; |
| 1621 | Instruction *op = newpatt(L, (n + 1)*l1 + 2); |
| 1622 | Instruction *p = op; |
| 1623 | if (!verify(L, p1, p1, p1 + l1, 0, 0)) |
| 1624 | luaL_error(L, "loop body may accept empty string"); |
| 1625 | for (i = 0; i < n; i++) { |
| 1626 | p += addpatt(L, p, 1); |
| 1627 | } |
| 1628 | setinst(p++, IChoice, 1 + l1 + 1); |
| 1629 | p += addpatt(L, p, 1); |
| 1630 | setinst(p, IPartialCommit, -l1); |
| 1631 | return op; |
| 1632 | } |
| 1633 | |
| 1634 | |
| 1635 | static void optionalheadfail (lua_State *L, int l1, int n) { |
no test coverage detected