// new Type var; => Type var = new Type; // new Type<...> var; => Type var = new Type; svoid tok_quicknew(LS tok) { int i = -1; while ((i = jfind(tok, i+1, "new ")) >= 0) { int j = tok_findEndOfType(tok, i+2); if (isIdentifier(get(tok, j)) && eqGetOneOf(tok, j+2, ";", ",")) { LS vars = ll(get(tok, j)); int k = j; while (eqGet(tok, k+2, ",") && isIdentifier(get(tok, k+4))) { k += 4; vars.add(tok.get(k)); } S type = joinSubList(tok, i+2, j-1); if (!contains(type, ".")) type = tok.get(i+2); clearTokens(tok, i, i+2); for iVar over vars: tokAppend(tok, j+iVar*4, " = new " + type + "()"); reTok(tok, i, k+3); } } }