This commit is contained in:
2026-02-04 19:37:03 +08:00
parent 5aa4efede7
commit 36d273e09f
11 changed files with 335 additions and 93 deletions

View File

@@ -34,6 +34,9 @@ public:
// Register native functions
void register_native_function(const std::string& name, NativeFunction func);
// Register built-in classes for types (like list, map)
void register_builtin_class(const std::string& type_name, std::shared_ptr<ClassValue> klass);
// Global variable access
void set_global(const std::string& name, ValuePtr value);
ValuePtr get_global(const std::string& name);
@@ -48,6 +51,7 @@ private:
std::vector<CallFrame> frames;
CallFrame* current_frame;
std::map<std::string, ValuePtr> globals;
std::map<std::string, std::shared_ptr<ClassValue>> builtin_classes;
std::string error_message;
// Main execution loop