private static RenderContext makeRenderContext(
Appendable a, IOCallback cb,
boolean pretty,
boolean json) {
TokenConsumer tc = pretty
? new JsPrettyPrinter(new Concatenator(a, cb))
: new JsMinimalPrinter(new Concatenator(a, cb));
return new RenderContext(tc).withJson(json);
}