data: Added intermediate fix to handle multiple definitions of main() in C/C++ (issue #233)
* record main definition as .:main:.<filename> * restore original name in name deserialization * don't look up id when undoing main activation
This commit is contained in:
@@ -493,7 +493,13 @@ void UndoRedoController::replayCommand(std::list<Command>::iterator it)
|
||||
|
||||
for (SearchMatch match : matches)
|
||||
{
|
||||
match.tokenIds = m_storageAccess->getNodeIdsForNameHierarchies(match.tokenNames);
|
||||
// TODO: replace duplicate main definition fix with better solution
|
||||
if (match.nodeType.getType() != NodeType::NODE_FUNCTION || !match.tokenNames.size() ||
|
||||
match.tokenNames[0].getRawName() != L"main")
|
||||
{
|
||||
match.tokenIds = m_storageAccess->getNodeIdsForNameHierarchies(match.tokenNames);
|
||||
}
|
||||
|
||||
if (!match.tokenIds.size())
|
||||
{
|
||||
match.nodeType = NodeType::NODE_SYMBOL;
|
||||
|
||||
Reference in New Issue
Block a user