mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-16 23:34:10 +02:00
Fixed multiline inline block parsing
This commit is contained in:
parent
67ce0dcfee
commit
51622658dc
1 changed files with 8 additions and 0 deletions
|
@ -706,12 +706,18 @@ BfBlock* BfParser::ParseInlineBlock(int spaceIdx, int endIdx)
|
||||||
mSrcIdx = spaceIdx;
|
mSrcIdx = spaceIdx;
|
||||||
BfAstNode* startNode = NULL;
|
BfAstNode* startNode = NULL;
|
||||||
int usedEndIdx = spaceIdx;
|
int usedEndIdx = spaceIdx;
|
||||||
|
int usedLineNum = mLineNum;
|
||||||
|
int usedLineStart = mLineStart;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
NextToken(endIdx + 1);
|
NextToken(endIdx + 1);
|
||||||
if (mSyntaxToken == BfSyntaxToken_HIT_END_IDX)
|
if (mSyntaxToken == BfSyntaxToken_HIT_END_IDX)
|
||||||
{
|
{
|
||||||
mSrcIdx = usedEndIdx;
|
mSrcIdx = usedEndIdx;
|
||||||
|
mLineNum = usedLineNum;
|
||||||
|
mLineStart = usedLineStart;
|
||||||
|
|
||||||
auto lastNode = mSidechannelRootNode->GetLast();
|
auto lastNode = mSidechannelRootNode->GetLast();
|
||||||
if (lastNode != NULL)
|
if (lastNode != NULL)
|
||||||
mSrcIdx = std::max(mSrcIdx, lastNode->GetSrcEnd());
|
mSrcIdx = std::max(mSrcIdx, lastNode->GetSrcEnd());
|
||||||
|
@ -719,6 +725,8 @@ BfBlock* BfParser::ParseInlineBlock(int spaceIdx, int endIdx)
|
||||||
}
|
}
|
||||||
|
|
||||||
usedEndIdx = mSrcIdx;
|
usedEndIdx = mSrcIdx;
|
||||||
|
usedLineStart = mLineStart;
|
||||||
|
usedLineNum = mLineNum;
|
||||||
|
|
||||||
auto childNode = CreateNode();
|
auto childNode = CreateNode();
|
||||||
if (childNode == NULL)
|
if (childNode == NULL)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue