// func : func(LS tok, int iOpening, int iClosing) -> S[] {beg, end} static L replaceKeywordBlock_dyn2(L tok, S keyword, F3 func) { for (int i = 0; i < 1000; i++) { int idx = findCodeTokens(tok, keyword, "{"); if (idx < 0) break; int j = findEndOfBracketPart(tok, idx+2); S[] be = (S[]) callF(func, tok, idx+2, j-1); tok.set(idx, be[0]); tok.set(idx+1, " "); tok.set(idx+2, ""); tok.set(j-1, be[1]); reTok(tok, idx, j); } ret tok; }