"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const traverse_1 = require("@glas/traverse");
const escodegen_1 = __importDefault(require("escodegen"));
function codegen(root, options) {
    return traverse_1.traverse(root, {
        enter(node) {
            if (node.type === "Program") {
                return traverse_1.skip;
            }
        },
        leave(node) {
            if (node.type === "Program") {
                return escodegen_1.default.generate(node);
            }
        }
    });
}
exports.default = codegen;
