return (Statement) StatementSimplifier.optimize(block, mq);
}
public static void main(String... args) throws IOException {
MessageQueue mq = new SimpleMessageQueue();
MessageContext mc = new MessageContext();
JsOptimizer opt = new JsOptimizer(mq);
opt.setRename(true);
opt.setEnvJson(new ObjectConstructor(FilePosition.UNKNOWN));
try {
for (int i = 0, n = args.length; i < n; ++i) {
String arg = args[i];
if ("--norename".equals(arg)) {
opt.setRename(false);
} else if (arg.startsWith("--envjson=")) {
String jsonfile = arg.substring(arg.indexOf('=') + 1);
opt.setEnvJson((ObjectConstructor) jsExpr(fromFile(jsonfile), mq));
} else {
if ("--".equals(arg)) { ++i; }
for (;i < n; ++i) {
CharProducer cp = fromFile(args[i]);
mc.addInputSource(cp.getCurrentPosition().source());
opt.addInput(js(cp, mq));
}
}
}
} catch (ParseException ex) {