pattern: Cleanup log console a bit
This commit is contained in:
parent
b4a3eb240e
commit
57f31123e7
@ -16,7 +16,8 @@ namespace hex::pl {
|
||||
|
||||
class LogConsole {
|
||||
public:
|
||||
enum Level {
|
||||
enum Level
|
||||
{
|
||||
Debug,
|
||||
Info,
|
||||
Warning,
|
||||
@ -27,9 +28,7 @@ namespace hex::pl {
|
||||
|
||||
void log(Level level, const std::string &message);
|
||||
|
||||
[[noreturn]] static void abortEvaluation(const std::string &message);
|
||||
|
||||
[[noreturn]] static void abortEvaluation(const std::string &message, const ASTNode *node);
|
||||
[[noreturn]] static void abortEvaluation(const std::string &message, const ASTNode *node = nullptr);
|
||||
|
||||
void clear();
|
||||
|
||||
|
@ -8,15 +8,11 @@ namespace hex::pl {
|
||||
this->m_consoleLog.emplace_back(level, message);
|
||||
}
|
||||
|
||||
[[noreturn]] void LogConsole::abortEvaluation(const std::string &message) {
|
||||
throw PatternLanguageError(0, message);
|
||||
}
|
||||
|
||||
[[noreturn]] void LogConsole::abortEvaluation(const std::string &message, const ASTNode *node) {
|
||||
if (node == nullptr)
|
||||
abortEvaluation(message);
|
||||
throw PatternLanguageError(0, "Evaluator: " + message);
|
||||
else
|
||||
throw PatternLanguageError(node->getLineNumber(), message);
|
||||
throw PatternLanguageError(node->getLineNumber(), "Evaluator: " + message);
|
||||
}
|
||||
|
||||
void LogConsole::clear() {
|
||||
|
Loading…
Reference in New Issue
Block a user