allow cleaning

This commit is contained in:
Daniella / Tove 2022-10-02 22:22:41 +02:00
parent 804d45669e
commit 2f8aaade55

View file

@ -47,6 +47,13 @@ public class ISBPL {
HashMap<String, ISBPLCallable> natives = new HashMap<>(); HashMap<String, ISBPLCallable> natives = new HashMap<>();
boolean stopExceptions = false; boolean stopExceptions = false;
HashMap<Throwable, Stack<ISBPLFrame>> stackTraces = new HashMap<>(); HashMap<Throwable, Stack<ISBPLFrame>> stackTraces = new HashMap<>();
public static void clean() {
System.out.println("ISBPL CLEAN!!");
defaultTypeInt = new ISBPLType("int", -2);
defaultTypeString = new ISBPLType("string", -1);
ISBPLStreamer.streams.clear();
}
private final Object syncMakeThread = new Object(); private final Object syncMakeThread = new Object();
private ISBPLKeyword getKeyword(String word) { private ISBPLKeyword getKeyword(String word) {
@ -1514,8 +1521,8 @@ public class ISBPL {
} }
// These will die as soon as std creates the real types and any types created before these are replaced become invalid. // These will die as soon as std creates the real types and any types created before these are replaced become invalid.
static final ISBPLType defaultTypeInt = new ISBPLType("int", -2); static ISBPLType defaultTypeInt = new ISBPLType("int", -2);
static final ISBPLType defaultTypeString = new ISBPLType("string", -1); static ISBPLType defaultTypeString = new ISBPLType("string", -1);
public ISBPLType getType(String name) { public ISBPLType getType(String name) {
for (int i = 0 ; i < types.size() ; i++) { for (int i = 0 ; i < types.size() ; i++) {