| 4449 | } |
| 4450 | |
| 4451 | void fxTemplateNodeCode(void* it, void* param) |
| 4452 | { |
| 4453 | txTemplateNode* self = it; |
| 4454 | txCoder* coder = param; |
| 4455 | txParser* parser = coder->parser; |
| 4456 | txNode* item = self->items->first; |
| 4457 | |
| 4458 | if (self->reference) { |
| 4459 | txSymbol* symbol; |
| 4460 | txTargetCode* cacheTarget = fxCoderCreateTarget(param); |
| 4461 | txInteger i = (self->items->length / 2) + 1; |
| 4462 | txInteger raws = fxCoderUseTemporaryVariable(param); |
| 4463 | txInteger strings = fxCoderUseTemporaryVariable(param); |
| 4464 | txFlag flag = XS_DONT_DELETE_FLAG | XS_DONT_SET_FLAG; |
| 4465 | |
| 4466 | fxNodeDispatchCodeThis(self->reference, param, 0); |
| 4467 | fxCoderAddByte(param, 1, XS_CODE_CALL); |
| 4468 | |
| 4469 | fxGenerateTag(parser->console, parser->buffer, parser->bufferSize, (parser->path) ? parser->path->string : C_NULL); |
| 4470 | symbol = fxNewParserSymbol(parser, parser->buffer); |
| 4471 | fxCoderAddByte(param, 1, XS_CODE_TEMPLATE_CACHE); |
| 4472 | fxCoderAddSymbol(param, 0, XS_CODE_GET_PROPERTY, symbol); |
| 4473 | fxCoderAddBranch(param, 0, XS_CODE_BRANCH_COALESCE_1, cacheTarget); |
| 4474 | fxCoderAddByte(param, 1, XS_CODE_TEMPLATE_CACHE); |
| 4475 | |
| 4476 | fxCoderAddByte(param, 1, XS_CODE_ARRAY); |
| 4477 | fxCoderAddIndex(param, 0, XS_CODE_SET_LOCAL_1, strings); |
| 4478 | fxCoderAddInteger(param, 1, XS_CODE_INTEGER_1, i); |
| 4479 | fxCoderAddSymbol(param, -1, XS_CODE_SET_PROPERTY, coder->parser->lengthSymbol); |
| 4480 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 4481 | fxCoderAddByte(param, 1, XS_CODE_ARRAY); |
| 4482 | fxCoderAddIndex(param, 0, XS_CODE_SET_LOCAL_1, raws); |
| 4483 | fxCoderAddInteger(param, 1, XS_CODE_INTEGER_1, i); |
| 4484 | fxCoderAddSymbol(param, -1, XS_CODE_SET_PROPERTY, coder->parser->lengthSymbol); |
| 4485 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 4486 | i = 0; |
| 4487 | while (item) { |
| 4488 | if (item->description->token == XS_TOKEN_TEMPLATE_MIDDLE) { |
| 4489 | |
| 4490 | fxCoderAddIndex(param, 1, XS_CODE_GET_LOCAL_1, strings); |
| 4491 | fxCoderAddInteger(param, 1, XS_CODE_INTEGER_1, i); |
| 4492 | fxCoderAddByte(param, 0, XS_CODE_AT); |
| 4493 | if (((txTemplateItemNode*)item)->string->flags & mxStringErrorFlag) |
| 4494 | fxCoderAddByte(param, 1, XS_CODE_UNDEFINED); |
| 4495 | else |
| 4496 | fxNodeDispatchCode(((txTemplateItemNode*)item)->string, param); |
| 4497 | fxCoderAddByte(param, -3, XS_CODE_NEW_PROPERTY_AT); |
| 4498 | fxCoderAddInteger(param, 0, XS_CODE_INTEGER_1, flag); |
| 4499 | |
| 4500 | fxCoderAddIndex(param, 1, XS_CODE_GET_LOCAL_1, raws); |
| 4501 | fxCoderAddInteger(param, 1, XS_CODE_INTEGER_1, i); |
| 4502 | fxCoderAddByte(param, 0, XS_CODE_AT); |
| 4503 | fxNodeDispatchCode(((txTemplateItemNode*)item)->raw, param); |
| 4504 | fxCoderAddByte(param, -3, XS_CODE_NEW_PROPERTY_AT); |
| 4505 | fxCoderAddInteger(param, 0, XS_CODE_INTEGER_1, flag); |
| 4506 | |
| 4507 | i++; |
| 4508 | } |
nothing calls this directly
no test coverage detected