diff --git a/version3.0/nasal_gc.h b/version3.0/nasal_gc.h index f59953f..6999744 100644 --- a/version3.0/nasal_gc.h +++ b/version3.0/nasal_gc.h @@ -89,12 +89,13 @@ public: bool set_type(int); void set_number(double); void set_string(std::string); - double get_number(); - std::string get_string(); - nasal_vector& get_vector(); - nasal_hash& get_hash(); + int get_type(); + double get_number(); + std::string get_string(); + nasal_vector& get_vector(); + nasal_hash& get_hash(); nasal_function& get_func(); - nasal_closure& get_closure(); + nasal_closure& get_closure(); void deepcopy(nasal_scalar&); // parameter: memory_manager_memory address int nasal_scalar_add(int,int); @@ -478,6 +479,10 @@ void nasal_scalar::set_string(std::string str) *(std::string*)(this->scalar_ptr)=str; return; } +int nasal_scalar::get_type() +{ + return this->type; +} double nasal_scalar::get_number() { return *(double*)(this->scalar_ptr); diff --git a/version3.0/nasal_runtime.h b/version3.0/nasal_runtime.h index 09c53f7..0002a2c 100644 --- a/version3.0/nasal_runtime.h +++ b/version3.0/nasal_runtime.h @@ -335,19 +335,56 @@ int nasal_runtime::call_scalar(nasal_ast& node,int local_scope_addr) std::cout<<">> [runtime] call_nasal_scalar:cannot find value named \'"<> [runtime] call_vector:incorrect value type,expected a vector/hash."<> [runtime] call_hash:incorrect value type,expected a hash."<> [runtime] call_function:incorrect value type,expected a function."<> [runtime] call_nasal_mem:cannot find value named \'"<> [runtime] call_vector_mem:incorrect value type,expected a vector/hash."<> [runtime] call_hash_mem:incorrect value type,expected a hash."<> [runtime] call_function_mem:incorrect value type,expected a function."<