!7 set flag AllowMetaCode. //standard bot { S add(S s) { null; } S remove(S s) { null; } S listWithPattern(S s) { null; } S clearAfterConfirm() { null; } S answer(S 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); } } //}