mirror of
https://github.com/polserver/polserver
synced 2026-08-13 08:23:08 -04:00
35 lines
724 B
C++
35 lines
724 B
C++
#include "Report.h"
|
|
|
|
#include "clib/logfacility.h"
|
|
#include "compiler/file/SourceLocation.h"
|
|
|
|
namespace Pol::Bscript::Compiler
|
|
{
|
|
Report::Report( bool display_warnings )
|
|
: display_warnings( display_warnings ), errors( 0 ), warnings( 0 )
|
|
{
|
|
}
|
|
|
|
void Report::report_error( const SourceLocation& source_location, const char* msg )
|
|
{
|
|
++errors;
|
|
ERROR_PRINT << source_location << ": error: " << msg;
|
|
}
|
|
|
|
void Report::report_warning( const SourceLocation& source_location, const char* msg )
|
|
{
|
|
++warnings;
|
|
ERROR_PRINT << source_location << ": warning: " << msg;
|
|
}
|
|
|
|
unsigned Report::error_count() const
|
|
{
|
|
return errors;
|
|
}
|
|
|
|
unsigned Report::warning_count() const
|
|
{
|
|
return warnings;
|
|
}
|
|
|
|
} // namespace Pol::Bscript::Compiler
|