| 445 | } |
| 446 | |
| 447 | txBoolean fx_Iterator_concat_step(txMachine* the, txSlot* iterator, txSlot* next, txSlot* extra, txSlot* value, txFlag status) |
| 448 | { |
| 449 | if (status == XS_NO_STATUS) { |
| 450 | for (;;) { |
| 451 | if (mxIsNull(iterator)) { |
| 452 | txSlot* iterable = extra->value.reference->next; |
| 453 | if (!iterable) |
| 454 | break; |
| 455 | mxPushSlot(iterable); |
| 456 | mxPushSlot(iterable->next); |
| 457 | extra->value.reference->next = iterable->next->next; |
| 458 | mxCall(); |
| 459 | mxRunCount(0); |
| 460 | if (!mxIsReference(the->stack)) |
| 461 | mxTypeError("iterator: not an object"); |
| 462 | mxDub(); |
| 463 | mxGetID(mxID(_next)); |
| 464 | mxPullSlot(next); |
| 465 | mxPullSlot(iterator); |
| 466 | } |
| 467 | if (fxIteratorNext(the, iterator, next, value)) |
| 468 | return 1; |
| 469 | next->kind = XS_NULL_KIND; |
| 470 | iterator->kind = XS_NULL_KIND; |
| 471 | } |
| 472 | } |
| 473 | else if (status == XS_RETURN_STATUS) { |
| 474 | if (!mxIsNull(iterator)) |
| 475 | fxIteratorReturn(the, iterator, 0); |
| 476 | } |
| 477 | else if (status == XS_THROW_STATUS) { |
| 478 | if (!mxIsNull(iterator)) |
| 479 | fxIteratorReturn(the, iterator, 1); |
| 480 | } |
| 481 | return 0; |
| 482 | } |
| 483 | |
| 484 | void fx_Iterator_from(txMachine* the) |
| 485 | { |
nothing calls this directly
no test coverage detected