This commit is contained in:
Valk Richard Li 2020-02-04 17:48:14 +08:00 committed by GitHub
parent 22bfe370d2
commit cffe95f1d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 1 deletions

View File

@ -48,6 +48,7 @@ bool check_numerable_string(std::string str)
}
return false;
}
double trans_string_to_number(std::string str)
{
bool is_negative=false;
@ -118,6 +119,7 @@ double trans_string_to_number(std::string str)
trans_str_number*=-1;
return trans_str_number;
}
std::string trans_number_to_string(double number)
{
std::string trans_num_string="";

View File

@ -43,4 +43,14 @@ var cl_fun=func(x)
b=cl_fun(1);
c=cl_fun(10);
print(b());
# output 1
# output 1
a=3;
b=0;
if(a==3)
{
var c=10;
b=func{return c;};
}
print(b());
# output 10

8
version2.0/run/run1.nas Normal file
View File

@ -0,0 +1,8 @@
var f=func(x)
{
if(x>9)return;
x+=1;
f(x);
return;
}
f(0);

4
version2.0/run/run2.txt Normal file
View File

@ -0,0 +1,4 @@
var hash={
str:1,
f:func{print(me.str);}
};