UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

18 lines (16 loc) 542 B
import BN from 'bn.js'; import ts from 'typescript'; import { NodeCompiler } from '../NodeCompiler'; export class NumericLiteralCompiler extends NodeCompiler { constructor() { super(...arguments); this.kind = ts.SyntaxKind.NumericLiteral; } visitNode(sb, expr, options) { if (options.pushValue) { sb.emitPushInt(expr, new BN(expr.text.replace('_', ''), 10)); sb.emitHelper(expr, options, sb.helpers.wrapNumber); } } } //# sourceMappingURL=NumericLiteralCompiler.js.map