change parameter name in native function split.

This commit is contained in:
ValKmjolnir
2022-02-17 23:34:58 +08:00
parent a4738e8c7d
commit 05fc5db337
3 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -34,11 +34,11 @@ var input=func(){
return __builtin_input();
}
# split a string by delimiter for example:
# split a string by separator for example:
# split("ll","hello world") -> ["he","o world"]
# this function will return a vector.
var split=func(deli,str){
return __builtin_split(deli,str);
var split=func(separator,str){
return __builtin_split(separator,str);
}
# rand has the same function as the rand in C
+2 -2
View File
@@ -267,9 +267,9 @@ nasal_ref builtin_split(nasal_ref* local,nasal_gc& gc)
nasal_ref deli_val=local[1];
nasal_ref str_val=local[2];
if(deli_val.type!=vm_str)
return builtin_err("split","\"delimeter\" must be string");
return builtin_err("split","\"separator\" must be string");
if(str_val.type!=vm_str)
return builtin_err("split","\"string\" must be string");
return builtin_err("split","\"str\" must be string");
std::string& delimeter=*deli_val.str();
std::string& source=*str_val.str();
size_t delimeter_len=delimeter.length();
+3 -3
View File
@@ -34,11 +34,11 @@ var input=func(){
return __builtin_input();
}
# split a string by delimiter for example:
# split a string by separator for example:
# split("ll","hello world") -> ["he","o world"]
# this function will return a vector.
var split=func(deli,str){
return __builtin_split(deli,str);
var split=func(separator,str){
return __builtin_split(separator,str);
}
# rand has the same function as the rand in C