// finds " {" // func: tok, C token index of keyword -> S[] {beg, end} static LS replaceKeywordPlusQuotedBlock(LS tok, S keyword, O func) { for (int i = 0; i < 1000; i++) { int idx = jfind(tok, keyword + " {"); if (idx < 0) break; int j = findEndOfBracketPart(tok, idx+4); S[] be = (S[]) callF(func, tok, idx); tok.set(idx, be[0]); clearTokens(tok, idx+1, idx+5); tok.set(j-1, be[1]); reTok(tok, idx, j); } ret tok; }