// i = C token to the right of type // returns start index of type static int tok_leftScanType(LS tok, int i) { // first skip ellipsis if (subListEq(tok, i-6, ".", "", ".", "", ".")) i -= 6; // skip array brackets while (eqGet(tok, i-2, "]") && eqGet(tok, i-4, "[")) i -= 4; // skip type args i = tok_leftScanTypeArgsOpt(tok, i); print(get(tok, i-2)); // package names / outer classes while (isIdentifier(get(tok, i-2))) { if (eqGet(tok, i-2, ".")) i -= 4; else break; S t = get(tok, i-4); print(+t); if (!isIdentifier(t)) break; i -= 4; } ret i-2; }