Expanded on diagnostics, make whitespace completely ignored

This commit is contained in:
2019-05-21 15:11:00 +02:00
parent 8f2f122215
commit ae25598864
7 changed files with 67 additions and 20 deletions

View File

@@ -17,6 +17,21 @@ public:
_start = start;
_length = length;
}
DiagnosticSeverity GetSeverity(){
return _severity;
}
DiagnosticCode GetCode(){
return _code;
}
unsigned int GetStartPosition(){
return _start;
}
unsigned int GetLength(){
return _length;
}
};
#endif //PORYGONLANG_DIAGNOSTIC_HPP

View File

@@ -17,6 +17,10 @@ public:
_hasErrors = false;
}
~Diagnostics(){
_diagnostics.clear();
}
void Log(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length){
_diagnostics.emplace_back(severity, code, start, length);
if (severity >= DiagnosticSeverity::Error){
@@ -38,6 +42,10 @@ public:
bool HasErrors(){
return _hasErrors;
}
vector<Diagnostic> GetDiagnostics(){
return _diagnostics;
}
};