1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Support for expression-bodied indexers

This commit is contained in:
Brian Fiete 2020-10-12 17:48:59 -07:00
parent 29beeb4e77
commit ddad5bd492

View file

@ -6724,9 +6724,6 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
mVisitorPos.MoveNext();
blockAfterIdx = mVisitorPos.mReadPos + 1;
auto block = ExpectBlockAfter(blockAfterPos);
if (block == NULL)
return indexerDeclaration;
}
else
{
@ -6742,9 +6739,7 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
// If we don't have a token afterwards then still treat it as a property for autocomplete purposes
if ((typeRef != NULL) &&
((block != NULL) || (tokenNode == NULL) || (isExprBodyProp)))
{
//mVisitorPos.mReadPos = blockAfterIdx;
{
if (propertyDeclaration == NULL)
{
if ((block == NULL) && (!isExprBodyProp))
@ -6820,6 +6815,13 @@ BfAstNode* BfReducer::ReadTypeMember(BfAstNode* node, int depth, BfAstNode* defe
return propertyDeclaration;
}
else if (propertyDeclaration != NULL)
{
// Failure case
block = ExpectBlockAfter(blockAfterPos);
BF_ASSERT(block == NULL);
return propertyDeclaration;
}
//nextNode = mVisitorPos.Get(mVisitorPos.mReadPos + 2);
/*if (tokenNode == NULL)