MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxBuildKeys

Function fxBuildKeys

xs/tools/xsl.c:780–804  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778/* KEYS */
779
780void fxBuildKeys(txMachine* the)
781{
782 txLinker* linker = (txLinker*)(the->context);
783 txID c = linker->symbolIndex, i = 0;
784 {
785 txSlot* key = fxFindKey(the);
786 key->flag = XS_INTERNAL_FLAG | XS_DONT_DELETE_FLAG;
787 i++;
788 }
789 for (; i < XS_SYMBOL_ID_COUNT; i++) {
790 txLinkerSymbol* symbol = linker->symbolArray[i];
791 txSlot* key = fxFindKey(the);
792 txSlot* instance = fxNewInstance(the);
793 txSlot* property = fxNextSymbolProperty(the, instance, i, XS_NO_ID, XS_INTERNAL_FLAG);
794 fxNextStringXProperty(the, property, symbol->string, XS_NO_ID, XS_INTERNAL_FLAG);
795 key->flag = XS_INTERNAL_FLAG | XS_DONT_DELETE_FLAG;
796 key->kind = XS_REFERENCE_KIND;
797 key->value.reference = instance;
798 mxPop();
799 }
800 for (; i < c; i++) {
801 txLinkerSymbol* symbol = linker->symbolArray[i];
802 fxNewNameX(the, symbol->string);
803 }
804}
805
806/* MODULES */
807

Callers

nothing calls this directly

Calls 5

fxFindKeyFunction · 0.85
fxNewInstanceFunction · 0.85
fxNextSymbolPropertyFunction · 0.85
fxNextStringXPropertyFunction · 0.85
fxNewNameXFunction · 0.85

Tested by

no test coverage detected