| 5765 | |
| 5766 | |
| 5767 | struct ArrayIExpr : public CppiaExpr |
| 5768 | { |
| 5769 | int classId; |
| 5770 | CppiaExpr *thisExpr; |
| 5771 | CppiaExpr *iExpr; |
| 5772 | CppiaExpr *value; |
| 5773 | CrementOp crementOp; |
| 5774 | AssignOp assignOp; |
| 5775 | |
| 5776 | |
| 5777 | ArrayIExpr(CppiaStream &stream) |
| 5778 | { |
| 5779 | classId = stream.getInt(); |
| 5780 | thisExpr = createCppiaExpr(stream); |
| 5781 | iExpr = createCppiaExpr(stream); |
| 5782 | value = 0; |
| 5783 | crementOp = coNone; |
| 5784 | assignOp = aoNone; |
| 5785 | } |
| 5786 | |
| 5787 | const char *getName() HXCPP_OVERRIDE { return "ArrayIExpr"; } |
| 5788 | |
| 5789 | CppiaExpr *link(CppiaModule &inModule) HXCPP_OVERRIDE |
| 5790 | { |
| 5791 | TypeData *type = inModule.types[classId]; |
| 5792 | |
| 5793 | CppiaExpr *replace = 0; |
| 5794 | |
| 5795 | if (type->name==HX_CSTRING("Dynamic")) |
| 5796 | { |
| 5797 | replace = new DynamicArrayI(this, thisExpr, iExpr); |
| 5798 | } |
| 5799 | else |
| 5800 | { |
| 5801 | if (!type->arrayType) |
| 5802 | { |
| 5803 | replace = new ArrayAccessI(this,classId, thisExpr, iExpr); |
| 5804 | } |
| 5805 | else |
| 5806 | { |
| 5807 | Expressions val; |
| 5808 | val.push_back(iExpr); |
| 5809 | replace = createArrayBuiltin(this, type->arrayType, thisExpr, HX_CSTRING("__get"), val); |
| 5810 | } |
| 5811 | } |
| 5812 | replace = replace->link(inModule); |
| 5813 | |
| 5814 | delete this; |
| 5815 | return replace; |
| 5816 | } |
| 5817 | |
| 5818 | }; |
| 5819 | |
| 5820 | |
| 5821 |
nothing calls this directly
no outgoing calls
no test coverage detected