| 430 | } |
| 431 | |
| 432 | txSlot* fxAt(txMachine* the, txSlot* slot) |
| 433 | { |
| 434 | txIndex index; |
| 435 | txString string; |
| 436 | again: |
| 437 | if ((slot->kind == XS_INTEGER_KIND) && fxIntegerToIndex(the, slot->value.integer, &index)) { |
| 438 | slot->value.at.id = XS_NO_ID; |
| 439 | slot->value.at.index = index; |
| 440 | } |
| 441 | else if ((slot->kind == XS_NUMBER_KIND) && fxNumberToIndex(the, slot->value.number, &index)) { |
| 442 | slot->value.at.id = XS_NO_ID; |
| 443 | slot->value.at.index = index; |
| 444 | } |
| 445 | else if (slot->kind == XS_SYMBOL_KIND) { |
| 446 | slot->value.at.id = slot->value.symbol; |
| 447 | slot->value.at.index = 0; |
| 448 | } |
| 449 | else { |
| 450 | if (slot->kind == XS_REFERENCE_KIND) { |
| 451 | fxToPrimitive(the, slot, XS_STRING_HINT); |
| 452 | goto again; |
| 453 | } |
| 454 | string = fxToString(the, slot); |
| 455 | if (fxStringToIndex(the, string, &index)) { |
| 456 | slot->value.at.id = XS_NO_ID; |
| 457 | slot->value.at.index = index; |
| 458 | } |
| 459 | else { |
| 460 | txID id; |
| 461 | if (slot->kind == XS_STRING_X_KIND) |
| 462 | id = fxNewNameX(the, string); |
| 463 | else |
| 464 | id = fxNewName(the, slot); |
| 465 | slot->value.at.id = id; |
| 466 | slot->value.at.index = 0; |
| 467 | } |
| 468 | } |
| 469 | slot->kind = XS_AT_KIND; |
| 470 | return slot; |
| 471 | } |
| 472 | |
| 473 | void fxKeyAt(txMachine* the, txID id, txIndex index, txSlot* slot) |
| 474 | { |
no test coverage detected