Warning: session_start(): open(/var/lib/php/sessions/sess_fab79oun7foddgi7l93prbo3cr, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
!759
static S vmArgs = "-server";
static O trans;
p {
//makeBot("The 759 Bot.");
Android3 a = new Android3("The 759 Bot.");
a.useMultiPort = false;
a.startPort = 4898;
makeAndroid(a);
hotwire(#1007916); // Compiler Bot
}
synchronized answer {
if "please translate *"
ret transpile(m.unq(0));
if "please translate snippet *"
ret transpile(loadSnippet(m.unq(0)));
if "clear 759" {
cleanUp(trans);
trans = null;
setOpt(getJavaX(), "preferCached", false);
loadTranslator();
ret "OK, cleared & reloaded.";
}
if "reboot" {
nohupJavax(getProgramID(), vmArgs);
System.exit(0);
}
}
static S transpile(S mainJava) {
mainJava = mainJava.replace("\r\n", "\n").replace("\r", "");
assertTrue(mainJava.contains("!752") || mainJava.contains("!759") || mainJava.contains("!7\n"));
mainJava = ("\n" + mainJava).replace("\n!752", "\n").replace("\n!759", "\n").replace("\n!7\n", "\n\n").substring(1);
S transpiled = transpileRaw(mainJava);
// remaining translator invocations are libraries. move to top
new L libs;
transpiled = findTranslators2(transpiled, libs);
if (nempty(libs))
transpiled = "LIBS: " + join(" ", libs) + "\n" + transpiled;
ret "OK " + bytesToHex(toUtf8(transpiled));
}
// assumes translator invocation has been removed
static S transpileRaw(S mainJava) {
if (trans == null)
loadTranslator();
set(trans, "mainJava", mainJava);
callMain(trans);
ret (S) get(trans, "mainJava");
}
static void loadTranslator() {
trans = hotwire("#759");
}