| 1401 | |
| 1402 | |
| 1403 | static 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 | |
| 1425 | static int nocalls (const Instruction *p) { |
nothing calls this directly
no test coverage detected