better trycatch, more debugging

This commit is contained in:
Daniella 2022-03-06 15:37:19 +01:00
parent a05ace0cec
commit d57404bf02

View file

@ -13,7 +13,7 @@ import java.util.concurrent.atomic.AtomicInteger;
*/ */
public class ISBPL { public class ISBPL {
private static boolean debug = false; static boolean debug = false;
public ISBPLDebugger.IPC debuggerIPC = new ISBPLDebugger.IPC(); public ISBPLDebugger.IPC debuggerIPC = new ISBPLDebugger.IPC();
ArrayList<ISBPLType> types = new ArrayList<>(); ArrayList<ISBPLType> types = new ArrayList<>();
Stack<HashMap<String, ISBPLCallable>> functionStack = new Stack<>(); Stack<HashMap<String, ISBPLCallable>> functionStack = new Stack<>();
@ -97,8 +97,8 @@ public class ISBPL {
block.call(file); block.call(file);
} catch (ISBPLError error) { } catch (ISBPLError error) {
if (Arrays.asList(allowed).contains(error.type) || allowed.length != 1 && allowed[0].equals("all")) { if (Arrays.asList(allowed).contains(error.type) || allowed.length != 1 && allowed[0].equals("all")) {
stack.push(toISBPLString(error.type));
stack.push(toISBPLString(error.message)); stack.push(toISBPLString(error.message));
stack.push(toISBPLString(error.type));
catcher.call(file); catcher.call(file);
} }
else { else {
@ -1293,6 +1293,12 @@ class ISBPLDebugger extends Thread {
} }
} }
break; break;
case "son":
ISBPL.debug = true;
break;
case "soff":
ISBPL.debug = false;
break;
case "exit": case "exit":
System.exit(255); System.exit(255);
break; break;