Support for diagnostics system.
This commit is contained in:
20
src/Diagnostics/DiagnosticType.hpp
Normal file
20
src/Diagnostics/DiagnosticType.hpp
Normal 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
|
||||
Reference in New Issue
Block a user