From 0176503ecec09169be6c54c917b1b2a8bdda2022 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Fri, 13 May 2022 19:14:08 +0200 Subject: [PATCH] add getfile native to ISBPL.java, add comment support for construct blocks --- bootstrap/ISBPL.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bootstrap/ISBPL.java b/bootstrap/ISBPL.java index ef5b76a..7be9bc0 100644 --- a/bootstrap/ISBPL.java +++ b/bootstrap/ISBPL.java @@ -216,6 +216,10 @@ public class ISBPL { // Ignore empty if(word2.equals("")) continue; if(word2.equals("\"")) continue; + if(word2.equals("#")) { + j++; + continue; + } if(definingMethods) { 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); }; break; + case "getfile": + func = (Stack stack) -> { + stack.push(toISBPLString(fileStack.get().peek().getAbsolutePath())); + }; + break; case "reload": func = (Stack stack) -> { String filepath = getFilePathForInclude((Stack) stack, fileStack.get());