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

Function pattand_l

other_src/lua/src/lpeg.cpp:1403–1422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1401
1402
1403static int pattand_l (lua_State *L) {
1404 int l1;
1405 CharsetTag st1;
1406 Instruction *p1 = getpatt(L, 1, &l1);
1407 if (isfail(p1) || issucc(p1))
1408 lua_pushvalue(L, 1); /* &fail == fail; &true == true */
1409 else if (tocharset(p1, &st1) == ISCHARSET) {
1410 Instruction *p = newpatt(L, l1 + 1);
1411 copypatt(p, p1, l1); p += l1;
1412 setinstaux(p, IBack, 0, 1);
1413 }
1414 else { /* Choice L1; p1; BackCommit L2; L1: Fail; L2: */
1415 Instruction *p = newpatt(L, 1 + l1 + 2);
1416 setinst(p++, IChoice, 1 + l1 + 1);
1417 p += addpatt(L, p, 1);
1418 setinst(p++, IBackCommit, 2);
1419 setinst(p, IFail, 0);
1420 }
1421 return 1;
1422}
1423
1424
1425static int nocalls (const Instruction *p) {

Callers

nothing calls this directly

Calls 6

getpattFunction · 0.85
tocharsetFunction · 0.85
newpattFunction · 0.85
setinstauxFunction · 0.85
addpattFunction · 0.85
lua_pushvalueFunction · 0.70

Tested by

no test coverage detected