// OLD version sbool ai_ruleAccessesInput(S rule) { L tok = javaTokC(rule); S t; if (contains(tok, "ai_input")) true; for i over tok: if (eqGet(tok, i+1, "(") && isIdentifier(t = tok.get(i))) if (eq(t, "i") || swic(t, "input") || ewic(t, "input")) true; false; } // NEW version sbool ai_ruleAccessesInput(IfThen rule) { final new Flag flag; nlLogic_visit(rule.in, voidfunc(O o) { if (o cast Func) { S t = o.name; if (eqOneOf(t, "i", "phrase") || swic(t, "input") || ewic(t, "input")) flag.raise(); } if (o cast Exp) if (jcontains(o.text(), "ai_input()")) flag.raise(); }); ret flag.isUp(); }