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

Function fxListModules

xs/sources/xsDebug.c:2461–2503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2459}
2460
2461void fxListModules(txMachine* the)
2462{
2463 txInspectorNameList aList = { C_NULL, C_NULL };
2464 txSlot* realm = fxFindRealm(the);
2465 txSlot* moduleMap = mxModuleMap(realm);
2466 txSlot* instance = fxGetInstance(the, moduleMap);
2467 txSlot* instanceInspector = fxToInstanceInspector(the, instance);
2468 txSlot* modules = mxOwnModules(realm)->value.reference;
2469 txSlot* module;
2470 fxEcho(the, "<grammar>");
2471 if (instance->next) {
2472 fxEcho(the, "<node");
2473 if (instanceInspector)
2474 fxEchoFlags(the, "-", moduleMap->flag);
2475 else
2476 fxEchoFlags(the, "+", moduleMap->flag);
2477 fxEcho(the, " name=\"(map)\"");
2478 fxEchoAddress(the, instance);
2479 if (instanceInspector) {
2480 fxEcho(the, ">");
2481 fxEchoInstance(the, instance, &aList);
2482 fxEcho(the, "</node>");
2483 }
2484 else
2485 fxEcho(the, "/>");
2486 }
2487 module = modules->next;
2488 while (module) {
2489 if (mxIsReference(module))
2490 fxEchoModule(the, module, &aList);
2491 module = module->next;
2492 }
2493 modules = modules->value.instance.prototype;
2494 if (modules) {
2495 module = modules->next;
2496 while (module) {
2497 if (mxIsReference(module))
2498 fxEchoModule(the, module, &aList);
2499 module = module->next;
2500 }
2501 }
2502 fxEcho(the, "</grammar>");
2503}
2504
2505void fxLogin(txMachine* the)
2506{

Callers 3

fxDebugEvalFunction · 0.85
fxDebugLoopFunction · 0.85
fxDebugPushTagFunction · 0.85

Calls 8

fxFindRealmFunction · 0.85
fxGetInstanceFunction · 0.85
fxToInstanceInspectorFunction · 0.85
fxEchoFunction · 0.85
fxEchoFlagsFunction · 0.85
fxEchoAddressFunction · 0.85
fxEchoInstanceFunction · 0.85
fxEchoModuleFunction · 0.85

Tested by

no test coverage detected