| 1331 | #define issucc(p) ((p)->i.code == IEnd) |
| 1332 | |
| 1333 | static 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 | |
| 1354 | static int diff_l (lua_State *L) { |
nothing calls this directly
no test coverage detected