| 745 | } |
| 746 | |
| 747 | void fxHostNodeHoist(void* it, void* param) |
| 748 | { |
| 749 | txHostNode* self = it; |
| 750 | txHoister* hoister = param; |
| 751 | txScope* scope = hoister->bodyScope; |
| 752 | self->hostIndex = -1; |
| 753 | if ((scope->token != XS_TOKEN_MODULE) && (scope->token != XS_TOKEN_PROGRAM)) { |
| 754 | txParser* parser = hoister->parser; |
| 755 | while ((scope->token != XS_TOKEN_MODULE) && (scope->token != XS_TOKEN_PROGRAM)) |
| 756 | scope = scope->scope; |
| 757 | snprintf(parser->buffer, parser->bufferSize, "@%s", self->at->value); |
| 758 | txSymbol* symbol = fxNewParserSymbol(parser, parser->buffer); |
| 759 | if (!fxScopeGetDeclareNode(scope, symbol)) { |
| 760 | txDefineNode* definition = fxDefineNodeNew(parser, XS_TOKEN_DEFINE, symbol); |
| 761 | definition->initializer = (txNode*)fxHostNodeClone(parser, self); |
| 762 | fxScopeAddDeclareNode(scope, (txDeclareNode*)definition); |
| 763 | fxScopeAddDefineNode(scope, definition); |
| 764 | } |
| 765 | txAccessNode* access = it; |
| 766 | access->description = &gxTokenDescriptions[XS_TOKEN_ACCESS]; |
| 767 | access->symbol = symbol; |
| 768 | access->initializer = C_NULL; |
| 769 | access->declaration = C_NULL; |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | void fxImportNodeHoist(void* it, void* param) |
| 774 | { |
nothing calls this directly
no test coverage detected