godprotocol 1.0.77 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Index.js +0 -3
- package/Loader_sequence/main.js +250 -54
- package/Objects/Account.js +23 -20
- package/Objects/Block.js +4 -1
- package/Objects/Chain.js +8 -1
- package/Objects/Filesystem.js +11 -15
- package/Objects/Manager.js +15 -7
- package/Objects/Opcodes.js +5 -3
- package/Objects/Oracle.js +10 -0
- package/Objects/Virtual_machine.js +1 -7
- package/framer.js +2 -4
- package/opcodes/std.js +2 -1
- package/opcodes.js +6 -4
- package/package.json +17 -4
- package/readme.md +2 -2
- package/utils/services.js +1 -1
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/0ee263de3fb9e3e08e7d5abe21db8c0fe66188829979996dcddd3533d855a817/30dc10d3485923c0c19083559094fe636f9491bff9c997306ffdbf3e1618a402/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/0ee263de3fb9e3e08e7d5abe21db8c0fe66188829979996dcddd3533d855a817/4dc569813ce0a2f446a3eec01358f5774f8564641ef8d579ff5b6d94b4d031a7/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/0ee263de3fb9e3e08e7d5abe21db8c0fe66188829979996dcddd3533d855a817/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/0ee263de3fb9e3e08e7d5abe21db8c0fe66188829979996dcddd3533d855a817/a965464a6d9f981543ce3aede226bd0fb989d9300cd8468f41cd1fc0139c8f44/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/12cd650efa4f63b7c61c3345db3daa0534f4c370a003ea6d8ae0d29a49f6f928/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/3ff3661353ccadcaf9c6759a539d8d31e19c07ed0dd888170b9e55c7a18721da/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/3ff3661353ccadcaf9c6759a539d8d31e19c07ed0dd888170b9e55c7a18721da/de551b5a493859e532316cbbf1e4a14eb06e0512556b1c1295ad60ffe07c185b/19270ea4f98808a63fbb99bc26a5ee6f0fe8df9c8182cf1d710b115d57250578 +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/3ff3661353ccadcaf9c6759a539d8d31e19c07ed0dd888170b9e55c7a18721da/f8a165e3f556ca2ea189f4d4401d139b22a6f19d0b38329fe4a5f14599840634/4f52f1dc77e0233034c6566fc73c30234de85d2298ff90885a7c56502dffa0b2 +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/3ff3661353ccadcaf9c6759a539d8d31e19c07ed0dd888170b9e55c7a18721da/f8a165e3f556ca2ea189f4d4401d139b22a6f19d0b38329fe4a5f14599840634/8d3c916f9c93a6f4c8be9c3f4493b1c02d3eb7516eac153a98320924b27739d8 +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/f968ed8cf7958218d4604b3de0bf074f09bac7925e86f7d1f495f8b2c67f31a7/61bdf0593cd727752cb917ab968a08853d45142b8a8e4cdcd0fe03d1616f3586/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Accounts/59eb3cb130074f7b1ddb99c8fe14f27e1dbca735bb3da82e1ff0305340a32419/f968ed8cf7958218d4604b3de0bf074f09bac7925e86f7d1f495f8b2c67f31a7/74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b +0 -1
- package/Loader_sequence/functions/parse_expression.js +0 -107
- package/Loader_sequence/functions/parse_to_obj.js +0 -38
- package/Loader_sequence/functions/parse_variable.js +0 -38
- package/Loader_sequence/functions/tokenise.js +0 -135
- package/Loader_sequence/functions/utils.js +0 -14
- package/Loader_sequence/keywords/parse.js +0 -23
- package/Loader_sequence/native_classes/Variable.js +0 -49
- package/Loader_sequence/native_classes/datatypes/Array.js +0 -56
- package/Loader_sequence/native_classes/datatypes/Boolean.js +0 -42
- package/Loader_sequence/native_classes/datatypes/Number.js +0 -42
- package/Loader_sequence/native_classes/datatypes/String.js +0 -42
- package/Loader_sequence/native_classes/datatypes/Twain.js +0 -65
- package/Loader_sequence/native_classes/datatypes/Void.js +0 -42
- package/Loader_sequence/native_classes/global.js +0 -48
- package/Loader_sequence/native_classes/native.js +0 -63
- package/Loader_sequence/native_classes/operators.js +0 -64
- package/Loader_sequence/native_classes/parse.js +0 -54
- package/Loader_sequence/utils/format_instructions.js +0 -52
- package/build/Account.js +0 -245
- package/build/Array.js +0 -142
- package/build/Block.js +0 -100
- package/build/Blockweb.js +0 -78
- package/build/Boolean.js +0 -128
- package/build/Chain.js +0 -198
- package/build/Explorer.js +0 -85
- package/build/Filesystem.js +0 -173
- package/build/Frame.js +0 -108
- package/build/Index.js +0 -31
- package/build/Manager.js +0 -167
- package/build/Number.js +0 -128
- package/build/Opcodes.js +0 -75
- package/build/Oracle.js +0 -70
- package/build/String.js +0 -128
- package/build/Twain.js +0 -151
- package/build/Variable.js +0 -135
- package/build/Virtual_machine.js +0 -220
- package/build/Void.js +0 -128
- package/build/format_instructions.js +0 -52
- package/build/framer.js +0 -90
- package/build/global.js +0 -134
- package/build/main.js +0 -83
- package/build/native.js +0 -101
- package/build/operators.js +0 -150
package/build/Twain.js
DELETED
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _native = _interopRequireDefault(require("../native"));
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
"default": e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function _typeof(o) {
|
|
14
|
-
"@babel/helpers - typeof";
|
|
15
|
-
|
|
16
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17
|
-
return typeof o;
|
|
18
|
-
} : function (o) {
|
|
19
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20
|
-
}, _typeof(o);
|
|
21
|
-
}
|
|
22
|
-
function _defineProperties(e, r) {
|
|
23
|
-
for (var t = 0; t < r.length; t++) {
|
|
24
|
-
var o = r[t];
|
|
25
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _createClass(e, r, t) {
|
|
29
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
30
|
-
writable: !1
|
|
31
|
-
}), e;
|
|
32
|
-
}
|
|
33
|
-
function _classCallCheck(a, n) {
|
|
34
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
35
|
-
}
|
|
36
|
-
function _inherits(t, e) {
|
|
37
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
38
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
39
|
-
constructor: {
|
|
40
|
-
value: t,
|
|
41
|
-
writable: !0,
|
|
42
|
-
configurable: !0
|
|
43
|
-
}
|
|
44
|
-
}), Object.defineProperty(t, "prototype", {
|
|
45
|
-
writable: !1
|
|
46
|
-
}), e && _setPrototypeOf(t, e);
|
|
47
|
-
}
|
|
48
|
-
function _setPrototypeOf(t, e) {
|
|
49
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
50
|
-
return t.__proto__ = e, t;
|
|
51
|
-
}, _setPrototypeOf(t, e);
|
|
52
|
-
}
|
|
53
|
-
function _createSuper(t) {
|
|
54
|
-
var r = _isNativeReflectConstruct();
|
|
55
|
-
return function () {
|
|
56
|
-
var e,
|
|
57
|
-
o = _getPrototypeOf(t);
|
|
58
|
-
if (r) {
|
|
59
|
-
var s = _getPrototypeOf(this).constructor;
|
|
60
|
-
e = Reflect.construct(o, arguments, s);
|
|
61
|
-
} else e = o.apply(this, arguments);
|
|
62
|
-
return _possibleConstructorReturn(this, e);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function _possibleConstructorReturn(t, e) {
|
|
66
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
67
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
68
|
-
return _assertThisInitialized(t);
|
|
69
|
-
}
|
|
70
|
-
function _assertThisInitialized(e) {
|
|
71
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
72
|
-
return e;
|
|
73
|
-
}
|
|
74
|
-
function _isNativeReflectConstruct() {
|
|
75
|
-
try {
|
|
76
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
77
|
-
} catch (t) {}
|
|
78
|
-
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
79
|
-
return !!t;
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
82
|
-
function _getPrototypeOf(t) {
|
|
83
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
84
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
85
|
-
}, _getPrototypeOf(t);
|
|
86
|
-
}
|
|
87
|
-
function _defineProperty(e, r, t) {
|
|
88
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
89
|
-
value: t,
|
|
90
|
-
enumerable: !0,
|
|
91
|
-
configurable: !0,
|
|
92
|
-
writable: !0
|
|
93
|
-
}) : e[r] = t, e;
|
|
94
|
-
}
|
|
95
|
-
function _toPropertyKey(t) {
|
|
96
|
-
var i = _toPrimitive(t, "string");
|
|
97
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
98
|
-
}
|
|
99
|
-
function _toPrimitive(t, r) {
|
|
100
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
101
|
-
var e = t[Symbol.toPrimitive];
|
|
102
|
-
if (void 0 !== e) {
|
|
103
|
-
var i = e.call(t, r || "default");
|
|
104
|
-
if ("object" != _typeof(i)) return i;
|
|
105
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
106
|
-
}
|
|
107
|
-
return ("string" === r ? String : Number)(t);
|
|
108
|
-
}
|
|
109
|
-
var Twain = /*#__PURE__*/function (_Native) {
|
|
110
|
-
_inherits(Twain, _Native);
|
|
111
|
-
var _super = _createSuper(Twain);
|
|
112
|
-
function Twain(token) {
|
|
113
|
-
var _this;
|
|
114
|
-
_classCallCheck(this, Twain);
|
|
115
|
-
_this = _super.call(this);
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "generate_assembly", function (sequence) {
|
|
117
|
-
sequence.push("link ".concat(_this.token.compiler.account.physical_address, "/Datatypes/Twain"));
|
|
118
|
-
_this.value = _this.token.value;
|
|
119
|
-
var is_prop = true;
|
|
120
|
-
var pairs = new Array();
|
|
121
|
-
_this.value.map(function (val) {
|
|
122
|
-
if (val.type === "separator") {
|
|
123
|
-
is_prop = val.value === "," ? true : false;
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (is_prop) {
|
|
127
|
-
pairs.push([val]);
|
|
128
|
-
} else pairs.slice(-1)[0].push(val);
|
|
129
|
-
});
|
|
130
|
-
for (var p = 0; p < pairs.length; p++) {
|
|
131
|
-
var pair = pairs[p];
|
|
132
|
-
if (pair.length !== 2) continue;
|
|
133
|
-
_this.token.compiler.parse(pair, _assertThisInitialized(_this));
|
|
134
|
-
}
|
|
135
|
-
_this.children.map(function (child, i) {
|
|
136
|
-
child.generate_assembly(sequence);
|
|
137
|
-
if (i % 2 === 1 && i) {
|
|
138
|
-
sequence.push("cursor {*datapath:-2}");
|
|
139
|
-
sequence.push("write {datapath:-1}");
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
sequence.push("pop Datatypes/Twain");
|
|
143
|
-
});
|
|
144
|
-
_this.token = token;
|
|
145
|
-
_this.name = _this.token.value;
|
|
146
|
-
return _this;
|
|
147
|
-
}
|
|
148
|
-
return _createClass(Twain);
|
|
149
|
-
}(_native["default"]);
|
|
150
|
-
var _default = Twain;
|
|
151
|
-
exports["default"] = _default;
|
package/build/Variable.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _native = _interopRequireDefault(require("./native"));
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
"default": e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function _typeof(o) {
|
|
14
|
-
"@babel/helpers - typeof";
|
|
15
|
-
|
|
16
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17
|
-
return typeof o;
|
|
18
|
-
} : function (o) {
|
|
19
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20
|
-
}, _typeof(o);
|
|
21
|
-
}
|
|
22
|
-
function _defineProperties(e, r) {
|
|
23
|
-
for (var t = 0; t < r.length; t++) {
|
|
24
|
-
var o = r[t];
|
|
25
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _createClass(e, r, t) {
|
|
29
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
30
|
-
writable: !1
|
|
31
|
-
}), e;
|
|
32
|
-
}
|
|
33
|
-
function _classCallCheck(a, n) {
|
|
34
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
35
|
-
}
|
|
36
|
-
function _inherits(t, e) {
|
|
37
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
38
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
39
|
-
constructor: {
|
|
40
|
-
value: t,
|
|
41
|
-
writable: !0,
|
|
42
|
-
configurable: !0
|
|
43
|
-
}
|
|
44
|
-
}), Object.defineProperty(t, "prototype", {
|
|
45
|
-
writable: !1
|
|
46
|
-
}), e && _setPrototypeOf(t, e);
|
|
47
|
-
}
|
|
48
|
-
function _setPrototypeOf(t, e) {
|
|
49
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
50
|
-
return t.__proto__ = e, t;
|
|
51
|
-
}, _setPrototypeOf(t, e);
|
|
52
|
-
}
|
|
53
|
-
function _createSuper(t) {
|
|
54
|
-
var r = _isNativeReflectConstruct();
|
|
55
|
-
return function () {
|
|
56
|
-
var e,
|
|
57
|
-
o = _getPrototypeOf(t);
|
|
58
|
-
if (r) {
|
|
59
|
-
var s = _getPrototypeOf(this).constructor;
|
|
60
|
-
e = Reflect.construct(o, arguments, s);
|
|
61
|
-
} else e = o.apply(this, arguments);
|
|
62
|
-
return _possibleConstructorReturn(this, e);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function _possibleConstructorReturn(t, e) {
|
|
66
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
67
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
68
|
-
return _assertThisInitialized(t);
|
|
69
|
-
}
|
|
70
|
-
function _assertThisInitialized(e) {
|
|
71
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
72
|
-
return e;
|
|
73
|
-
}
|
|
74
|
-
function _isNativeReflectConstruct() {
|
|
75
|
-
try {
|
|
76
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
77
|
-
} catch (t) {}
|
|
78
|
-
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
79
|
-
return !!t;
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
82
|
-
function _getPrototypeOf(t) {
|
|
83
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
84
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
85
|
-
}, _getPrototypeOf(t);
|
|
86
|
-
}
|
|
87
|
-
function _defineProperty(e, r, t) {
|
|
88
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
89
|
-
value: t,
|
|
90
|
-
enumerable: !0,
|
|
91
|
-
configurable: !0,
|
|
92
|
-
writable: !0
|
|
93
|
-
}) : e[r] = t, e;
|
|
94
|
-
}
|
|
95
|
-
function _toPropertyKey(t) {
|
|
96
|
-
var i = _toPrimitive(t, "string");
|
|
97
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
98
|
-
}
|
|
99
|
-
function _toPrimitive(t, r) {
|
|
100
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
101
|
-
var e = t[Symbol.toPrimitive];
|
|
102
|
-
if (void 0 !== e) {
|
|
103
|
-
var i = e.call(t, r || "default");
|
|
104
|
-
if ("object" != _typeof(i)) return i;
|
|
105
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
106
|
-
}
|
|
107
|
-
return ("string" === r ? String : Number)(t);
|
|
108
|
-
}
|
|
109
|
-
var Variable = /*#__PURE__*/function (_Native) {
|
|
110
|
-
_inherits(Variable, _Native);
|
|
111
|
-
var _super = _createSuper(Variable);
|
|
112
|
-
function Variable(token) {
|
|
113
|
-
var _this;
|
|
114
|
-
_classCallCheck(this, Variable);
|
|
115
|
-
_this = _super.call(this);
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "assign", function (obj) {
|
|
117
|
-
_this.assign_obj = obj;
|
|
118
|
-
});
|
|
119
|
-
_defineProperty(_assertThisInitialized(_this), "generate_assembly", function (sequence) {
|
|
120
|
-
sequence.push(_this.declaration ? "link ".concat(_this.declaration.path) : "chain ".concat(_this.name));
|
|
121
|
-
if (_this.assign_obj) {
|
|
122
|
-
_this.assign_obj.generate_assembly(sequence);
|
|
123
|
-
sequence.push("cursor {output}");
|
|
124
|
-
sequence.push(!_this.token.compiler.datatypes.includes(_this.assign_obj.token.type) ? "write {metadata.output:-1}" : "write {datapath:-1}");
|
|
125
|
-
}
|
|
126
|
-
sequence.push("pop ".concat(_this.name));
|
|
127
|
-
});
|
|
128
|
-
_this.token = token;
|
|
129
|
-
_this.name = _this.token.value;
|
|
130
|
-
return _this;
|
|
131
|
-
}
|
|
132
|
-
return _createClass(Variable);
|
|
133
|
-
}(_native["default"]);
|
|
134
|
-
var _default = Variable;
|
|
135
|
-
exports["default"] = _default;
|
package/build/Virtual_machine.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _Opcodes2 = _interopRequireDefault(require("./Opcodes"));
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
"default": e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function _typeof(o) {
|
|
14
|
-
"@babel/helpers - typeof";
|
|
15
|
-
|
|
16
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17
|
-
return typeof o;
|
|
18
|
-
} : function (o) {
|
|
19
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20
|
-
}, _typeof(o);
|
|
21
|
-
}
|
|
22
|
-
function _defineProperties(e, r) {
|
|
23
|
-
for (var t = 0; t < r.length; t++) {
|
|
24
|
-
var o = r[t];
|
|
25
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _createClass(e, r, t) {
|
|
29
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
30
|
-
writable: !1
|
|
31
|
-
}), e;
|
|
32
|
-
}
|
|
33
|
-
function _classCallCheck(a, n) {
|
|
34
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
35
|
-
}
|
|
36
|
-
function _inherits(t, e) {
|
|
37
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
38
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
39
|
-
constructor: {
|
|
40
|
-
value: t,
|
|
41
|
-
writable: !0,
|
|
42
|
-
configurable: !0
|
|
43
|
-
}
|
|
44
|
-
}), Object.defineProperty(t, "prototype", {
|
|
45
|
-
writable: !1
|
|
46
|
-
}), e && _setPrototypeOf(t, e);
|
|
47
|
-
}
|
|
48
|
-
function _setPrototypeOf(t, e) {
|
|
49
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
50
|
-
return t.__proto__ = e, t;
|
|
51
|
-
}, _setPrototypeOf(t, e);
|
|
52
|
-
}
|
|
53
|
-
function _createSuper(t) {
|
|
54
|
-
var r = _isNativeReflectConstruct();
|
|
55
|
-
return function () {
|
|
56
|
-
var e,
|
|
57
|
-
o = _getPrototypeOf(t);
|
|
58
|
-
if (r) {
|
|
59
|
-
var s = _getPrototypeOf(this).constructor;
|
|
60
|
-
e = Reflect.construct(o, arguments, s);
|
|
61
|
-
} else e = o.apply(this, arguments);
|
|
62
|
-
return _possibleConstructorReturn(this, e);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function _possibleConstructorReturn(t, e) {
|
|
66
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
67
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
68
|
-
return _assertThisInitialized(t);
|
|
69
|
-
}
|
|
70
|
-
function _assertThisInitialized(e) {
|
|
71
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
72
|
-
return e;
|
|
73
|
-
}
|
|
74
|
-
function _isNativeReflectConstruct() {
|
|
75
|
-
try {
|
|
76
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
77
|
-
} catch (t) {}
|
|
78
|
-
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
79
|
-
return !!t;
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
82
|
-
function _getPrototypeOf(t) {
|
|
83
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
84
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
85
|
-
}, _getPrototypeOf(t);
|
|
86
|
-
}
|
|
87
|
-
function _defineProperty(e, r, t) {
|
|
88
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
89
|
-
value: t,
|
|
90
|
-
enumerable: !0,
|
|
91
|
-
configurable: !0,
|
|
92
|
-
writable: !0
|
|
93
|
-
}) : e[r] = t, e;
|
|
94
|
-
}
|
|
95
|
-
function _toPropertyKey(t) {
|
|
96
|
-
var i = _toPrimitive(t, "string");
|
|
97
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
98
|
-
}
|
|
99
|
-
function _toPrimitive(t, r) {
|
|
100
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
101
|
-
var e = t[Symbol.toPrimitive];
|
|
102
|
-
if (void 0 !== e) {
|
|
103
|
-
var i = e.call(t, r || "default");
|
|
104
|
-
if ("object" != _typeof(i)) return i;
|
|
105
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
106
|
-
}
|
|
107
|
-
return ("string" === r ? String : Number)(t);
|
|
108
|
-
}
|
|
109
|
-
var Virtual_machine = /*#__PURE__*/function (_Opcodes) {
|
|
110
|
-
_inherits(Virtual_machine, _Opcodes);
|
|
111
|
-
var _super = _createSuper(Virtual_machine);
|
|
112
|
-
function Virtual_machine(_context) {
|
|
113
|
-
var _this;
|
|
114
|
-
_classCallCheck(this, Virtual_machine);
|
|
115
|
-
_this = _super.call(this);
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "get_context", function (index) {
|
|
117
|
-
return _this.contexts.slice(index == null ? -1 : index)[0];
|
|
118
|
-
});
|
|
119
|
-
_defineProperty(_assertThisInitialized(_this), "parse_arg", function (arg, is_cursor) {
|
|
120
|
-
var context = _this.get_context();
|
|
121
|
-
var args = arg.split("/"),
|
|
122
|
-
i = 0;
|
|
123
|
-
while (args[0] === "..") {
|
|
124
|
-
i++;
|
|
125
|
-
args.splice(0, 1);
|
|
126
|
-
}
|
|
127
|
-
i = (i + 1) * -1;
|
|
128
|
-
context = i ? _this.get_context(i) : context;
|
|
129
|
-
arg = args.join("/");
|
|
130
|
-
while (arg.includes("^")) {
|
|
131
|
-
var blk = context.connections.slice(-1)[0];
|
|
132
|
-
if (!blk) break;
|
|
133
|
-
context = blk.chain;
|
|
134
|
-
var _i = arg.indexOf("^");
|
|
135
|
-
arg = "".concat(arg.slice(0, _i)).concat(arg.slice(_i + 1));
|
|
136
|
-
}
|
|
137
|
-
if (arg.startsWith("{*") && is_cursor) {
|
|
138
|
-
arg = context.explore(arg.slice(2, -1));
|
|
139
|
-
} else if (arg.startsWith("{") && !is_cursor) {
|
|
140
|
-
arg = context.explore(arg.slice(1, -1));
|
|
141
|
-
}
|
|
142
|
-
return arg;
|
|
143
|
-
});
|
|
144
|
-
_defineProperty(_assertThisInitialized(_this), "split_instruction", function (instruction) {
|
|
145
|
-
var split = instruction.split(" ");
|
|
146
|
-
var opcode = split[0],
|
|
147
|
-
args = split.slice(1).join(" ");
|
|
148
|
-
return {
|
|
149
|
-
opcode: opcode,
|
|
150
|
-
args: args
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
_defineProperty(_assertThisInitialized(_this), "run_traverse", function () {
|
|
154
|
-
if (!_this.running) return;
|
|
155
|
-
});
|
|
156
|
-
_defineProperty(_assertThisInitialized(_this), "execute", function (instruction, track) {
|
|
157
|
-
_this.track = track;
|
|
158
|
-
if (!instruction) return;
|
|
159
|
-
var _this$split_instructi = _this.split_instruction(instruction),
|
|
160
|
-
opcode = _this$split_instructi.opcode,
|
|
161
|
-
args = _this$split_instructi.args;
|
|
162
|
-
var context = _this.get_context();
|
|
163
|
-
if (!context) return;
|
|
164
|
-
context.add_tx(instruction);
|
|
165
|
-
var chain;
|
|
166
|
-
args = _this.parse_arg(args, opcode === "cursor");
|
|
167
|
-
switch (opcode) {
|
|
168
|
-
case "chain":
|
|
169
|
-
chain = context.account.add_chain(args, context);
|
|
170
|
-
_this.contexts.push(chain);
|
|
171
|
-
_this.run_traverse();
|
|
172
|
-
chain.append_buffer();
|
|
173
|
-
break;
|
|
174
|
-
case "link":
|
|
175
|
-
chain = context.account.manager.web.get(args);
|
|
176
|
-
var k = Object.keys(context.account.manager.web.physical_addresses);
|
|
177
|
-
if (!chain) {
|
|
178
|
-
console.log("LINKing Failed. - ".concat(args));
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
chain.append_buffer();
|
|
182
|
-
_this.contexts.push(chain);
|
|
183
|
-
_this.run_traverse();
|
|
184
|
-
break;
|
|
185
|
-
case "mine":
|
|
186
|
-
var bloc = context.mine(_assertThisInitialized(_this), true);
|
|
187
|
-
_this.account.buff(bloc, _this.track.pid);
|
|
188
|
-
break;
|
|
189
|
-
case "pop":
|
|
190
|
-
var blk;
|
|
191
|
-
if (context.txs.length > 1) {
|
|
192
|
-
blk = context.mine(_assertThisInitialized(_this));
|
|
193
|
-
} else {
|
|
194
|
-
blk = context.get_latest_block();
|
|
195
|
-
if (blk) _this.get_context(-2).connections.push(blk);
|
|
196
|
-
context.txs = [];
|
|
197
|
-
}
|
|
198
|
-
blk && _this.account.buff(blk, _this.track.pid);
|
|
199
|
-
_this.contexts.pop();
|
|
200
|
-
break;
|
|
201
|
-
case "cursor":
|
|
202
|
-
context.cursor = args;
|
|
203
|
-
break;
|
|
204
|
-
case "write":
|
|
205
|
-
context.account.write(args, context);
|
|
206
|
-
break;
|
|
207
|
-
default:
|
|
208
|
-
_this.prepare_operation(opcode, context);
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
_this.account = _context.account;
|
|
213
|
-
_this.contexts = [_context];
|
|
214
|
-
_this.stack = new Array();
|
|
215
|
-
return _this;
|
|
216
|
-
}
|
|
217
|
-
return _createClass(Virtual_machine);
|
|
218
|
-
}(_Opcodes2["default"]);
|
|
219
|
-
var _default = Virtual_machine;
|
|
220
|
-
exports["default"] = _default;
|
package/build/Void.js
DELETED
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _native = _interopRequireDefault(require("../native"));
|
|
8
|
-
function _interopRequireDefault(e) {
|
|
9
|
-
return e && e.__esModule ? e : {
|
|
10
|
-
"default": e
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function _typeof(o) {
|
|
14
|
-
"@babel/helpers - typeof";
|
|
15
|
-
|
|
16
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
17
|
-
return typeof o;
|
|
18
|
-
} : function (o) {
|
|
19
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
20
|
-
}, _typeof(o);
|
|
21
|
-
}
|
|
22
|
-
function _defineProperties(e, r) {
|
|
23
|
-
for (var t = 0; t < r.length; t++) {
|
|
24
|
-
var o = r[t];
|
|
25
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function _createClass(e, r, t) {
|
|
29
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
30
|
-
writable: !1
|
|
31
|
-
}), e;
|
|
32
|
-
}
|
|
33
|
-
function _classCallCheck(a, n) {
|
|
34
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
35
|
-
}
|
|
36
|
-
function _inherits(t, e) {
|
|
37
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
38
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
39
|
-
constructor: {
|
|
40
|
-
value: t,
|
|
41
|
-
writable: !0,
|
|
42
|
-
configurable: !0
|
|
43
|
-
}
|
|
44
|
-
}), Object.defineProperty(t, "prototype", {
|
|
45
|
-
writable: !1
|
|
46
|
-
}), e && _setPrototypeOf(t, e);
|
|
47
|
-
}
|
|
48
|
-
function _setPrototypeOf(t, e) {
|
|
49
|
-
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
50
|
-
return t.__proto__ = e, t;
|
|
51
|
-
}, _setPrototypeOf(t, e);
|
|
52
|
-
}
|
|
53
|
-
function _createSuper(t) {
|
|
54
|
-
var r = _isNativeReflectConstruct();
|
|
55
|
-
return function () {
|
|
56
|
-
var e,
|
|
57
|
-
o = _getPrototypeOf(t);
|
|
58
|
-
if (r) {
|
|
59
|
-
var s = _getPrototypeOf(this).constructor;
|
|
60
|
-
e = Reflect.construct(o, arguments, s);
|
|
61
|
-
} else e = o.apply(this, arguments);
|
|
62
|
-
return _possibleConstructorReturn(this, e);
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function _possibleConstructorReturn(t, e) {
|
|
66
|
-
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
|
|
67
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
68
|
-
return _assertThisInitialized(t);
|
|
69
|
-
}
|
|
70
|
-
function _assertThisInitialized(e) {
|
|
71
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
72
|
-
return e;
|
|
73
|
-
}
|
|
74
|
-
function _isNativeReflectConstruct() {
|
|
75
|
-
try {
|
|
76
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
77
|
-
} catch (t) {}
|
|
78
|
-
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
79
|
-
return !!t;
|
|
80
|
-
})();
|
|
81
|
-
}
|
|
82
|
-
function _getPrototypeOf(t) {
|
|
83
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
84
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
85
|
-
}, _getPrototypeOf(t);
|
|
86
|
-
}
|
|
87
|
-
function _defineProperty(e, r, t) {
|
|
88
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
89
|
-
value: t,
|
|
90
|
-
enumerable: !0,
|
|
91
|
-
configurable: !0,
|
|
92
|
-
writable: !0
|
|
93
|
-
}) : e[r] = t, e;
|
|
94
|
-
}
|
|
95
|
-
function _toPropertyKey(t) {
|
|
96
|
-
var i = _toPrimitive(t, "string");
|
|
97
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
98
|
-
}
|
|
99
|
-
function _toPrimitive(t, r) {
|
|
100
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
101
|
-
var e = t[Symbol.toPrimitive];
|
|
102
|
-
if (void 0 !== e) {
|
|
103
|
-
var i = e.call(t, r || "default");
|
|
104
|
-
if ("object" != _typeof(i)) return i;
|
|
105
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
106
|
-
}
|
|
107
|
-
return ("string" === r ? String : Number)(t);
|
|
108
|
-
}
|
|
109
|
-
var Void = /*#__PURE__*/function (_Native) {
|
|
110
|
-
_inherits(Void, _Native);
|
|
111
|
-
var _super = _createSuper(Void);
|
|
112
|
-
function Void(token) {
|
|
113
|
-
var _this;
|
|
114
|
-
_classCallCheck(this, Void);
|
|
115
|
-
_this = _super.call(this);
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "generate_assembly", function (sequence) {
|
|
117
|
-
sequence.push("link ".concat(_this.token.compiler.account.physical_address, "/Datatypes/Void"));
|
|
118
|
-
sequence.push("write ".concat(_this.name));
|
|
119
|
-
sequence.push("pop Datatypes/Void");
|
|
120
|
-
});
|
|
121
|
-
_this.token = token;
|
|
122
|
-
_this.name = _this.token.value;
|
|
123
|
-
return _this;
|
|
124
|
-
}
|
|
125
|
-
return _createClass(Void);
|
|
126
|
-
}(_native["default"]);
|
|
127
|
-
var _default = Void;
|
|
128
|
-
exports["default"] = _default;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
13
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
|
-
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
18
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
|
-
var Tree_node = /*#__PURE__*/_createClass(function Tree_node(value) {
|
|
21
|
-
var _this = this;
|
|
22
|
-
_classCallCheck(this, Tree_node);
|
|
23
|
-
_defineProperty(this, "add_child", function (childNode) {
|
|
24
|
-
_this.children.push(childNode);
|
|
25
|
-
});
|
|
26
|
-
this.value = value;
|
|
27
|
-
this.children = [];
|
|
28
|
-
});
|
|
29
|
-
var format_instructions = function format_instructions(instructions, no) {
|
|
30
|
-
if (no) return instructions;
|
|
31
|
-
var root = new Tree_node("air");
|
|
32
|
-
var current = root;
|
|
33
|
-
var node_stack = [];
|
|
34
|
-
instructions.forEach(function (instruction) {
|
|
35
|
-
var _instruction$split = instruction.split(" ", 2),
|
|
36
|
-
_instruction$split2 = _slicedToArray(_instruction$split, 2),
|
|
37
|
-
opcode = _instruction$split2[0],
|
|
38
|
-
operand = _instruction$split2[1];
|
|
39
|
-
if (opcode === "chain" || opcode === "link") {
|
|
40
|
-
var new_node = new Tree_node(instruction);
|
|
41
|
-
current.add_child(new_node);
|
|
42
|
-
node_stack.push(current);
|
|
43
|
-
current = new_node;
|
|
44
|
-
} else if (opcode === "pop") {
|
|
45
|
-
current.add_child(instruction);
|
|
46
|
-
current = node_stack.pop();
|
|
47
|
-
} else current.add_child(instruction);
|
|
48
|
-
});
|
|
49
|
-
return JSON.stringify(root, null, 2);
|
|
50
|
-
};
|
|
51
|
-
var _default = format_instructions;
|
|
52
|
-
exports["default"] = _default;
|