| 2757 | } |
| 2758 | |
| 2759 | void fxCompoundExpressionNodeCode(void* it, void* param) |
| 2760 | { |
| 2761 | txAssignNode* self = it; |
| 2762 | txCoder* coder = param; |
| 2763 | txToken token = self->description->token; |
| 2764 | txFlag shortcut = ((token == XS_TOKEN_AND_ASSIGN) || (token == XS_TOKEN_COALESCE_ASSIGN) || (token == XS_TOKEN_OR_ASSIGN)) ? 1 : 0; |
| 2765 | txTargetCode* elseTarget = (shortcut) ? fxCoderCreateTarget(param) : C_NULL; |
| 2766 | txTargetCode* endTarget = (shortcut) ? fxCoderCreateTarget(param) : C_NULL; |
| 2767 | txInteger stackLevel = 0; |
| 2768 | txFlag swap = fxNodeDispatchCodeThis(self->reference, param, 1); |
| 2769 | switch (self->description->token) { |
| 2770 | case XS_TOKEN_AND_ASSIGN: |
| 2771 | fxCoderAddByte(param, 1, XS_CODE_DUB); |
| 2772 | fxCoderAddBranch(param, -1, XS_CODE_BRANCH_ELSE_1, elseTarget); |
| 2773 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 2774 | fxNodeDispatchCode(self->value, param); |
| 2775 | fxCompoundExpressionNodeCodeName(it, param); |
| 2776 | stackLevel = coder->stackLevel; |
| 2777 | break; |
| 2778 | case XS_TOKEN_COALESCE_ASSIGN: |
| 2779 | fxCoderAddBranch(param, -1, XS_CODE_BRANCH_COALESCE_1, elseTarget); |
| 2780 | fxNodeDispatchCode(self->value, param); |
| 2781 | fxCompoundExpressionNodeCodeName(it, param); |
| 2782 | stackLevel = coder->stackLevel; |
| 2783 | break; |
| 2784 | case XS_TOKEN_OR_ASSIGN: |
| 2785 | fxCoderAddByte(param, 1, XS_CODE_DUB); |
| 2786 | fxCoderAddBranch(param, -1, XS_CODE_BRANCH_IF_1, elseTarget); |
| 2787 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 2788 | fxNodeDispatchCode(self->value, param); |
| 2789 | fxCompoundExpressionNodeCodeName(it, param); |
| 2790 | stackLevel = coder->stackLevel; |
| 2791 | break; |
| 2792 | default: |
| 2793 | fxNodeDispatchCode(self->value, param); |
| 2794 | fxCoderAddByte(param, -1, self->description->code); |
| 2795 | break; |
| 2796 | } |
| 2797 | fxNodeDispatchCodeAssign(self->reference, param, 0); |
| 2798 | if (shortcut) { |
| 2799 | fxCoderAddBranch(param, 0, XS_CODE_BRANCH_1, endTarget); |
| 2800 | coder->stackLevel = stackLevel; |
| 2801 | fxCoderAdd(param, 0, elseTarget); |
| 2802 | while (swap > 0) { |
| 2803 | if (!(self->flags & mxExpressionNoValue)) |
| 2804 | fxCoderAddByte(param, 0, XS_CODE_SWAP); |
| 2805 | fxCoderAddByte(param, -1, XS_CODE_POP); |
| 2806 | swap--; |
| 2807 | } |
| 2808 | fxCoderAdd(param, 0, endTarget); |
| 2809 | } |
| 2810 | } |
| 2811 | |
| 2812 | void fxCompoundExpressionNodeCodeName(void* it, void* param) |
| 2813 | { |
nothing calls this directly
no test coverage detected