rshift
This commit is contained in:
parent
0f4064537c
commit
d162f6dc1f
2
AST.cs
2
AST.cs
|
@ -1019,7 +1019,7 @@ namespace langtest
|
||||||
{
|
{
|
||||||
if(expressions.Count < 2) throw new Exception("need two param");
|
if(expressions.Count < 2) throw new Exception("need two param");
|
||||||
return expressions[0].Evaluate(state) << (int) expressions[1].Evaluate(state);
|
return expressions[0].Evaluate(state) << (int) expressions[1].Evaluate(state);
|
||||||
}else if(name == "rshit")
|
}else if(name == "rshift")
|
||||||
{
|
{
|
||||||
if(expressions.Count < 2) throw new Exception("need two param");
|
if(expressions.Count < 2) throw new Exception("need two param");
|
||||||
return expressions[0].Evaluate(state) >> (int) expressions[1].Evaluate(state);
|
return expressions[0].Evaluate(state) >> (int) expressions[1].Evaluate(state);
|
||||||
|
|
15
code/app.bs
15
code/app.bs
|
@ -1,5 +1,12 @@
|
||||||
res=string_split_chr("Demi,Lovato,Tom,Joel",',');
|
j=4;
|
||||||
j=0;
|
create_function(joel,a,b,{
|
||||||
for(j,box_len(res),j+1,{
|
e2=42;
|
||||||
box_println(box_getvalue(res,j));
|
{
|
||||||
|
e=42;
|
||||||
|
printint(e2);
|
||||||
|
};
|
||||||
|
printint(e2);
|
||||||
|
printint(j);
|
||||||
});
|
});
|
||||||
|
joel(4,4);
|
||||||
|
printint(e);
|
Loading…
Reference in New Issue