#pragma once #include #include #include #include #include struct Object { virtual ~Object(){}; }; struct Number : Object { double value; explicit Number(double value) : value(value) {} }; struct String : Object { std::string value; explicit String(std::string str) : value(str) {} ~String(){ } }; struct Boolean : Object { bool value; explicit Boolean(bool value) : value(value) {} }; struct None : public Object { }; struct Function : public Object { const std::string name; const std::vector params; const std::vector> body; // Will cast to Stmt* when needed const std::shared_ptr closure; // Will cast to Environment* when needed Function(std::string name, std::vector params, std::vector> body, std::shared_ptr closure) : name(name), params(params), body(body), closure(closure) {} }; struct BuiltinFunction : public Object { const std::string name; const std::function(std::vector >)> func; BuiltinFunction(std::string name, std::function(std::vector >)> func) : name(name), func(func) {} };