| 331 | } |
| 332 | |
| 333 | bool 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 | |
| 363 | bool BfParserData::IsWarningEnabledAtSrcIndex(int warningNumber, int srcIdx) |
| 364 | { |
no test coverage detected