// matches first condition, leaves rest in MatchedRule static L ai_ruleEngine2_rulesForInput_5(RuleEngine2 engine, SS inputsByType) { new L l; for (RuleEngine2.Rule rule : engine.rules) { final new RuleEngine2_MatchedRule matched; matched.rule = rule; if (rule cast RuleEngine2.SimplifyWithRule) { S in = inputsByType.get('standard); S out = strOrNull(callF(engine.callFunctionOnString, rule.function, in)); //print("Called " + rule.function + " => " + out); if (out != null && neq(out, in)) { matched.out = out; l.add(matched); } continue; } matched.map = ciMap(); matched.tokenizationFunction = or(matchAny_firstGroup("tokenize with *", rule.comments), f javaTokNPunctuationWithBrackets); if (!ai_ruleEngine2_matchStep(matched, inputsByType, true)) continue; l.add(matched); } ret l; }