1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Fixed invalid collapse comment batching

This commit is contained in:
Brian Fiete 2022-03-02 17:26:44 -08:00
parent 4d73c90dab
commit 85acdda2b4

View file

@ -9212,12 +9212,21 @@ BF_EXPORT const char* BF_CALLTYPE BfCompiler_GetCollapseRegions(BfCompiler* bfCo
}
int anchor = mStartSeriesIdx;
if (!ownsLine)
{
int nextLine = GetLineStartAfter(anchor);
if (nextLine != -1)
anchor = nextLine;
int checkLine = GetLineStartAfter(anchor);
if (checkLine != -1)
{
anchor = checkLine;
for (; anchor < mEndSeriesIdx; anchor++)
{
if (!::isspace((uint8)mParser->mSrc[anchor]))
break;
}
}
}
Add(anchor, mEndSeriesIdx, mSeriesKind);
}
mStartSeriesIdx = -1;
@ -9227,8 +9236,8 @@ BF_EXPORT const char* BF_CALLTYPE BfCompiler_GetCollapseRegions(BfCompiler* bfCo
{
for (int i = startIdx; i < mParser->mSrcLength - 1; i++)
{
if (mParser->mSrc[i] == '\n')
return i + 1;
if (mParser->mSrc[i] == '\n')
return i + 1;
}
return -1;
}