Initial work on parsing.
This commit is contained in:
@@ -3,7 +3,12 @@
|
||||
#include <string>
|
||||
|
||||
namespace MalachScript::Diagnostics {
|
||||
enum class DiagnosticType : uint8_t { UnknownToken, InvalidNumericalBase, ExpectedEndOfString };
|
||||
enum class DiagnosticType : uint8_t {
|
||||
UnknownToken,
|
||||
InvalidNumericalBase,
|
||||
ExpectedEndOfString,
|
||||
UnexpectedToken,
|
||||
};
|
||||
|
||||
class DiagnosticTypeHelper {
|
||||
static std::string ToEnglishString(DiagnosticType type) {
|
||||
@@ -11,6 +16,7 @@ namespace MalachScript::Diagnostics {
|
||||
case DiagnosticType::UnknownToken: return "Unknown token";
|
||||
case DiagnosticType::InvalidNumericalBase: return "Invalid numerical base";
|
||||
case DiagnosticType::ExpectedEndOfString: return "Expected end of string";
|
||||
case DiagnosticType::UnexpectedToken: return "Unexpected Token";
|
||||
}
|
||||
return std::to_string((uint8_t)type);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user