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

Method IsUnwarnedAt

IDEHelper/Compiler/BfParser.cpp:333–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331}
332
333bool BfParserData::IsUnwarnedAt(BfAstNode* node)
334{
335 if (mUnwarns.empty())
336 return false;
337 auto unwarnItr = mUnwarns.upper_bound(node->GetSrcStart());
338 if (unwarnItr == mUnwarns.begin())
339 return false;
340 unwarnItr--;
341
342 int unwarnIdx = *unwarnItr;
343
344 int checkIdx = node->GetSrcStart();
345 int lineCount = 0;
346 while (checkIdx > 0)
347 {
348 checkIdx--;
349 if (checkIdx < unwarnIdx)
350 return true;
351 if (mSrc[checkIdx] == '\n')
352 {
353 lineCount++;
354 // #unwarn must be immediately preceding the start of the statement containing this node
355 if (lineCount == 2)
356 return false;
357 }
358 }
359
360 return true;
361}
362
363bool BfParserData::IsWarningEnabledAtSrcIndex(int warningNumber, int srcIdx)
364{

Callers 4

WarnMethod · 0.80
WantsWarningMethod · 0.80
WarnMethod · 0.80
WarnAfterMethod · 0.80

Calls 3

emptyMethod · 0.45
GetSrcStartMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected