1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Fixed multiline inline block parsing

This commit is contained in:
Brian Fiete 2021-10-26 07:38:14 -07:00
parent 67ce0dcfee
commit 51622658dc

View file

@ -706,12 +706,18 @@ BfBlock* BfParser::ParseInlineBlock(int spaceIdx, int endIdx)
mSrcIdx = spaceIdx;
BfAstNode* startNode = NULL;
int usedEndIdx = spaceIdx;
int usedLineNum = mLineNum;
int usedLineStart = mLineStart;
while (true)
{
NextToken(endIdx + 1);
if (mSyntaxToken == BfSyntaxToken_HIT_END_IDX)
{
mSrcIdx = usedEndIdx;
mLineNum = usedLineNum;
mLineStart = usedLineStart;
auto lastNode = mSidechannelRootNode->GetLast();
if (lastNode != NULL)
mSrcIdx = std::max(mSrcIdx, lastNode->GetSrcEnd());
@ -719,6 +725,8 @@ BfBlock* BfParser::ParseInlineBlock(int spaceIdx, int endIdx)
}
usedEndIdx = mSrcIdx;
usedLineStart = mLineStart;
usedLineNum = mLineNum;
auto childNode = CreateNode();
if (childNode == NULL)