UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

36 lines (34 loc) 1.4 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StructuredStorageReduceValHelper = void 0; const tslib_1 = require("tslib"); const StructuredStorageBaseHelper_1 = require("./StructuredStorageBaseHelper"); class StructuredStorageReduceValHelper extends StructuredStorageBaseHelper_1.StructuredStorageBaseHelper { constructor(_a) { var { each } = _a, rest = tslib_1.__rest(_a, ["each"]); super(rest); this.each = each; } emit(sb, node, options) { sb.emitHelper(node, options, sb.helpers.structuredStorageReduceBase({ type: this.type, each: (innerOptions) => { sb.emitOp(node, 'SWAP'); sb.emitHelper(node, innerOptions, sb.helpers.if({ condition: () => { sb.emitHelper(node, innerOptions, sb.helpers.handleValValueStructuredStorage); }, whenTrue: () => { sb.emitOp(node, 'SWAP'); this.each(innerOptions); }, whenFalse: () => { sb.emitOp(node, 'DROP'); }, })); }, })); } } exports.StructuredStorageReduceValHelper = StructuredStorageReduceValHelper; //# sourceMappingURL=StructuredStorageReduceValHelper.js.map