| 296 | } |
| 297 | |
| 298 | void BfParserData::GetLineCharAtIdx(int idx, int& line, int& lineChar) |
| 299 | { |
| 300 | if (mJumpTableSize <= 0) |
| 301 | { |
| 302 | line = 0; |
| 303 | lineChar = 0; |
| 304 | return; |
| 305 | } |
| 306 | |
| 307 | if (idx >= mSrcLength) |
| 308 | idx = mSrcLength - 1; |
| 309 | auto* jumpEntry = mJumpTable + (idx / PARSER_JUMPTABLE_DIVIDE); |
| 310 | if (jumpEntry->mCharIdx > idx) |
| 311 | jumpEntry--; |
| 312 | |
| 313 | line = jumpEntry->mLineNum; |
| 314 | lineChar = 0; |
| 315 | int curSrcPos = jumpEntry->mCharIdx; |
| 316 | |
| 317 | while (curSrcPos < idx) |
| 318 | { |
| 319 | if (mSrc[curSrcPos] == '\n') |
| 320 | { |
| 321 | line++; |
| 322 | lineChar = 0; |
| 323 | } |
| 324 | else |
| 325 | { |
| 326 | lineChar++; |
| 327 | } |
| 328 | |
| 329 | curSrcPos++; |
| 330 | } |
| 331 | } |
| 332 | |
| 333 | bool BfParserData::IsUnwarnedAt(BfAstNode* node) |
| 334 | { |
no outgoing calls
no test coverage detected