This commit is contained in:
@@ -10,8 +10,8 @@ vector<Diagnostic> DiagnosticsHolder::GetDiagnostics() {
|
||||
void DiagnosticsHolder::Log(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length,
|
||||
const std::vector<string>& arguments) {
|
||||
_diagnostics.emplace_back(severity, code, start, length, arguments);
|
||||
if (severity >= DiagnosticSeverity::Error){
|
||||
_hasErrors = true;
|
||||
if (severity == DiagnosticSeverity::Error){
|
||||
_hasErrors = static_cast<byte>(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void DiagnosticsHolder::LogInfo(DiagnosticCode code, unsigned int start, unsigne
|
||||
}
|
||||
|
||||
bool DiagnosticsHolder::HasErrors() {
|
||||
return _hasErrors;
|
||||
return _hasErrors == static_cast<byte>(1);
|
||||
}
|
||||
|
||||
int DiagnosticsHolder::DiagnosticsCount() {
|
||||
|
||||
@@ -13,13 +13,13 @@ using namespace std;
|
||||
|
||||
namespace Porygon::Diagnostics {
|
||||
class DiagnosticsHolder {
|
||||
bool _hasErrors;
|
||||
byte _hasErrors;
|
||||
vector<Diagnostic> _diagnostics;
|
||||
vector<size_t> _lineStarts;
|
||||
vector<size_t> _lineLength;
|
||||
|
||||
public:
|
||||
explicit DiagnosticsHolder(const u16string& str) :_hasErrors(false), _lineStarts(vector<size_t>{0}) {
|
||||
explicit DiagnosticsHolder(const u16string& str) : _hasErrors(static_cast<byte>(0)), _lineStarts(vector<size_t>{0}) {
|
||||
size_t lineLength = 0;
|
||||
for (size_t i = 0; i < str.size(); i++){
|
||||
lineLength++;
|
||||
|
||||
Reference in New Issue
Block a user