| 7697 | const char *getName() HXCPP_OVERRIDE { return "OpCompare"; } |
| 7698 | |
| 7699 | CppiaExpr *link(CppiaModule &inModule) HXCPP_OVERRIDE |
| 7700 | { |
| 7701 | left = left->link(inModule); |
| 7702 | right = right->link(inModule); |
| 7703 | ExprType t1 = left->getType(); |
| 7704 | ExprType t2 = right->getType(); |
| 7705 | |
| 7706 | if (isNumeric(t1) && isNumeric(t2)) |
| 7707 | { |
| 7708 | compareType = t1==etInt && t2==etInt ? compInt : compFloat; |
| 7709 | } |
| 7710 | else if (t1==etString || t2==etString) |
| 7711 | { |
| 7712 | compareType = compString; |
| 7713 | } |
| 7714 | else |
| 7715 | compareType = compDynamic; |
| 7716 | |
| 7717 | return this; |
| 7718 | } |
| 7719 | |
| 7720 | hx::Object *runObject(CppiaCtx *ctx) HXCPP_OVERRIDE |
| 7721 | { |