This commit is contained in:
Mike Nolan 2022-11-27 15:42:49 -06:00
parent 0f4064537c
commit d162f6dc1f
2 changed files with 13 additions and 6 deletions

2
AST.cs
View File

@ -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);

View File

@ -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);