Support for diagnostics system.

This commit is contained in:
2020-10-04 19:38:13 +02:00
parent 20976010d6
commit b6a5e047c2
13 changed files with 347 additions and 217 deletions

View File

@@ -0,0 +1,20 @@
#ifndef ELOHIMSCRIPT_DIAGNOSTICTYPE_HPP
#define ELOHIMSCRIPT_DIAGNOSTICTYPE_HPP
#include <string>
namespace ElohimScript::Diagnostics {
enum class DiagnosticType : uint8_t { UnknownToken, InvalidNumericalBase, ExpectedEndOfString };
class DiagnosticTypeHelper {
static std::string ToEnglishString(DiagnosticType type) {
switch (type) {
case DiagnosticType::UnknownToken: return "Unknown token";
case DiagnosticType::InvalidNumericalBase: return "Invalid numerical base";
case DiagnosticType::ExpectedEndOfString: return "Expected end of string";
}
return std::to_string((uint8_t)type);
}
};
}
#endif // ELOHIMSCRIPT_DIAGNOSTICTYPE_HPP