better type checking for function args

This commit is contained in:
dfsek
2020-12-21 22:30:02 -07:00
parent 13fbb9bf54
commit cb7b3de48c
5 changed files with 36 additions and 18 deletions

View File

@@ -27,9 +27,22 @@ public class ParserTest {
}
@Override
public int getArguments() {
public int argNumber() {
return 2;
}
@Override
public Returnable.ReturnType getArgument(int position) {
switch(position) {
case 0:
return Returnable.ReturnType.STRING;
case 1:
return Returnable.ReturnType.NUMBER;
default:
return null;
}
}
});
long l = System.nanoTime();
@@ -71,7 +84,7 @@ public class ParserTest {
@Override
public Position getPosition() {
return null;
return position;
}
@Override

View File

@@ -1,5 +1,5 @@
test("hello" + 3 + "gdfg", (2 * (3+1) * (2 * (1+1))));
if(true || false) {
test("fdsgdf" + 2, 3.4);
test("fdsgdf" + 2, 1);
}