Expanded on diagnostics, make whitespace completely ignored
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user