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

Function repeats

other_src/lua/src/lpeg.cpp:1618–1632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1616
1617
1618static 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
1635static void optionalheadfail (lua_State *L, int l1, int n) {

Callers 1

star_lFunction · 0.85

Calls 4

newpattFunction · 0.85
verifyFunction · 0.85
addpattFunction · 0.85
luaL_errorFunction · 0.70

Tested by

no test coverage detected