Merge pull request #5537 from ethereum/cp-SourceLocation-related-refactoring

[1/3] SourceLocation related refactoring.
This commit is contained in:
chriseth
2018-11-30 23:45:31 +01:00
committed by GitHub
28 changed files with 215 additions and 208 deletions
+2 -2
View File
@@ -122,8 +122,8 @@ void ASTJsonConverter::setJsonNode(
string ASTJsonConverter::sourceLocationToString(SourceLocation const& _location) const
{
int sourceIndex{-1};
if (_location.sourceName && m_sourceIndices.count(*_location.sourceName))
sourceIndex = m_sourceIndices.at(*_location.sourceName);
if (_location.source && m_sourceIndices.count(_location.source->name()))
sourceIndex = m_sourceIndices.at(_location.source->name());
int length = -1;
if (_location.start >= 0 && _location.end >= 0)
length = _location.end - _location.start;