MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / star_l

Function star_l

other_src/lua/src/lpeg.cpp:1661–1684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1659
1660
1661static 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
1687static int getlabel (lua_State *L, int labelidx) {

Callers

nothing calls this directly

Calls 10

getpattFunction · 0.85
tocharsetFunction · 0.85
repeatcharsetFunction · 0.85
isheadfailFunction · 0.85
repeatheadfailFunction · 0.85
repeatsFunction · 0.85
optimizecapturesFunction · 0.85
optimizejumpsFunction · 0.85
optionalheadfailFunction · 0.85
optionalsFunction · 0.85

Tested by

no test coverage detected