This commit is contained in:
Daniella / Tove 2022-05-05 17:34:29 +02:00
parent fbb082a19a
commit dfc7549d3b
2 changed files with 17 additions and 20 deletions

View file

@ -116,13 +116,6 @@ public class ISBPL {
try {
block.call(stack);
} catch (ISBPLError error) {
if(stack.size() > stackHeight) {
stack.setSize(stackHeight);
stack.trimToSize();
}
while(stack.size() < stackHeight) {
stack.push(getNullObject());
}
if (Arrays.asList(allowed).contains(error.type) || allowed.length == 1 && allowed[0].equals("all")) {
stack.push(toISBPLString(error.message));
stack.push(toISBPLString(error.type));
@ -132,13 +125,6 @@ public class ISBPL {
throw error;
}
} catch (Exception e) {
if(stack.size() > stackHeight) {
stack.setSize(stackHeight);
stack.trimToSize();
}
while(stack.size() < stackHeight) {
stack.push(getNullObject());
}
if (Arrays.asList(allowed).contains("Java") || allowed.length == 1 && allowed[0].equals("all")) {
stack.push(toISBPL(e));
stack.push(toISBPLString(e.getClass().getName()));
@ -147,6 +133,14 @@ public class ISBPL {
else {
throw e;
}
} finally {
if(stack.size() > stackHeight) {
stack.setSize(stackHeight);
stack.trimToSize();
}
while(stack.size() < stackHeight) {
stack.push(getNullObject());
}
}
return i.get();
};

View file

@ -366,26 +366,29 @@ func areverse {
}
func strcontains {
def check =check "bind check" #
def s =s "bind string" #
def check _array =check "bind check" #
def s _array =s "bind string" #
def found 0 =found
def counter 0 =counter
def i 0 =i
def j 0 =j
while { i s alen lt } {
s i aget check j aget eq dup if {
s i aget check counter aget eq dup if {
counter inc
}
not if {
0 =counter
s i aget check counter aget eq if {
counter inc
}
}
counter check alen eq if {
3 stop
1 =found
s alen =i
}
i inc
}
counter check alen eq
found
}
"These functions are magic, they use natives to get recent words and modify the" #