From 2458fad5ffcf72bea83d3d49689d5fde666d9149 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sat, 14 May 2022 14:42:53 +0200 Subject: [PATCH] fix issues related to int.new --- ISBPL.java | 11 +++++++++++ std.isbpl | 14 +++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ISBPL.java b/ISBPL.java index 7be9bc0..abfab9e 100644 --- a/ISBPL.java +++ b/ISBPL.java @@ -44,6 +44,7 @@ public class ISBPL { private final ISBPLStreamer streamer = new ISBPLStreamer(this); ArrayList included = new ArrayList<>(); HashMap natives = new HashMap<>(); + boolean stopExceptions = false; private final Object syncMakeThread = new Object(); private ISBPLKeyword getKeyword(String word) { @@ -1514,6 +1515,16 @@ public class ISBPL { catch (InterruptedException e) { e.printStackTrace(); } + catch (Throwable t) { + if(debug) System.out.println("Passing exception " + t + " to caller."); + if(stopExceptions) { + t.printStackTrace(); + System.out.println("Current Words: "); + System.out.println(Arrays.toString(words)); + dump(stack); + } + throw t; + } } // Magic, please test before pushing changes! diff --git a/std.isbpl b/std.isbpl index d43fb80..7ded679 100644 --- a/std.isbpl +++ b/std.isbpl @@ -371,17 +371,17 @@ func anewput { func areverse { def arr =arr - def new arr alen anew =new + def newarr arr alen anew =newarr def i arr alen 1 - =i def j 0 =j while { i 0 lt not } { - new j arr i aget aput + newarr j arr i aget aput j 1 + =j i 1 - =i } - new + newarr } func strcontains { acontains } @@ -463,11 +463,11 @@ func aadd { def arr2 =arr2 def arr1 =arr1 - def new arr1 alen arr2 alen + anew =new - arr1 new 0 0 arr1 alen acopy =new - arr2 new 0 arr1 alen arr2 alen acopy =new + def newarr arr1 alen arr2 alen + anew =newarr + arr1 newarr 0 0 arr1 alen acopy =newarr + arr2 newarr 0 arr1 alen arr2 alen acopy =newarr - new + newarr } def TYPE_SHADOW "shadow" mktype =TYPE_SHADOW