MCPcopy Create free account
hub / github.com/beefytech/Beef / DoInvocation

Method DoInvocation

IDEHelper/DbgExprEvaluator.cpp:8120–8313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8118}
8119
8120void DbgExprEvaluator::DoInvocation(BfAstNode* target, BfSizedArray<ASTREF(BfExpression*)>& args, BfSizedArray<ASTREF(BfAstNode*)>* methodGenericArguments, bool& failed)
8121{
8122 bool allowImplicitThis = false;
8123 BfAstNode* methodNodeSrc = target;
8124
8125 bool bypassVirtual = false;
8126 String targetFunctionName;
8127 DbgTypedValue thisValue;
8128 //TODO: This may just be a fully qualified static method name, so let's check that also
8129 if (auto memberRefExpression = BfNodeDynCast<BfMemberReferenceExpression>(target))
8130 {
8131 //GetAutoComplete()->CheckMemberReference(memberRefExpression->mTarget, memberRefExpression->mDotToken, memberRefExpression->mMemberName);
8132
8133 if (memberRefExpression->mMemberName == NULL)
8134 return;
8135
8136 if (memberRefExpression->IsA<BfBaseExpression>())
8137 bypassVirtual = true;
8138
8139 methodNodeSrc = memberRefExpression->mMemberName;
8140
8141 if (auto attrIdentifier = BfNodeDynCast<BfAttributedIdentifierNode>(memberRefExpression->mMemberName))
8142 {
8143 methodNodeSrc = attrIdentifier->mIdentifier;
8144 if (attrIdentifier->mIdentifier != NULL)
8145 targetFunctionName = attrIdentifier->mIdentifier->ToString();
8146 }
8147 else
8148 targetFunctionName = memberRefExpression->mMemberName->ToString();
8149
8150 if (memberRefExpression->mTarget == NULL)
8151 {
8152 // Dot-qualified
8153 if ((mExpectingType != NULL) && (mExpectingType->IsStruct()))
8154 {
8155 mResult = DbgTypedValue();
8156 mResult.mType = mExpectingType;
8157 }
8158 else
8159 Fail("Unqualified dot syntax can only be used when the result type can be inferred", memberRefExpression->mDotToken);
8160 }
8161 else if (auto typeRef = BfNodeDynCast<BfTypeReference>(memberRefExpression->mTarget))
8162 {
8163 // Static method
8164 mResult = DbgTypedValue();
8165 mResult.mType = ResolveTypeRef(typeRef);
8166 }
8167 else
8168 VisitChild(memberRefExpression->mTarget);
8169 GetResult();
8170 if (mResult.mType == NULL)
8171 return;
8172 thisValue = mResult;
8173 mResult = DbgTypedValue();
8174 }
8175 else if (auto qualifiedName = BfNodeDynCast<BfQualifiedNameNode>(target))
8176 {
8177 /*if (GetAutoComplete() != NULL)

Callers

nothing calls this directly

Calls 9

DbgTypedValueClass · 0.85
FailFunction · 0.85
VisitFunction · 0.85
ToStringMethod · 0.45
IsStructMethod · 0.45
c_strMethod · 0.45
IsPointerMethod · 0.45
IsPrimitiveTypeMethod · 0.45
IsEnumMethod · 0.45

Tested by

no test coverage detected