MCPcopy Create free account
hub / github.com/beefytech/Beef / FailCurrent

Method FailCurrent

IDEHelper/Compiler/CeMachine.cpp:10749–10777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10747}
10748
10749BfError* CeMachine::FailCurrent(BfModule* srcModule, const StringImpl& error, BfAstNode* refNode)
10750{
10751 BfError* bfError = NULL;
10752
10753 if ((mCurBuilder != NULL) &&
10754 ((mCurContext != NULL) || (mCurBuilder->mRecursiveDepth > mCurContext->mRecursiveDepth)))
10755 {
10756 String useError = error;
10757 useError += StrFormat(" during const-eval generation of '%s'", srcModule->MethodToString(mCurBuilder->mCeFunction->mMethodInstance).c_str());
10758 bfError = srcModule->Fail(error, refNode);
10759
10760 if (bfError != NULL)
10761 {
10762 auto filePos = mCurBuilder->mCeMachine->mCeModule->mCurFilePosition;
10763 auto parser = filePos.mFileInstance->mParser;
10764 if (parser != NULL)
10765 {
10766 srcModule->mCompiler->mPassInstance->MoreInfoAt(
10767 StrFormat("See comptime method '%s' processing location", srcModule->MethodToString(mCurBuilder->mCeFunction->mMethodInstance).c_str()),
10768 parser, filePos.mCurSrcPos, 1, BfFailFlag_None);
10769 }
10770 }
10771 }
10772 else
10773 {
10774 bfError = srcModule->Fail(error, refNode);
10775 }
10776 return bfError;
10777}
10778
10779void CeMachine::FailCurrentMoreInfo(const StringImpl& error, BfAstNode* refNode)
10780{

Callers 1

DoPopulateTypeMethod · 0.80

Calls 4

MethodToStringMethod · 0.80
MoreInfoAtMethod · 0.80
c_strMethod · 0.45
FailMethod · 0.45

Tested by

no test coverage detected