A simple scripting language in C++
Ferenc Szontágh
2025-04-18 9a186053a690f2216b43355549c8aa7e2959583c
src/Interpreter/Interpreter.hpp
@@ -7,6 +7,23 @@
#include "Interpreter/Operation.hpp"
#include "Interpreter/OperationContainer.hpp"
#include "Symbols/SymbolContainer.hpp"
#include "BaseException.hpp"
// Exception type for runtime errors, includes file, line, and column context
namespace Interpreter {
class Exception : public BaseException {
public:
    Exception(const std::string &msg, const std::string &filename, int line, size_t column) {
        rawMessage_ = msg;
        context_ = std::string(" in file \"") + filename + "\" at line: " + std::to_string(line)
                   + ", column: " + std::to_string(column);
        formattedMessage_ = formatMessage();
    }
    std::string formatMessage() const override {
        return std::string("[Runtime ERROR] >>") + context_ + " << : " + rawMessage_;
    }
};
} // namespace Interpreter
namespace Interpreter {