Added support for full error messages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -289,7 +289,8 @@ namespace Porygon::Parser {
|
||||
}
|
||||
auto closeToken = this->Next();
|
||||
if (closeToken != c) {
|
||||
this->ScriptData->Diagnostics->LogError(Diagnostics::DiagnosticCode::UnexpectedCharacter, this->_position - 1, 1);
|
||||
const char* s = string(1, closeToken).c_str();
|
||||
this->ScriptData->Diagnostics->LogError(Diagnostics::DiagnosticCode::UnexpectedCharacter, this->_position - 1, 1, { s });
|
||||
return new SimpleToken(TokenKind::BadToken, start, end - start + 1);
|
||||
}
|
||||
|
||||
@@ -303,8 +304,9 @@ namespace Porygon::Parser {
|
||||
if (ControlCharacters.find(c) != ControlCharacters.end()) {
|
||||
stream << ControlCharacters.at(c);
|
||||
} else {
|
||||
auto v = string(1, c).c_str();
|
||||
this->ScriptData->Diagnostics->LogError(Diagnostics::DiagnosticCode::InvalidStringControlCharacter,
|
||||
start + 1 + i, 1);
|
||||
start + 1 + i, 1, {v});
|
||||
stream << c;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user