Add vm
This commit is contained in:
@@ -106,6 +106,7 @@ public:
|
||||
};
|
||||
|
||||
// Forward declarations
|
||||
class Chunk;
|
||||
struct FunctionDecl;
|
||||
class ClassValue;
|
||||
class InstanceValue;
|
||||
@@ -116,15 +117,18 @@ public:
|
||||
std::vector<std::pair<std::string, std::string>> parameters;
|
||||
std::string return_type;
|
||||
std::shared_ptr<FunctionDecl> declaration;
|
||||
std::shared_ptr<Chunk> chunk;
|
||||
NativeFunction native_func;
|
||||
bool is_native;
|
||||
std::shared_ptr<InstanceValue> bound_instance;
|
||||
|
||||
// Script function
|
||||
FunctionValue(std::string name, std::shared_ptr<FunctionDecl> declaration,
|
||||
std::shared_ptr<Chunk> chunk = nullptr,
|
||||
std::shared_ptr<InstanceValue> bound_instance = nullptr)
|
||||
: name(std::move(name)), declaration(std::move(declaration)),
|
||||
is_native(false), bound_instance(std::move(bound_instance)) {}
|
||||
chunk(std::move(chunk)), is_native(false),
|
||||
bound_instance(std::move(bound_instance)) {}
|
||||
|
||||
// Native function
|
||||
FunctionValue(std::string name, NativeFunction func)
|
||||
|
||||
Reference in New Issue
Block a user