UNPKG

@harmoniclabs/plu-ts-onchain

Version:

An embedded DSL for Cardano smart contracts creation coupled with a library for Cardano transactions, all in Typescript

16 lines (15 loc) 759 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.replaceForcedNativesWithHoisted = void 0; var IRHoisted_1 = require("../../IRNodes/IRHoisted.js"); var isForcedNative_1 = require("../../IRNodes/IRNative/isForcedNative.js"); var _modifyChildFromTo_1 = require("../_internal/_modifyChildFromTo.js"); var iterTree_1 = require("../_internal/iterTree.js"); function replaceForcedNativesWithHoisted(term) { (0, iterTree_1.iterTree)(term, function (node, _dbn) { if ((0, isForcedNative_1.isForcedNative)(node)) { (0, _modifyChildFromTo_1._modifyChildFromTo)(node.parent, node, new IRHoisted_1.IRHoisted(node)); } }); } exports.replaceForcedNativesWithHoisted = replaceForcedNativesWithHoisted;