| 445 | //========================================================================== |
| 446 | |
| 447 | FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx) |
| 448 | { |
| 449 | CHECKRESOLVED(); |
| 450 | bool failed = false; |
| 451 | |
| 452 | SAFE_RESOLVE_OPT(Self, ctx); |
| 453 | for (unsigned i = 0; i < ArgList.Size(); i++) |
| 454 | { |
| 455 | ArgList[i] = ArgList[i]->Resolve(ctx); |
| 456 | if (ArgList[i] == nullptr) |
| 457 | { |
| 458 | failed = true; |
| 459 | } |
| 460 | else if (Special < 0 && i == 0) |
| 461 | { |
| 462 | if (ArgList[i]->ValueType == TypeString) |
| 463 | { |
| 464 | ArgList[i] = new FxNameCast(ArgList[i]); |
| 465 | ArgList[i] = ArgList[i]->Resolve(ctx); |
| 466 | if (ArgList[i] == nullptr) |
| 467 | { |
| 468 | failed = true; |
| 469 | } |
| 470 | } |
| 471 | else if (ArgList[i]->ValueType != TypeName) |
| 472 | { |
| 473 | ScriptPosition.Message(MSG_ERROR, "Name expected for parameter %d", i); |
| 474 | failed = true; |
| 475 | } |
| 476 | } |
| 477 | else if (!ArgList[i]->IsInteger()) |
| 478 | { |
| 479 | if (ArgList[i]->ValueType->GetRegType() == REGT_FLOAT /* lax */) |
| 480 | { |
| 481 | ArgList[i] = new FxIntCast(ArgList[i], ctx.FromDecorate); |
| 482 | ArgList[i] = ArgList[i]->Resolve(ctx); |
| 483 | if (ArgList[i] == nullptr) |
| 484 | { |
| 485 | delete this; |
| 486 | return nullptr; |
| 487 | } |
| 488 | } |
| 489 | else |
| 490 | { |
| 491 | ScriptPosition.Message(MSG_ERROR, "Integer expected for parameter %d", i); |
| 492 | failed = true; |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | |
| 498 | if (failed) |
| 499 | { |
| 500 | delete this; |
| 501 | return nullptr; |
| 502 | } |
| 503 | ValueType = TypeSInt32; |
| 504 | return this; |
no test coverage detected