static new ThreadLocal je_checkRule_debug; static bool je_checkRule(L rule) { pcall-short { ret je_checkRule_impl(rule); } false; } static bool je_checkRule_impl(L rule) { bool debug = isTrue(je_checkRule_debug!); for (JE_CascadeEntry e : rule) { if (eqicOneOf(e.op, "if", "and")) { if (e.java) { // direct match on input with: if "bla" if (l(e.tok) == 1 && isQuoted(get(e.tok, 1))) { if (!eqic(ai_getVar("#input"), unquote(get(e.tok, 1)))) false; } else { if (!isTrue(safeInterpretedJavaEval(e.tok))) { debug print "Rule fail on Java: " + join(e.tok); false; } } } else { L tok = tok_withoutOuterBrackets(e.tok); T3 t = ai_tripelize(join(tok)); if (!has(t)) { debug print "Rule fail on triple: " + ai_renderTriple(t); false; } } } else if (eqic(e.op, "then")) break; else fail("Unsupported operator: " + e.op); } debug print "Rule hit"; true; }