| 325 | } |
| 326 | |
| 327 | txBoolean fxGetIteratorFlattenable(txMachine* the, txSlot* iterable, txSlot* iterator, txSlot* next, txBoolean optional) |
| 328 | { |
| 329 | if (!mxIsReference(iterable)) { |
| 330 | if (optional) { |
| 331 | if ((iterable->kind != XS_STRING_KIND) && (iterable->kind != XS_STRING_X_KIND)) |
| 332 | mxTypeError("iterator: not a string"); |
| 333 | } |
| 334 | else |
| 335 | mxTypeError("iterator: not an object"); |
| 336 | } |
| 337 | mxPushSlot(iterable); |
| 338 | mxDub(); |
| 339 | mxGetID(mxID(_Symbol_iterator)); |
| 340 | if ((mxIsUndefined(the->stack) || mxIsNull(the->stack))) |
| 341 | mxPop(); |
| 342 | else { |
| 343 | mxCall(); |
| 344 | mxRunCount(0); |
| 345 | } |
| 346 | if (!mxIsReference(the->stack)) |
| 347 | mxTypeError("iterator: not an object"); |
| 348 | mxDub(); |
| 349 | mxGetID(mxID(_next)); |
| 350 | mxPullSlot(next); |
| 351 | mxPullSlot(iterator); |
| 352 | return 1; |
| 353 | } |
| 354 | |
| 355 | txSlot* fxNewIteratorInstance(txMachine* the, txSlot* iterable, txID id) |
| 356 | { |
no outgoing calls
no test coverage detected