| 3654 | } |
| 3655 | |
| 3656 | void BfModule::InternalError(const StringImpl& error, BfAstNode* refNode, const char* file, int line) |
| 3657 | { |
| 3658 | static bool isInside = false; |
| 3659 | if (isInside) |
| 3660 | return; |
| 3661 | |
| 3662 | isInside = true; |
| 3663 | |
| 3664 | String fullError = error; |
| 3665 | |
| 3666 | if (file != NULL) |
| 3667 | fullError += StrFormat(" at %s:%d", file, line); |
| 3668 | |
| 3669 | fullError += StrFormat("\nModule: %s", mModuleName.c_str()); |
| 3670 | |
| 3671 | if (mCurTypeInstance != NULL) |
| 3672 | fullError += StrFormat("\nType: %s", TypeToString(mCurTypeInstance).c_str()); |
| 3673 | if (mCurMethodInstance != NULL) |
| 3674 | fullError += StrFormat("\nMethod: %s", MethodToString(mCurMethodInstance).c_str()); |
| 3675 | |
| 3676 | if ((mCurFilePosition.mFileInstance != NULL) && (mCurFilePosition.mFileInstance->mParser != NULL)) |
| 3677 | fullError += StrFormat("\nSource Location: %s:%d", mCurFilePosition.mFileInstance->mParser->mFileName.c_str(), mCurFilePosition.mCurLine + 1); |
| 3678 | |
| 3679 | Fail(String("INTERNAL ERROR: ") + fullError, refNode); |
| 3680 | |
| 3681 | isInside = false; |
| 3682 | } |
| 3683 | |
| 3684 | void BfModule::NotImpl(BfAstNode* astNode) |
| 3685 | { |
no test coverage detected