#ifndef ENVIRONMENT_HH #define ENVIRONMENT_HH #include "../tokenizer.hh" #include #include #include struct Environment { Environment() : enclosing{nullptr}, values{} {} Environment(std::shared_ptr enclosing) : enclosing{enclosing}, values{} {} Environment(const Environment &other); Environment(Environment &&other) noexcept; Environment &operator=(const Environment &other); Environment &operator=(Environment &&other) noexcept; ~Environment() = default; void define(const std::string &name, const Object &value); void assign(const Token &name, const Object &value); Object get(const Token &name); private: std::shared_ptr enclosing; std::unordered_map values; }; #endif