sS replaceStarsWithCountingDollarVars(S s) { ret join(replaceCurlyBracedWithStars(javaTokWithAllBrackets_cached(s))); } static LS replaceCurlyBracedWithStars(LS tok) { int i = 0; tok = cloneList(tok); for (int i = 1; i < l(tok); i += 2) { if (eq(t, "*")) tok.set(i, "$" + (++i)); ret tok; }