data: Parsing functions with ParseFunction for signature comparing
This change switches function and method parsing to use the structure ParseFunction, which holds all important values of the function. This structure is then used also in call and usage parsing to allow distinction between signatures.
This commit is contained in:
@@ -90,7 +90,7 @@ Node* Graph::createNodeHierarchy(Node::NodeType type, const std::string& fullNam
|
||||
|
||||
Node* Graph::createNodeHierarchyWithDistinctSignature(const std::string& fullName, const std::string& signature)
|
||||
{
|
||||
return createNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED, fullName, signature);
|
||||
return createNodeHierarchyWithDistinctSignature(Node::NODE_UNDEFINED_FUNCTION, fullName, signature);
|
||||
}
|
||||
|
||||
Node* Graph::createNodeHierarchyWithDistinctSignature(
|
||||
@@ -103,7 +103,7 @@ Node* Graph::createNodeHierarchyWithDistinctSignature(
|
||||
TokenComponentSignature* sigComponent = node->getComponent<TokenComponentSignature>();
|
||||
if (sigComponent && sigComponent->getSignature() == signature)
|
||||
{
|
||||
if (type != Node::NODE_UNDEFINED)
|
||||
if (type != Node::NODE_UNDEFINED && type != Node::NODE_UNDEFINED_FUNCTION)
|
||||
{
|
||||
node->setType(type);
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ Node::NodeType Node::getType() const
|
||||
|
||||
void Node::setType(NodeType type)
|
||||
{
|
||||
if (type != m_type && m_type != NODE_UNDEFINED)
|
||||
if (type != m_type && m_type != NODE_UNDEFINED && m_type != NODE_UNDEFINED_FUNCTION)
|
||||
{
|
||||
LOG_WARNING(
|
||||
"Changing NodeType after it was already set, from " + getTypeString(m_type) + " to " + getTypeString(type)
|
||||
"Cannot change NodeType after it was already set from " + getTypeString(m_type) + " to " + getTypeString(type)
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ void Node::addComponentSignature(std::shared_ptr<TokenComponentSignature> compon
|
||||
{
|
||||
LOG_ERROR("TokenComponentSignature has been set before!");
|
||||
}
|
||||
else if (m_type != NODE_FUNCTION && m_type != NODE_METHOD)
|
||||
else if (m_type != NODE_UNDEFINED_FUNCTION && m_type != NODE_FUNCTION && m_type != NODE_METHOD)
|
||||
{
|
||||
LOG_ERROR("TokenComponentSignature can't be set on node of type: " + getTypeString(m_type));
|
||||
}
|
||||
@@ -245,6 +245,8 @@ std::string Node::getTypeString(NodeType type) const
|
||||
{
|
||||
case NODE_UNDEFINED:
|
||||
return "undefined";
|
||||
case NODE_UNDEFINED_FUNCTION:
|
||||
return "undefined function";
|
||||
case NODE_CLASS:
|
||||
return "class";
|
||||
case NODE_STRUCT:
|
||||
|
||||
@@ -19,6 +19,7 @@ public:
|
||||
enum NodeType
|
||||
{
|
||||
NODE_UNDEFINED,
|
||||
NODE_UNDEFINED_FUNCTION,
|
||||
NODE_CLASS,
|
||||
NODE_STRUCT,
|
||||
NODE_GLOBAL_VARIABLE,
|
||||
|
||||
Reference in New Issue
Block a user