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

Function concat_l

other_src/lua/src/lpeg.cpp:1333–1351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1331#define issucc(p) ((p)->i.code == IEnd)
1332
1333static int concat_l (lua_State *L) {
1334 /* p1; p2; */
1335 int l1, l2;
1336 Instruction *p1 = getpatt(L, 1, &l1);
1337 Instruction *p2 = getpatt(L, 2, &l2);
1338 if (isfail(p1) || issucc(p2))
1339 lua_pushvalue(L, 1); /* fail * x == fail; x * true == x */
1340 else if (isfail(p2) || issucc(p1))
1341 lua_pushvalue(L, 2); /* x * fail == fail; true * x == x */
1342 else if (isany(p1) && isany(p2))
1343 any(L, p1->i.aux + p2->i.aux, 0, NULL);
1344 else {
1345 Instruction *op = newpatt(L, l1 + l2);
1346 Instruction *p = op + addpatt(L, op, 1);
1347 addpatt(L, p, 2);
1348 optimizecaptures(op);
1349 }
1350 return 1;
1351}
1352
1353
1354static int diff_l (lua_State *L) {

Callers

nothing calls this directly

Calls 6

getpattFunction · 0.85
anyFunction · 0.85
newpattFunction · 0.85
addpattFunction · 0.85
optimizecapturesFunction · 0.85
lua_pushvalueFunction · 0.70

Tested by

no test coverage detected