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

Method DeferFail

IDEHelper/Compiler/BfSystem.cpp:1749–1782  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1747}
1748
1749BfError* BfPassInstance::DeferFail(const StringImpl& error, BfAstNode* refNode)
1750{
1751 mLastWasAdded = false;
1752 mFailedIdx++;
1753 if ((int)mErrors.size() >= sMaxErrors)
1754 return NULL;
1755
1756 if (refNode == NULL)
1757 {
1758 return Fail(error);
1759 }
1760
1761 if (!WantsRangeRecorded(refNode->GetSourceData(), refNode->GetSrcStart(), refNode->GetSrcLength(), false, true))
1762 return NULL;
1763
1764 ++mDeferredErrorCount;
1765 BfError* errorVal = new BfError();
1766 errorVal->mIsWarning = false;
1767 errorVal->mIsDeferred = true;
1768 errorVal->SetSource(this, refNode->GetSourceData());
1769 errorVal->mIsAfter = false;
1770 errorVal->mError = error;
1771 errorVal->mSrcStart = refNode->GetSrcStart();
1772 errorVal->mSrcEnd = refNode->GetSrcEnd();
1773 mErrors.push_back(errorVal);
1774 mErrorSet.Add(BfErrorEntry(errorVal));
1775 mLastWasAdded = true;
1776
1777 BF_ASSERT(!refNode->IsTemporary());
1778 auto parser = errorVal->mSource->ToParserData();
1779
1780 mLastWasDisplayed = false;
1781 return errorVal;
1782}
1783
1784void BfPassInstance::SilentFail()
1785{

Callers 1

FailMethod · 0.80

Calls 12

FailFunction · 0.85
BfErrorEntryClass · 0.85
GetSourceDataMethod · 0.80
sizeMethod · 0.45
GetSrcStartMethod · 0.45
GetSrcLengthMethod · 0.45
SetSourceMethod · 0.45
GetSrcEndMethod · 0.45
push_backMethod · 0.45
AddMethod · 0.45
IsTemporaryMethod · 0.45
ToParserDataMethod · 0.45

Tested by

no test coverage detected