UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

24 lines (22 loc) 826 B
import { tsUtils } from '@neo-one/ts-utils'; import ts from 'typescript'; import { NodeCompiler } from '../NodeCompiler'; export class SourceFileCompiler extends NodeCompiler { constructor() { super(...arguments); this.kind = ts.SyntaxKind.SourceFile; } visitNode(sb, node, options) { tsUtils.file.getImportDeclarations(node).forEach((decl) => { sb.visit(decl, options); }); sb.emitHelper(node, options, sb.helpers.processStatements({ createScope: false })); tsUtils.file.getExportDeclarations(node).forEach((decl) => { sb.visit(decl, options); }); tsUtils.file.getExportAssignments(node).forEach((assignment) => { sb.visit(assignment, options); }); } } //# sourceMappingURL=SourceFileCompiler.js.map