sclass RuleEngine2_MatchedRule { RuleEngine2.Rule rule; SS map; LS goodVars, badVars; LS unclearVars() { ret listMinusSet(keys(map), goodVars, badVars); } } static L ai_ruleEngine2_rulesForInput_2(RuleEngine2 engine, S q) { LS tokI = javaTokNPunctuationWithBrackets(q); new L l; for (RuleEngine2.Rule rule : engine.rules) { S cond = first(rule.in); SS map = zipTwoListsToCIMap_strict_withoutEquals(javaTokNPunctuationWithBrackets(cond), tokI); if (map == null) continue; //print(map + " | " + cond + " | " + rule.vars); new RuleEngine2_MatchedRule matched; matched.rule = rule; matched.map = map; matched.goodVars = matchX_any_allRests("good var *", rule.comments); matched.badVars = matchX_any_allRests("bad var *", rule.comments); l.add(matched); } ret l; }