Move Diagnostics to separate namespace

This commit is contained in:
2019-06-18 16:39:36 +02:00
parent 88df299e14
commit e07d5cb7cb
11 changed files with 127 additions and 118 deletions

View File

@@ -9,31 +9,35 @@
using namespace std;
class DiagnosticsHolder {
bool _hasErrors;
vector<Diagnostic> _diagnostics;
public:
DiagnosticsHolder(){
_hasErrors = false;
}
namespace Porygon::Diagnostics {
class DiagnosticsHolder {
bool _hasErrors;
vector<Diagnostic> _diagnostics;
public:
DiagnosticsHolder() {
_hasErrors = false;
}
~DiagnosticsHolder(){
_diagnostics.clear();
}
~DiagnosticsHolder() {
_diagnostics.clear();
}
void Log(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length);
void LogError(DiagnosticCode code, unsigned int start, unsigned int length);
void LogWarning(DiagnosticCode code, unsigned int start, unsigned int length);
void LogInfo(DiagnosticCode code, unsigned int start, unsigned int length);
void Log(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length);
bool HasErrors();
void LogError(DiagnosticCode code, unsigned int start, unsigned int length);
vector<Diagnostic> GetDiagnostics();
void LogWarning(DiagnosticCode code, unsigned int start, unsigned int length);
int DiagnosticsCount();
void LogInfo(DiagnosticCode code, unsigned int start, unsigned int length);
Diagnostic* GetDiagnosticAt(int position);
};
bool HasErrors();
vector<Diagnostic> GetDiagnostics();
int DiagnosticsCount();
Diagnostic *GetDiagnosticAt(int position);
};
}
#endif //PORYGONLANG_DIAGNOSTICSHOLDER_HPP