| 1644 | |
| 1645 | |
| 1646 | static void optionals (lua_State *L, int l1, int n) { |
| 1647 | /* choice L1; e; partialcommit L2; L2: ... e; L1: commit L3; L3: ... */ |
| 1648 | int i; |
| 1649 | Instruction *op = newpatt(L, n*(l1 + 1) + 1); |
| 1650 | Instruction *p = op; |
| 1651 | setinst(p++, IChoice, 1 + n*(l1 + 1)); |
| 1652 | for (i = 0; i < n; i++) { |
| 1653 | p += addpatt(L, p, 1); |
| 1654 | setinst(p++, IPartialCommit, 1); |
| 1655 | } |
| 1656 | setinst(p - 1, ICommit, 1); /* correct last commit */ |
| 1657 | optimizechoice(op); |
| 1658 | } |
| 1659 | |
| 1660 | |
| 1661 | static int star_l (lua_State *L) { |
no test coverage detected