1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Added type initializer blocks

This commit is contained in:
Brian Fiete 2020-10-23 07:48:41 -07:00
parent 9a857cceb3
commit 879b15ecd8
6 changed files with 154 additions and 71 deletions

View file

@ -5774,8 +5774,19 @@ BfAstNode* BfReducer::ReadTypeMember(BfTokenNode* tokenNode, int depth, BfAstNod
ctorDecl->mReturnType = NULL;
ReplaceNode(tokenNode, ctorDecl);
MEMBER_SET(ctorDecl, mThisToken, tokenNode);
if (auto block = BfNodeDynCast<BfBlock>(mVisitorPos.GetNext()))
{
mVisitorPos.MoveNext();
MEMBER_SET(ctorDecl, mBody, block);
ParseMethod(ctorDecl, &params, &commas);
if (IsNodeRelevant(ctorDecl))
{
SetAndRestoreValue<BfMethodDeclaration*> prevMethodDeclaration(mCurMethodDecl, ctorDecl);
HandleBlock(block);
}
}
else
ParseMethod(ctorDecl, &params, &commas);
return ctorDecl;
}