data: cleaned up TokenLocation classes
* removed self assiged locationId * show errors after parse again
This commit is contained in:
@@ -49,28 +49,6 @@ size_t TokenLocationCollection::getTokenLocationCount() const
|
||||
return m_locations.size();
|
||||
}
|
||||
|
||||
TokenLocation* TokenLocationCollection::addTokenLocation(
|
||||
Id tokenId, const FilePath& filePath,
|
||||
unsigned int startLineNumber, unsigned int startColumnNumber,
|
||||
unsigned int endLineNumber, unsigned int endColumnNumber)
|
||||
{
|
||||
if (startLineNumber > endLineNumber || (startLineNumber == endLineNumber && startColumnNumber > endColumnNumber))
|
||||
{
|
||||
LOG_ERROR("Can't create TokenLocation with wrong boundaries.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TokenLocationFile* file = createTokenLocationFile(filePath);
|
||||
TokenLocation* location =
|
||||
file->addTokenLocation(tokenId, startLineNumber, startColumnNumber, endLineNumber, endColumnNumber);
|
||||
|
||||
m_locations.emplace(location->getId(), location);
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
TokenLocation* TokenLocationCollection::addTokenLocation(
|
||||
Id locationId, Id tokenId, const FilePath& filePath,
|
||||
unsigned int startLineNumber, unsigned int startColumnNumber,
|
||||
@@ -90,8 +68,6 @@ TokenLocation* TokenLocationCollection::addTokenLocation(
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TokenLocationCollection::removeTokenLocation(TokenLocation* location)
|
||||
{
|
||||
if (!findTokenLocationById(location->getId()))
|
||||
|
||||
Reference in New Issue
Block a user