static S replaceCodeTokensUsingMap(S s, SS map) {
  ret join(replaceCodeTokensUsingMap(javaTok(s), map));
}

static LS replaceCodeTokensUsingMap(L<S> tok, SS map) {
  LS out = emptyList(tok);
  for i over tok: {
    out.add(odd(i) ? lookupOrKeep(map, tok.get(i)) : tok.get(i));
  }
  ret out;
}

sS replaceCodeTokensUsingMap(SS map, S s) {
  ret replaceCodeTokensUsingMap(s, map);
}