Adds localized error messages

This commit is contained in:
Deukhoofd 2019-08-18 15:29:52 +02:00
parent 184ef8ec9a
commit b4897c77ec
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 24 additions and 0 deletions

View File

@ -6,5 +6,29 @@ namespace Porygon::Diagnostics {
const std::unordered_map<DiagnosticCode, const char*> ErrorMessages{ // NOLINT(cert-err58-cpp)
{DiagnosticCode ::UnexpectedCharacter, "Encountered an unexpected character: '{0}'."},
{DiagnosticCode ::InvalidStringControlCharacter, "'{0}' is not a valid control character."},
{DiagnosticCode ::UnexpectedToken, "Encountered unexpected token kind."},
{DiagnosticCode ::NoBinaryOperationFound, "No binary operation found for these operands and operator."},
{DiagnosticCode ::NoUnaryOperationFound, "No unary operation found for this operand and operator."},
{DiagnosticCode ::CantAssignVariable, "Something went wrong while assigning variable."},
{DiagnosticCode ::VariableNotFound, "Variable not found."},
{DiagnosticCode ::ExpressionIsNotAFunction, "Called expression is not a function."},
{DiagnosticCode ::CantIndex, "Unable to index value."},
{DiagnosticCode ::InvalidReturnType, "Invalid return type."},
{DiagnosticCode ::ConditionNotABool, "A condition should return a bool."},
{DiagnosticCode ::InvalidTableValueType, "This is an invalid table value type."},
{DiagnosticCode ::InvalidTypeName, "This type name is not valid."},
{DiagnosticCode ::UserDataFieldNoGetter, "This userdata field does not have a getter."},
{DiagnosticCode ::UserDataFieldNoSetter, "This userdata field does not have a setter."},
{DiagnosticCode ::NumericalForArgumentNotANumber, "A numerical for argument should be a number."},
{DiagnosticCode ::CantIterateExpression, "Can't iterate over given expression."},
{DiagnosticCode ::InvalidFunctionParameters, "No function option found for given parameters."},
{DiagnosticCode ::ModuleDoesntExist, "The requested module was not found."},
{DiagnosticCode ::InvalidCast, "No cast found between these two types."},
{DiagnosticCode ::DataLossOnCast, "After this cast data will be lost!"},
{DiagnosticCode ::UnvalidatedCast, "The cast between these two types could not be validated."},
};
}