| 401 // |
401 // |
| 402 ExpressionValue* Expression::EvaluateOperator (const ExpressionOperator* op, |
402 ExpressionValue* Expression::EvaluateOperator (const ExpressionOperator* op, |
| 403 const List<ExpressionValue*>& values) |
403 const List<ExpressionValue*>& values) |
| 404 { |
404 { |
| 405 const OperatorInfo* info = &gOperators[op->GetID()]; |
405 const OperatorInfo* info = &gOperators[op->GetID()]; |
| |
406 Print ("Process operator %1\n", info - gOperators); |
| 406 bool isconstexpr = true; |
407 bool isconstexpr = true; |
| 407 |
408 |
| 408 for (ExpressionValue* val : values) |
409 for (ExpressionValue* val : values) |
| 409 { |
410 { |
| 410 if (val->IsConstexpr() == false) |
411 if (val->IsConstexpr() == false) |
| 447 buf->WriteDWord (dhGoto); // afterwards, jump to the end, which is |
448 buf->WriteDWord (dhGoto); // afterwards, jump to the end, which is |
| 448 buf->AddReference (mark2); // marked by mark2. |
449 buf->AddReference (mark2); // marked by mark2. |
| 449 buf->AdjustMark (mark1); // move mark1 at the end of the true case |
450 buf->AdjustMark (mark1); // move mark1 at the end of the true case |
| 450 buf->MergeAndDestroy (b2); // perform third operand (false case) |
451 buf->MergeAndDestroy (b2); // perform third operand (false case) |
| 451 buf->AdjustMark (mark2); // move the ending mark2 here |
452 buf->AdjustMark (mark2); // move the ending mark2 here |
| |
453 |
| |
454 Print ("Mark positions: %1 %2\n", mark1->pos, mark2->pos); |
| |
455 |
| |
456 for (int i = 0; i < 3; ++i) |
| |
457 values[i]->SetBuffer (null); |
| 452 } |
458 } |
| 453 else |
459 else |
| 454 { |
460 { |
| 455 // Generic case: write all arguments and apply the operator's |
461 // Generic case: write all arguments and apply the operator's |
| 456 // data header. |
462 // data header. |