From 51622658dc7788974bb3e438f808157e75cd453e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 26 Oct 2021 07:38:14 -0700 Subject: [PATCH] Fixed multiline inline block parsing --- IDEHelper/Compiler/BfParser.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/IDEHelper/Compiler/BfParser.cpp b/IDEHelper/Compiler/BfParser.cpp index de367db2..dce0e396 100644 --- a/IDEHelper/Compiler/BfParser.cpp +++ b/IDEHelper/Compiler/BfParser.cpp @@ -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)