forked from xxq250/Nasal-Interpreter
update
This commit is contained in:
@@ -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="";
|
||||
|
||||
@@ -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
8
version2.0/run/run1.nas
Normal 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
4
version2.0/run/run2.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
var hash={
|
||||
str:1,
|
||||
f:func{print(me.str);}
|
||||
};
|
||||
Reference in New Issue
Block a user