General cleanup
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-07-04 18:24:49 +02:00
parent 0446c1098b
commit bb0a6aba19
20 changed files with 90 additions and 92 deletions

View File

@@ -18,13 +18,10 @@ namespace Porygon::Diagnostics {
std::vector<std::string> _arguments;
std::string* _message;
public:
Diagnostic(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length, std::vector<std::string> arguments) {
_severity = severity;
_code = code;
_start = start;
_length = length;
_arguments = std::move(arguments);
_message = nullptr;
Diagnostic(DiagnosticSeverity severity, DiagnosticCode code, unsigned int start, unsigned int length, std::vector<std::string> arguments)
: _severity(severity), _code(code), _start(start), _length(length), _arguments(std::move(arguments)), _message(
nullptr)
{
}
~Diagnostic(){

View File

@@ -19,9 +19,7 @@ namespace Porygon::Diagnostics {
vector<size_t> _lineLength;
public:
explicit DiagnosticsHolder(const u16string& str) {
_hasErrors = false;
_lineStarts = vector<size_t>{0};
explicit DiagnosticsHolder(const u16string& str) :_hasErrors(false), _lineStarts(vector<size_t>{0}) {
size_t lineLength = 0;
for (size_t i = 0; i < str.size(); i++){
lineLength++;