sS jreplaceIC_literal(S s, S in, S out) { LS tokIn = javaTokC(in); LS tok = javaTok(s); LS tokOut = null; int n = l(tok)-l(tokIn)*2+1; int i = 1; bool change; while ping (i < n) { ifdef jreplaceIC_literal_debug print("jreplaceIC_literal: list=" + subList(tok, i, i+l(tokIn)*2-1)); endifdef if (!codeTokensEqualICAtIndex(tok, tokIn, i)) continue with i += 2; if (tokOut == null) tokOut = dropFirstAndLast(javaTok(out)); int oldEnd = i+l(tokIn)*2-1, newEnd = i+l(tokOut); replaceSublist(tok, i, oldEnd, tokOut); n += newEnd-oldEnd; i = newEnd+1; set change; } ret change ? join(tok) : s; }