// properly post-parse angle bracket things like "<quoted>"
// now also allows a space, like "<exp e1>" or "<exp 1>"
static L<S> mergeBracketThingies(L<S> tok) {
  tok = cloneList(tok);
  for (int i = 1; i+4 < l(tok); i += 2) {
    // short case
    if (eq(get(tok, i), "<") && eq(get(tok, i+1), "") && isIdentifier(get(tok, i+2)) && eq(get(tok, i+3), "") && eq(get(tok, i+4), ">")) {
      tok.set(i, "<" + tok.get(i+2) + ">");
      tok.remove(i+4);
      tok.remove(i+3);
      tok.remove(i+2);
      tok.remove(i+1);
    }
    
    // longer case
    if (eq(get(tok, i), "<")
      && eq(get(tok, i+1), "")
      && isIdentifier(get(tok, i+2))
      && (isIdentifier(get(tok, i+4)) || isInteger(get(tok, i+4)))
      && eq(get(tok, i+5), "")
      && eq(get(tok, i+6), ">")) {
      tok.set(i, "<" + tok.get(i+2) + " " + tok.get(i+4) + ">");
      tok.remove(i+6);
      tok.remove(i+5);
      tok.remove(i+4);
      tok.remove(i+3);
      tok.remove(i+2);
      tok.remove(i+1);
    }
  }
  
  ret tok;
}