fix compiler and std bugs

This commit is contained in:
Daniella / Tove 2022-03-05 21:07:29 +01:00
parent 5c306c741d
commit 1a7177d83f
2 changed files with 14 additions and 1 deletions

View file

@ -360,7 +360,7 @@ public class ISBPL {
func = () -> {
ISBPLObject s = stack.pop();
ISBPLType type = registerType(toJavaString(s));
stack.push(new ISBPLObject(getType("int"), type));
stack.push(new ISBPLObject(getType("int"), type.id));
};
break;
case "typename":
@ -376,6 +376,14 @@ public class ISBPL {
stack.push(new ISBPLObject(getType("int"), o.type.id));
};
break;
case "settype":
func = () -> {
ISBPLObject i = stack.pop();
ISBPLObject o = stack.pop();
i.checkType(getType("int"));
stack.push(new ISBPLObject(types.get(((int) i.object)), o.object));
};
break;
case "throw":
func = () -> {
ISBPLObject message = stack.pop();

View file

@ -103,9 +103,14 @@ func _string {
dtoi =object
}
object isarray if {
object TYPE_STRING settype =object
}
object isstring not if {
"IncompatibleTypes" "Incompatible types: " object gettype typename " - string" strconcat strconcat throw
}
object
}
func isstring {
gettype typename "string" eq