diff --git a/pom.xml b/pom.xml index b583d3fb..aa98819a 100644 --- a/pom.xml +++ b/pom.xml @@ -64,20 +64,6 @@ - - release-zip - verify - - run - - - - - - - - - @@ -111,6 +97,13 @@ json 20231013 + + + org.teavm + teavm-jso + 0.10.2 + true + @@ -125,18 +118,6 @@ - - - org.apache.maven.plugins - maven-compiler-plugin - 3.13.0 - - - web/** - - - - org.apache.maven.plugins @@ -157,6 +138,36 @@ false + + + + + org.teavm:teavm-classlib + + + + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + 3.1.0 + + + release-zip + package + + run + + + + + + + @@ -227,14 +238,6 @@ - - - org.teavm - teavm-jso - 0.10.2 - - - diff --git a/src/aya/InteractiveAya.java b/src/aya/InteractiveAya.java index 265fe124..9e4db1b4 100644 --- a/src/aya/InteractiveAya.java +++ b/src/aya/InteractiveAya.java @@ -180,7 +180,7 @@ public int loop() { // Load startup script String[] args = AyaPrefs.getArgs(); if (args.length >= 2 && args[1].contains(".aya")) { - String startupScript = AyaPrefs.getArgs()[1]; + String startupScript = AyaPrefs.getArgs()[1].replace("\\", "\\\\"); StaticBlock blk2 = Parser.compileSafeOrNull(new SourceString("\"" + startupScript + "\":F", ""), StaticData.IO); if (blk2 != null) { _aya.queueInput(new ExecutionRequest(makeRequestID(), blk2)); diff --git a/src/web/AyaWeb.java b/src/web/AyaWeb.java index 2bc4e00c..c16bb18d 100644 --- a/src/web/AyaWeb.java +++ b/src/web/AyaWeb.java @@ -13,7 +13,6 @@ import aya.exceptions.parser.ParserException; import aya.ext.color.ColorInstructionStore; import aya.ext.date.DateInstructionStore; -import aya.ext.graphics.GraphicsInstructionStore; import aya.ext.json.JSONInstructionStore; import aya.ext.la.LinearAlgebraInstructionStore; import aya.io.StringOut; @@ -21,7 +20,7 @@ public class AyaWeb { - private static StringOut output = new StringOut(); + private static final StringOut output = new StringOut(); public static void main(String[] args) { @@ -53,48 +52,27 @@ public static void main(String[] args) { // // Exported Functions Implementation // - exportRunIsolated(new ExportFunctionRunIsolated() { - @Override - public String call(String s) { - StandaloneAya.runIsolated(input, StaticData.IO); - return output.flushOut() + output.flushErr(); - } + exportRunIsolated(s -> { + StandaloneAya.runIsolated(s, StaticData.IO); + return output.flushOut() + output.flushErr(); }); - exportAddFile(new ExportFunctionAddFile() { - @Override - public void call(String path, String content) { - ((WebFilesystemIO)(StaticData.FILESYSTEM)).addFile(path, content); - } - }); + exportAddFile((path, content) -> ((WebFilesystemIO)(StaticData.FILESYSTEM)).addFile(path, content)); - exportListFiles(new ExportFunctionListFiles() { - @Override - public String call() { - ArrayList files = fs.listFiles(); - String out = ""; - for (String s : files) { - out += s + ","; - } - return out; + exportListFiles(() -> String.join(",", fs.listFiles())); + + exportLint(source -> { + ArrayList errors = StandaloneAya.lint(source); + if (errors.size() > 0) { + // TODO: The compile function stops after the first error + // if we update the parser to catch multiple errors, we will need to update this + ParserException err = errors.get(0); + return err.getSource().getIndex() + ":" + err.getSimpleMessage(); + } else { + return ""; } }); - exportLint(new ExportFunctionLint() { - @Override - public String call(String source) { - ArrayList errors = StandaloneAya.lint(source); - if (errors.size() > 0) { - // TODO: The compile function stops after the first error - // if we update the parser to catch multiple errors, we will need to update this - ParserException err = errors.get(0); - return err.getSource().getIndex() + ":" + err.getSimpleMessage(); - } else { - return ""; - } - } - }); - } //