!747 m { p { makeAndroid("Compiler bot!"); } static synchronized S answer(S s) { new Matches m; if (match3("Please compile this JavaX snippet: *", s, m)) { S snippetID = unquote(m.m[0]); S transpiledSrc = getServerTranspiled(snippetID); int i = transpiledSrc.indexOf('\n'); String libs = transpiledSrc.substring(0, Math.max(0, i)); transpiledSrc = transpiledSrc.substring(i+1); return compile(transpiledSrc); } if (match3("Please compile this Java text: *", s, m)) { String src = unquote(m.m[0]); return compile(src); } return null; } static S compile(S src) { Class j = getJavaX(); File srcDir = cast call(j, "TempDirMaker_make"); saveTextFile(new File(srcDir, "main.java"), src); File classesDir = cast call(j, "TempDirMaker_make"); new L libraries; try { call(j, "compileJava", srcDir, libraries, classesDir); } catch (Exception e) { return "Compile Error. " + getOpt(j, "javaCompilerOutput"); } return "ok, " + quote(classesDir.getAbsolutePath()); } }