static L gazelle_reason_repeat_v2(S input1, O... _) { int max = 10; new L out; LS seen = litCISet(input1); LinkedList queue = ll_linkedList(input1); while (nempty(queue) && l(seen) < max) { S input = popFirst(queue); addAll(out, (L) callF(optPar sendToModules(_), input)); L l = gazelle_reasonWithPreAndPost(input, paramsMinus(_, 'sendToModules)); // commit to one entry if (empty(l)) continue; gazelle_sortBeforeCommit(l, _); GazelleTree t = first(l); if (boolPar debug(_) || boolPar debugCommit(_)) print("Committing to: " + t.line + " (out of " + l(l) + ")"); LS lines = tok_splitAtPlusAtBeginningOfLine(t.line); if (l(lines) == 2 && t.rule() != null && contains(t.rule().comments, "out 2 = process")) { print("splitting!"); t.line = first(lines); out.add(t); if (seen.add(lines)) queue.add(second(lines)); input = second(lines); continue; } out.add(t); break; } ret out; }