// predicates: L> // doesn't modify original tok static LS groupTokenPredicateSequence(LS tok, L predicates) { int min = 0; bool cloned = false; for (int i : indicesOfTokenPredicateSequence(tok, predicates)) { continue if i <= min; if (!cloned) { cloned = true; tok = cloneList(tok); } int j = i+l(predicates)*2-2; tok_addCurlyBracketsAroundPart(tok, i, j); min = j; } ret tok; }