@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
23 lines (21 loc) • 838 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.NumericLiteralCompiler = void 0;
const tslib_1 = require("tslib");
const bn_js_1 = require("bn.js");
const typescript_1 = tslib_1.__importDefault(require("typescript"));
const NodeCompiler_1 = require("../NodeCompiler");
class NumericLiteralCompiler extends NodeCompiler_1.NodeCompiler {
constructor() {
super(...arguments);
this.kind = typescript_1.default.SyntaxKind.NumericLiteral;
}
visitNode(sb, expr, options) {
if (options.pushValue) {
sb.emitPushInt(expr, new bn_js_1.BN(expr.text.replace('_', ''), 10));
sb.emitHelper(expr, options, sb.helpers.wrapNumber);
}
}
}
exports.NumericLiteralCompiler = NumericLiteralCompiler;
//# sourceMappingURL=NumericLiteralCompiler.js.map