diff --git a/version3.0/nasal_runtime.h b/version3.0/nasal_runtime.h index 4f66dcd..5f42693 100644 --- a/version3.0/nasal_runtime.h +++ b/version3.0/nasal_runtime.h @@ -375,9 +375,9 @@ int nasal_runtime::call_vector(nasal_ast& node,int base_value_addr,int local_sco { int return_value_addr=-1; int base_value_type=nasal_vm.gc_get(base_value_addr).get_type(); - if(base_value_type!=vm_vector && base_value_type!=vm_hash) + if(base_value_type!=vm_vector && base_value_type!=vm_hash && base_value_type!=vm_string) { - std::cout<<">> [runtime] call_vector: incorrect value type,expected a vector/hash."<> [runtime] call_vector: incorrect value type,expected a vector/hash/string."<1) { @@ -552,6 +552,12 @@ int nasal_runtime::call_vector(nasal_ast& node,int base_value_addr,int local_sco ++error; return -1; } + if(node.get_children()[0].get_type()==ast_subvec) + { + std::cout<<">> [runtime] call_vector: cannot slice hash."<1) + { + std::cout<<">> [runtime] call_vector: when calling a string,only one index is alowed."<> [runtime] call_vector: cannot slice string."<> [runtime] call_vector: index is not a number/numerable string."<> [runtime] call_vector: index is not a numerable string."<=str_size || index_num<-str_size) + { + std::cout<<">> [runtime] call_vector: index out of range."<