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; int i = 1; bool change; while ping (i < n) { if (!codeTokensEqualICAtIndex(tok, tokIn, i)) continue with i += 2; if (tokOut == null) tokOut = dropFirstAndLast(javaTok(out)); int oldEnd = i+l(tokIn)-1, newEnd = i+l(tokOut); replaceSublist(tok, i, oldEnd, tokOut); i = newEnd+1; set change; } ret change ? join(tok) : s; }