mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Support for autoprop initializers
This commit is contained in:
parent
40b0d78d16
commit
041a17cf89
3 changed files with 32 additions and 8 deletions
|
@ -6971,6 +6971,20 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, bool declStarted, int dept
|
|||
MEMBER_SET(propertyDeclaration, mDefinitionBlock, block);
|
||||
ReadPropertyBlock(propertyDeclaration, block);
|
||||
|
||||
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext()))
|
||||
{
|
||||
if (tokenNode->mToken == BfToken_AssignEquals)
|
||||
{
|
||||
MEMBER_SET(propertyDeclaration, mEqualsNode, tokenNode);
|
||||
mVisitorPos.MoveNext();
|
||||
auto initExpr = CreateExpressionAfter(propertyDeclaration);
|
||||
if (initExpr != NULL)
|
||||
{
|
||||
MEMBER_SET(propertyDeclaration, mInitializer, initExpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(mVisitorPos.GetNext()))
|
||||
{
|
||||
if (tokenNode->mToken == BfToken_Tilde)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue