Eliminate some unnecessary header inclusions in headers in Scanner.h and SourceReferenceFormatter.h

This commit is contained in:
Christian Parpart 2021-08-03 15:20:00 +02:00
parent ac0c749a32
commit af18b8afc2
6 changed files with 17 additions and 10 deletions

View File

@ -55,8 +55,6 @@
#include <liblangutil/Token.h>
#include <liblangutil/CharStream.h>
#include <liblangutil/SourceLocation.h>
#include <libsolutil/Common.h>
#include <libsolutil/CommonData.h>
#include <optional>
#include <iosfwd>

View File

@ -21,6 +21,8 @@
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/Exceptions.h>
#include <liblangutil/CharStream.h>
#include <liblangutil/CharStreamProvider.h>
#include <libsolutil/UTF8.h>
#include <iomanip>
#include <string_view>
@ -45,6 +47,14 @@ std::string replaceNonTabs(std::string_view _utf8Input, char _filler)
}
std::string SourceReferenceFormatter::formatErrorInformation(Error const& _error, CharStream const& _charStream)
{
return formatErrorInformation(
_error,
SingletonCharStreamProvider(_charStream)
);
}
AnsiColorized SourceReferenceFormatter::normalColored() const
{
return AnsiColorized(m_stream, m_colored, {WHITE});

View File

@ -23,7 +23,6 @@
#include <liblangutil/Exceptions.h>
#include <liblangutil/SourceReferenceExtractor.h>
#include <liblangutil/CharStreamProvider.h>
#include <libsolutil/AnsiColorized.h>
@ -33,6 +32,9 @@
namespace solidity::langutil
{
class CharStream;
class CharStreamProvider;
struct SourceLocation;
class SourceReferenceFormatter
@ -80,13 +82,7 @@ public:
);
}
static std::string formatErrorInformation(Error const& _error, CharStream const& _charStream)
{
return formatErrorInformation(
_error,
SingletonCharStreamProvider(_charStream)
);
}
static std::string formatErrorInformation(Error const& _error, CharStream const& _charStream);
private:
util::AnsiColorized normalColored() const;

View File

@ -31,6 +31,7 @@
#include <liblangutil/Scanner.h>
#include <liblangutil/ParserBase.h>
#include <map>
#include <memory>
#include <variant>
#include <vector>

View File

@ -27,6 +27,7 @@
#include <libyul/optimiser/ReasoningBasedSimplifier.h>
#include <libyul/AsmPrinter.h>
#include <liblangutil/CharStreamProvider.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/Scanner.h>

View File

@ -27,6 +27,7 @@
#include <tools/yulPhaser/SimulationRNG.h>
#include <liblangutil/CharStream.h>
#include <liblangutil/CharStreamProvider.h>
#include <liblangutil/SourceReferenceFormatter.h>
#include <liblangutil/Scanner.h>