A simple scripting language in C++
Ferenc Szontágh
2025-04-18 3bb117e4fee72c4d4019c575bf0cb21043584954
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// ReturnException.hpp
#ifndef INTERPRETER_RETURN_EXCEPTION_HPP
#define INTERPRETER_RETURN_EXCEPTION_HPP
 
#include "Symbols/Value.hpp"
 
namespace Interpreter {
/**
 * @brief Exception used to unwind the call stack when a return statement is executed.
 */
class ReturnException {
  public:
    explicit ReturnException(const Symbols::Value &value) : value_(value) {}
    const Symbols::Value &value() const { return value_; }
  private:
    Symbols::Value value_;
};
} // namespace Interpreter
#endif // INTERPRETER_RETURN_EXCEPTION_HPP