@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
29 lines (27 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SourceFileCompiler = void 0;
const tslib_1 = require("tslib");
const ts_utils_1 = require("@neo-one/ts-utils");
const typescript_1 = tslib_1.__importDefault(require("typescript"));
const NodeCompiler_1 = require("../NodeCompiler");
class SourceFileCompiler extends NodeCompiler_1.NodeCompiler {
constructor() {
super(...arguments);
this.kind = typescript_1.default.SyntaxKind.SourceFile;
}
visitNode(sb, node, options) {
ts_utils_1.tsUtils.file.getImportDeclarations(node).forEach((decl) => {
sb.visit(decl, options);
});
sb.emitHelper(node, options, sb.helpers.processStatements({ createScope: false }));
ts_utils_1.tsUtils.file.getExportDeclarations(node).forEach((decl) => {
sb.visit(decl, options);
});
ts_utils_1.tsUtils.file.getExportAssignments(node).forEach((assignment) => {
sb.visit(assignment, options);
});
}
}
exports.SourceFileCompiler = SourceFileCompiler;
//# sourceMappingURL=SourceFileCompiler.js.map