Add new info functions

This commit is contained in:
Leo Alt 2021-10-06 11:42:05 +02:00
parent 719b70893f
commit fa48abf4f1
3 changed files with 21 additions and 0 deletions

View File

@ -261,3 +261,8 @@ void ErrorReporter::info(
{ {
error(_error, Error::Type::Info, _location, _description); error(_error, Error::Type::Info, _location, _description);
} }
void ErrorReporter::info(ErrorId _error, string const& _description)
{
error(_error, Error::Type::Info, SourceLocation(), _description);
}

View File

@ -72,6 +72,8 @@ public:
std::string const& _description std::string const& _description
); );
void info(ErrorId _error, std::string const& _description);
void declarationError( void declarationError(
ErrorId _error, ErrorId _error,
SourceLocation const& _location, SourceLocation const& _location,

View File

@ -61,6 +61,20 @@ public:
m_errorReporter.warning(_error, _description); m_errorReporter.warning(_error, _description);
} }
void info(ErrorId _error, SourceLocation const& _location, std::string const& _description)
{
if (!seen(_error, _location, _description))
{
m_errorReporter.info(_error, _location, _description);
markAsSeen(_error, _location, _description);
}
}
void info(ErrorId _error, std::string const& _description)
{
m_errorReporter.info(_error, _description);
}
bool seen(ErrorId _error, SourceLocation const& _location, std::string const& _description) const bool seen(ErrorId _error, SourceLocation const& _location, std::string const& _description) const
{ {
if (m_seenErrors.count({_error, _location})) if (m_seenErrors.count({_error, _location}))