prettified enum classes
This commit is contained in:
parent
39fdbdf798
commit
bc409bc989
|
@ -24,8 +24,8 @@ struct Instruction;
|
||||||
struct Keyword;
|
struct Keyword;
|
||||||
struct Runtime;
|
struct Runtime;
|
||||||
|
|
||||||
std::string resolve_TokenType_str(enum class TokenType);
|
std::string resolve_TokenType_str(TokenType);
|
||||||
std::string resolve_ValueType_str(enum class ValueType);
|
std::string resolve_ValueType_str(ValueType);
|
||||||
|
|
||||||
|
|
||||||
#endif //BISCUIT_INTERPRETER_COMMON_HPP
|
#endif //BISCUIT_INTERPRETER_COMMON_HPP
|
||||||
|
|
|
@ -29,9 +29,9 @@ struct WrongArgumentCountExcept : public std::exception
|
||||||
|
|
||||||
struct WrongTokenExcept : public std::exception
|
struct WrongTokenExcept : public std::exception
|
||||||
{
|
{
|
||||||
enum class TokenType expected, got;
|
TokenType expected, got;
|
||||||
std::string keyword_name, token_str;
|
std::string keyword_name, token_str;
|
||||||
inline WrongTokenExcept(const std::string& _keyword_name, const std::string& _token_str, enum class TokenType _expected, enum class TokenType _got)
|
inline WrongTokenExcept(const std::string& _keyword_name, const std::string& _token_str, TokenType _expected, TokenType _got)
|
||||||
: expected(_expected), got(_got), keyword_name(_keyword_name), token_str(_token_str) {}
|
: expected(_expected), got(_got), keyword_name(_keyword_name), token_str(_token_str) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,9 +39,9 @@ struct WrongTokenExcept : public std::exception
|
||||||
// Runtime errors
|
// Runtime errors
|
||||||
struct TypeErrorExcept : public std::exception
|
struct TypeErrorExcept : public std::exception
|
||||||
{
|
{
|
||||||
enum class ValueType expected, got;
|
ValueType expected, got;
|
||||||
std::string token_str;
|
std::string token_str;
|
||||||
inline TypeErrorExcept(const std::string& _token_str, enum class ValueType _expected, enum class ValueType _got)
|
inline TypeErrorExcept(const std::string& _token_str, ValueType _expected, ValueType _got)
|
||||||
: expected(_expected), got(_got), token_str(_token_str) {}
|
: expected(_expected), got(_got), token_str(_token_str) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue