| 321 | #if mxUseDefaultParseScript |
| 322 | |
| 323 | txScript* fxParseScript(txMachine* the, void* stream, txGetter getter, txUnsigned flags) |
| 324 | { |
| 325 | txParser _parser; |
| 326 | txParser* parser = &_parser; |
| 327 | txParserJump jump; |
| 328 | txScript* script = NULL; |
| 329 | fxInitializeParser(parser, the, the->parserBufferSize, the->parserTableModulo); |
| 330 | parser->firstJump = &jump; |
| 331 | if (c_setjmp(jump.jmp_buf) == 0) { |
| 332 | fxParserTree(parser, stream, getter, flags, NULL); |
| 333 | #ifdef mxDebug |
| 334 | parser->flags |= mxDebugFlag; |
| 335 | if (!the->debugEval) { |
| 336 | if (!parser->source) { |
| 337 | char tag[16]; |
| 338 | parser->flags |= mxDebugFlag; |
| 339 | fxGenerateTag(the, tag, sizeof(tag), C_NULL); |
| 340 | parser->source = fxNewParserSymbol(parser, tag); |
| 341 | } |
| 342 | if (fxIsConnected(the)) { |
| 343 | if (getter == fxStringGetter) |
| 344 | fxFileEvalString(the, ((txStringStream*)stream)->slot->value.string, parser->source->string); |
| 345 | else if (getter == fxStringCGetter) |
| 346 | fxFileEvalString(the, ((txStringCStream*)stream)->buffer, parser->source->string); |
| 347 | } |
| 348 | } |
| 349 | #endif |
| 350 | fxParserHoist(parser); |
| 351 | fxParserBind(parser); |
| 352 | script = fxParserCode(parser); |
| 353 | } |
| 354 | #ifdef mxInstrument |
| 355 | if (the->peakParserSize < parser->total) |
| 356 | the->peakParserSize = parser->total; |
| 357 | #endif |
| 358 | fxTerminateParser(parser); |
| 359 | return script; |
| 360 | } |
| 361 | |
| 362 | #endif /* mxUseDefaultParseScript */ |
| 363 |
no test coverage detected