| 1659 | |
| 1660 | |
| 1661 | static int star_l (lua_State *L) { |
| 1662 | int l1; |
| 1663 | int n = luaL_checkint(L, 2); |
| 1664 | Instruction *p1 = getpatt(L, 1, &l1); |
| 1665 | if (n >= 0) { |
| 1666 | CharsetTag st; |
| 1667 | Instruction *op; |
| 1668 | if (tocharset(p1, &st) == ISCHARSET) |
| 1669 | return repeatcharset(L, st.cs, l1, n); |
| 1670 | if (isheadfail(p1)) |
| 1671 | op = repeatheadfail(L, l1, n); |
| 1672 | else |
| 1673 | op = repeats(L, p1, l1, n); |
| 1674 | optimizecaptures(op); |
| 1675 | optimizejumps(op); |
| 1676 | } |
| 1677 | else { |
| 1678 | if (isheadfail(p1)) |
| 1679 | optionalheadfail(L, l1, -n); |
| 1680 | else |
| 1681 | optionals(L, l1, -n); |
| 1682 | } |
| 1683 | return 1; |
| 1684 | } |
| 1685 | |
| 1686 | |
| 1687 | static int getlabel (lua_State *L, int labelidx) { |
nothing calls this directly
no test coverage detected