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

Function fxParseScript

xs/platforms/mc/xsHosts.c:392–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390}
391
392txScript* fxParseScript(txMachine* the, void* stream, txGetter getter, txUnsigned flags)
393{
394 txParser _parser;
395 txParser* parser = &_parser;
396 txParserJump jump;
397 txScript* script = NULL;
398 fxInitializeParser(parser, the, the->parserBufferSize, the->parserTableModulo);
399 parser->firstJump = &jump;
400 if (c_setjmp(jump.jmp_buf) == 0) {
401#if defined(mxDebug) && !MODDEF_XS_TEST
402 if (fxIsConnected(the)) {
403 char tag[16];
404 flags |= mxDebugFlag;
405 fxGenerateTag(the, tag, sizeof(tag), C_NULL);
406 fxFileEvalString(the, ((txStringStream*)stream)->slot->value.string, tag);
407 parser->path = fxNewParserSymbol(parser, tag);
408 }
409#endif
410 fxParserTree(parser, stream, getter, flags, NULL);
411 fxParserHoist(parser);
412 fxParserBind(parser);
413 script = fxParserCode(parser);
414 }
415#ifdef mxInstrument
416 if (the->peakParserSize < parser->total)
417 the->peakParserSize = parser->total;
418#endif
419 fxTerminateParser(parser);
420 return script;
421}
422
423#if MODDEF_XS_MODS
424

Callers

nothing calls this directly

Calls 10

fxInitializeParserFunction · 0.85
fxFileEvalStringFunction · 0.85
fxNewParserSymbolFunction · 0.85
fxParserTreeFunction · 0.85
fxParserHoistFunction · 0.85
fxParserBindFunction · 0.85
fxParserCodeFunction · 0.85
fxTerminateParserFunction · 0.85
fxIsConnectedFunction · 0.50
fxGenerateTagFunction · 0.50

Tested by

no test coverage detected