// i must point at the opening bracket (<) // index returned is index of closing bracket (>) // If there is NO opening bracket at i, we return nothing static int tok_findEndOfAngleBracketPart(LS tok, int i) { int level = 0, n = l(tok); while (i < n) { S t = tok.get(i); if (eq(t, "<")) ++level; if (level == 0) ret i; if (eq(t, ">")) --level; i += 2; } ret n; }