Warning: session_start(): open(/var/lib/php/sessions/sess_84pv18qafjosco9f320fhb18f3, 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
!7
set flag AllowMetaCode. set flag Reparse.
meta-postProcess { tok_standardBot }
standard bot WeNeed {
Set db = ciSet();
S add(S s) { if (db.add(s)) change(); null; }
S remove(S s) { ret db.remove(s) ? with(r change, "What a relief") : null; }
S listWithPattern(S pat) { ret lines(mapOverClone(db, x -> format(ellipsisToStar(pat), x))); }
S clearAfterConfirm() { ret "You're kidding, right?"; }
sync S processSimplifiedLine(S s, O... _) {
try answer super.processSimplifiedLine(s, _);
new Matches m;
meta {
S program = [[
We need ... = +
We have ... = -
Someone gave us/me ... = -
What do we need = listWithPattern("We need ...")
We don't need ... anymore = -
We need nothing|We don't need anything = clear after confirm
]];
LS tok = javaTok(program);
jreplace(tok, "+", "add(\\$1);");
jreplace(tok, "-", "remove(\\$1);");
jreplace(tok, "clear after confirm", "clearAfterConfirm();");
LS lines = lines(join(tok));
lines = map(lines, l -> {
PairS p = splitAtEquals_pair(l);
ret p == null ? l : "if (matchX2(\*quote(p.a)*/, s, m)) ret \*p.b*/;";
});
ret lines(lines);
}
null;
}
}