mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +02:00
Fixed define block srcEnd in initializer block
This commit is contained in:
parent
971cecdd99
commit
c600f86da5
1 changed files with 7 additions and 3 deletions
|
@ -7907,10 +7907,14 @@ BfInitializerExpression* BfReducer::TryCreateInitializerExpression(BfAstNode* ta
|
|||
{
|
||||
if ((allowInitializerStatement) && (!IsInitializerStatement(node)))
|
||||
{
|
||||
auto defBlock = mAlloc->Alloc<BfBlock>();
|
||||
ReplaceNode(block, defBlock);
|
||||
*defBlock = *block;
|
||||
|
||||
auto typeDecl = mAlloc->Alloc<BfInitializerTypeDeclaration>();
|
||||
ReplaceNode(node, typeDecl);
|
||||
block->mOpenBrace = NULL;
|
||||
MEMBER_SET(typeDecl, mDefineNode, block);
|
||||
defBlock->mOpenBrace = NULL;
|
||||
MEMBER_SET(typeDecl, mDefineNode, defBlock);
|
||||
InitAnonymousType(typeDecl);
|
||||
HandleTypeDeclaration(typeDecl, NULL, NULL, true);
|
||||
initializerStartIdx = mVisitorPos.mWritePos;
|
||||
|
@ -7971,7 +7975,7 @@ BfInitializerExpression* BfReducer::TryCreateInitializerExpression(BfAstNode* ta
|
|||
int srcEnd = block->mSrcEnd;
|
||||
if (initializerStartIdx > 0)
|
||||
srcEnd = block->mChildArr[initializerStartIdx - 1]->mSrcEnd;
|
||||
block->mSrcEnd = srcEnd;
|
||||
typeDecl->mDefineNode->mSrcEnd = srcEnd;
|
||||
typeDecl->mSrcEnd = srcEnd;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue