// finds " {" and " {" // func: tok, C token index of keyword -> S[] {beg, end} static L replaceKeywordPlusQuotedOrIDBlock(L tok, S keyword, O func) { for (int i = 0; i < 1000; i++) { int idx = jfind_any(tok, keyword + " {", 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; }