diff options
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/SourceReferenceFormatter.cpp | 9 | ||||
-rw-r--r-- | libsolidity/interface/SourceReferenceFormatter.h | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.cpp b/libsolidity/interface/SourceReferenceFormatter.cpp index 169e5c18..65d7fbc8 100644 --- a/libsolidity/interface/SourceReferenceFormatter.cpp +++ b/libsolidity/interface/SourceReferenceFormatter.cpp @@ -21,7 +21,6 @@ */ #include <libsolidity/interface/SourceReferenceFormatter.h> -#include <libsolidity/interface/CompilerStack.h> #include <libsolidity/parsing/Scanner.h> #include <libsolidity/interface/Exceptions.h> @@ -85,7 +84,7 @@ void SourceReferenceFormatter::printExceptionInformation( ostream& _stream, Exception const& _exception, string const& _name, - CompilerStack const& _compiler + function<Scanner const&(string const&)> const& _scannerFromSourceName ) { SourceLocation const* location = boost::get_error_info<errinfo_sourceLocation>(_exception); @@ -94,7 +93,7 @@ void SourceReferenceFormatter::printExceptionInformation( if (location) { - scannerPtr = &_compiler.scanner(*location->sourceName); + scannerPtr = &_scannerFromSourceName(*location->sourceName); printSourceName(_stream, *location, *scannerPtr); } @@ -104,7 +103,7 @@ void SourceReferenceFormatter::printExceptionInformation( if (location) { - scannerPtr = &_compiler.scanner(*location->sourceName); + scannerPtr = &_scannerFromSourceName(*location->sourceName); printSourceLocation(_stream, *location, *scannerPtr); } @@ -112,7 +111,7 @@ void SourceReferenceFormatter::printExceptionInformation( { for (auto info: secondarylocation->infos) { - scannerPtr = &_compiler.scanner(*info.second.sourceName); + scannerPtr = &_scannerFromSourceName(*info.second.sourceName); _stream << info.first << " "; printSourceName(_stream, info.second, *scannerPtr); _stream << endl; diff --git a/libsolidity/interface/SourceReferenceFormatter.h b/libsolidity/interface/SourceReferenceFormatter.h index dd258c27..1fc42753 100644 --- a/libsolidity/interface/SourceReferenceFormatter.h +++ b/libsolidity/interface/SourceReferenceFormatter.h @@ -23,6 +23,7 @@ #pragma once #include <ostream> +#include <functional> #include <libevmasm/SourceLocation.h> namespace dev @@ -44,7 +45,7 @@ public: std::ostream& _stream, Exception const& _exception, std::string const& _name, - CompilerStack const& _compiler + std::function<Scanner const&(std::string const&)> const& _scannerFromSourceName ); private: static void printSourceName(std::ostream& _stream, SourceLocation const& _location, Scanner const& _scanner); |