add getfile native to ISBPL.java, add comment support for construct blocks

This commit is contained in:
Daniella / Tove 2022-05-13 19:14:08 +02:00
parent 83344809f0
commit 0176503ece

View file

@ -216,6 +216,10 @@ public class ISBPL {
// Ignore empty // Ignore empty
if(word2.equals("")) continue; if(word2.equals("")) continue;
if(word2.equals("\"")) continue; if(word2.equals("\"")) continue;
if(word2.equals("#")) {
j++;
continue;
}
if(definingMethods) { if(definingMethods) {
AtomicInteger idx2 = new AtomicInteger(++j); AtomicInteger idx2 = new AtomicInteger(++j);
@ -384,6 +388,11 @@ public class ISBPL {
frameStack.get().get(frameStack.get().size() - 1 - ((int) i.object)).resolve(toJavaString(s)).call(stack); frameStack.get().get(frameStack.get().size() - 1 - ((int) i.object)).resolve(toJavaString(s)).call(stack);
}; };
break; break;
case "getfile":
func = (Stack<ISBPLObject> stack) -> {
stack.push(toISBPLString(fileStack.get().peek().getAbsolutePath()));
};
break;
case "reload": case "reload":
func = (Stack<ISBPLObject> stack) -> { func = (Stack<ISBPLObject> stack) -> {
String filepath = getFilePathForInclude((Stack<ISBPLObject>) stack, fileStack.get()); String filepath = getFilePathForInclude((Stack<ISBPLObject>) stack, fileStack.get());