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

Method GetIndexAtLine

IDEHelper/Compiler/BfParser.cpp:515–533  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515int BfParser::GetIndexAtLine(int line)
516{
517 if (line == 0)
518 return 0;
519
520 int curLine = 0;
521 for (int i = 0; i < mSrcLength; i++)
522 {
523 char c = mSrc[i];
524 if (c == '\n')
525 {
526 curLine++;
527 if (line == curLine)
528 return i + 1;
529 }
530 }
531
532 return -1;
533}
534
535void BfParser::Fail(const StringImpl& error, int offset)
536{

Callers 2

BfParser_GetIndexAtLineFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected