| 4688 | CodeInfo::nodeList.back()->SetCodeInfo(pos); |
| 4689 | } |
| 4690 | void AddIfElseTermNode(const char* pos) |
| 4691 | { |
| 4692 | CodeInfo::lastKnownStartPos = pos; |
| 4693 | assert(CodeInfo::nodeList.size() >= 3); |
| 4694 | |
| 4695 | if(OptimizeIfElse(true)) |
| 4696 | return; |
| 4697 | |
| 4698 | NodeZeroOP *bodyE = CodeInfo::nodeList.back(); CodeInfo::nodeList.pop_back(); |
| 4699 | NodeZeroOP *bodyT = CodeInfo::nodeList.back(); CodeInfo::nodeList.pop_back(); |
| 4700 | |
| 4701 | if(CodeInfo::nodeList.back()->typeInfo->type == TypeInfo::TYPE_COMPLEX && CodeInfo::nodeList.back()->typeInfo != typeObject) |
| 4702 | AddFunctionCallNode(pos, "bool", 1, true); |
| 4703 | |
| 4704 | CodeInfo::nodeList.push_back(bodyT); |
| 4705 | CodeInfo::nodeList.push_back(bodyE); |
| 4706 | |
| 4707 | TypeInfo* typeA = CodeInfo::nodeList[CodeInfo::nodeList.size()-1]->typeInfo; |
| 4708 | TypeInfo* typeB = CodeInfo::nodeList[CodeInfo::nodeList.size()-2]->typeInfo; |
| 4709 | if(typeA == typeVoid || typeB == typeVoid) |
| 4710 | ThrowError(pos, "ERROR: one of ternary operator ?: result type is void (%s : %s)", typeB->name, typeA->name); |
| 4711 | if(typeA != typeB && (typeA->type == TypeInfo::TYPE_COMPLEX || typeB->type == TypeInfo::TYPE_COMPLEX)) |
| 4712 | ThrowError(pos, "ERROR: ternary operator ?: result types are not equal (%s : %s)", typeB->name, typeA->name); |
| 4713 | CodeInfo::nodeList.push_back(new NodeIfElseExpr(true, true)); |
| 4714 | } |
| 4715 | |
| 4716 | void IncreaseCycleDepth() |
| 4717 | { |
no test coverage detected