mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-20 15:20:25 +00:00
better type checking for function args
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user