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/framer.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _Frame = _interopRequireDefault(require("./Objects/Frame"));
|
|
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 _defineProperty(e, r, t) {
|
|
23
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
24
|
-
value: t,
|
|
25
|
-
enumerable: !0,
|
|
26
|
-
configurable: !0,
|
|
27
|
-
writable: !0
|
|
28
|
-
}) : e[r] = t, e;
|
|
29
|
-
}
|
|
30
|
-
function _toPropertyKey(t) {
|
|
31
|
-
var i = _toPrimitive(t, "string");
|
|
32
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
33
|
-
}
|
|
34
|
-
function _toPrimitive(t, r) {
|
|
35
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
36
|
-
var e = t[Symbol.toPrimitive];
|
|
37
|
-
if (void 0 !== e) {
|
|
38
|
-
var i = e.call(t, r || "default");
|
|
39
|
-
if ("object" != _typeof(i)) return i;
|
|
40
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
41
|
-
}
|
|
42
|
-
return ("string" === r ? String : Number)(t);
|
|
43
|
-
}
|
|
44
|
-
var framer = function framer(initiator) {
|
|
45
|
-
var _Opcodes;
|
|
46
|
-
var frame = new _Frame["default"]({
|
|
47
|
-
Opcodes: (_Opcodes = {
|
|
48
|
-
add: null,
|
|
49
|
-
equal: null,
|
|
50
|
-
multiply: null,
|
|
51
|
-
subtract: null,
|
|
52
|
-
divide: null,
|
|
53
|
-
exp: null
|
|
54
|
-
}, _defineProperty(_Opcodes, "equal", null), _defineProperty(_Opcodes, "not_equal", null), _defineProperty(_Opcodes, "greater_than", null), _defineProperty(_Opcodes, "less_than", null), _defineProperty(_Opcodes, "gte", null), _defineProperty(_Opcodes, "lte", null), _defineProperty(_Opcodes, "send", null), _defineProperty(_Opcodes, "readonly", null), _defineProperty(_Opcodes, "socket_send", null), _defineProperty(_Opcodes, "jmp", null), _defineProperty(_Opcodes, "jmp_if", null), _defineProperty(_Opcodes, "hold", null), _defineProperty(_Opcodes, "stdout", null), _defineProperty(_Opcodes, "stdin", null), _Opcodes),
|
|
55
|
-
Datatypes: {
|
|
56
|
-
Number: null,
|
|
57
|
-
String: null,
|
|
58
|
-
Twain: null,
|
|
59
|
-
Array: null,
|
|
60
|
-
Void: null,
|
|
61
|
-
Boolean: null
|
|
62
|
-
},
|
|
63
|
-
Objects: {
|
|
64
|
-
Blockchain: {
|
|
65
|
-
Chain: null,
|
|
66
|
-
Block: null
|
|
67
|
-
},
|
|
68
|
-
Folder: {
|
|
69
|
-
active_file: null,
|
|
70
|
-
folder: null,
|
|
71
|
-
file: null
|
|
72
|
-
},
|
|
73
|
-
File: {
|
|
74
|
-
row: null,
|
|
75
|
-
parse: null,
|
|
76
|
-
column: null,
|
|
77
|
-
write: null
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
frame.to_instruction();
|
|
82
|
-
var instructions = frame.flatten_instructions();
|
|
83
|
-
initiator.load({
|
|
84
|
-
program: {
|
|
85
|
-
instructions: instructions
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
};
|
|
89
|
-
var _default = framer;
|
|
90
|
-
exports["default"] = _default;
|
package/build/global.js
DELETED
|
@@ -1,134 +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 Global = /*#__PURE__*/function (_Native) {
|
|
110
|
-
_inherits(Global, _Native);
|
|
111
|
-
var _super = _createSuper(Global);
|
|
112
|
-
function Global(compiler) {
|
|
113
|
-
var _this;
|
|
114
|
-
_classCallCheck(this, Global);
|
|
115
|
-
_this = _super.call(this);
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "generate_assembly", function (sequence) {
|
|
117
|
-
// sequence.push(`chain ${this.name}`);
|
|
118
|
-
|
|
119
|
-
_this.children.map(function (c) {
|
|
120
|
-
return c.generate_assembly(sequence);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
// sequence.push(`pop ${this.name}`);
|
|
124
|
-
});
|
|
125
|
-
_this.is_global = true;
|
|
126
|
-
_this.compiler = compiler;
|
|
127
|
-
_this.name = _this.compiler.name;
|
|
128
|
-
_this.path = _this.compiler.account.physical_address;
|
|
129
|
-
return _this;
|
|
130
|
-
}
|
|
131
|
-
return _createClass(Global);
|
|
132
|
-
}(_native["default"]);
|
|
133
|
-
var _default = Global;
|
|
134
|
-
exports["default"] = _default;
|
package/build/main.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _parse_to_obj = _interopRequireDefault(require("./functions/parse_to_obj"));
|
|
8
|
-
var _tokenise = _interopRequireDefault(require("./functions/tokenise"));
|
|
9
|
-
var _global = _interopRequireDefault(require("./native_classes/global"));
|
|
10
|
-
var _format_instructions = _interopRequireDefault(require("./utils/format_instructions"));
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
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); }
|
|
13
|
-
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); } }
|
|
14
|
-
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
15
|
-
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
-
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; }
|
|
17
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
|
-
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); }
|
|
19
|
-
var Loader_sequence = /*#__PURE__*/_createClass(function Loader_sequence(account) {
|
|
20
|
-
var _this = this;
|
|
21
|
-
_classCallCheck(this, Loader_sequence);
|
|
22
|
-
_defineProperty(this, "curr_namespace", function () {
|
|
23
|
-
return _this.namestack.slice(-1)[0];
|
|
24
|
-
});
|
|
25
|
-
_defineProperty(this, "tokenise", function (code) {
|
|
26
|
-
_this.tokens = (0, _tokenise["default"])(code, null, _this);
|
|
27
|
-
});
|
|
28
|
-
_defineProperty(this, "parse", function (tokens, stop_token) {
|
|
29
|
-
tokens = tokens || _this.tokens;
|
|
30
|
-
var pos = 0,
|
|
31
|
-
recent_token;
|
|
32
|
-
while (pos < tokens.length) {
|
|
33
|
-
var token = tokens[pos];
|
|
34
|
-
if (stop_token) {
|
|
35
|
-
if (token.type === stop_token.type && token.value === stop_token.value) break;
|
|
36
|
-
}
|
|
37
|
-
if (recent_token && token.pos === recent_token.pos) throw new Error("Token recursion: ".concat(token.pos, ", ").concat(token.col, ", ").concat(token.value));
|
|
38
|
-
recent_token = token;
|
|
39
|
-
var curr_obj = _this.curr_namespace();
|
|
40
|
-
var token_obj = (0, _parse_to_obj["default"])(token, curr_obj, {
|
|
41
|
-
tokens: tokens,
|
|
42
|
-
pos: pos
|
|
43
|
-
});
|
|
44
|
-
curr_obj.children.push(token_obj);
|
|
45
|
-
var greeds = token_obj.greedy(tokens.slice(pos));
|
|
46
|
-
curr_obj.children.splice(-1);
|
|
47
|
-
curr_obj.push(greeds.obj);
|
|
48
|
-
pos += greeds.pos;
|
|
49
|
-
}
|
|
50
|
-
stop_token && _this.namestack.pop();
|
|
51
|
-
return {
|
|
52
|
-
pos: pos
|
|
53
|
-
};
|
|
54
|
-
});
|
|
55
|
-
_defineProperty(this, "compile", function (obj) {
|
|
56
|
-
obj = obj || _this.globe;
|
|
57
|
-
var instructions = new Array();
|
|
58
|
-
obj.generate_assembly(instructions);
|
|
59
|
-
obj.children = [];
|
|
60
|
-
return (0, _format_instructions["default"])(instructions, 1);
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(this, "run", function (code, cb, no_run) {
|
|
63
|
-
_this.tokenise(code);
|
|
64
|
-
_this.parse();
|
|
65
|
-
var payload = {
|
|
66
|
-
program: {
|
|
67
|
-
instructions: _this.compile()
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
!no_run && _this.account.load(payload, cb);
|
|
71
|
-
// console.log(payload.instructions, "hiya");
|
|
72
|
-
});
|
|
73
|
-
this.account = account;
|
|
74
|
-
this.name = this.account.name;
|
|
75
|
-
this.globe = new _global["default"](this);
|
|
76
|
-
this.namestack = new Array(this.globe);
|
|
77
|
-
this.expr_types = ["number", "string", "twain", "array", "boolean", "variable"];
|
|
78
|
-
this.datatypes = ["array", "string", "number", "boolean", "twain", "void"];
|
|
79
|
-
this.open_parens = "([{";
|
|
80
|
-
this.close_parens = ")]}";
|
|
81
|
-
});
|
|
82
|
-
var _default = Loader_sequence;
|
|
83
|
-
exports["default"] = _default;
|
package/build/native.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _parse_expression3 = require("../functions/parse_expression");
|
|
8
|
-
function _typeof(o) {
|
|
9
|
-
"@babel/helpers - typeof";
|
|
10
|
-
|
|
11
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
12
|
-
return typeof o;
|
|
13
|
-
} : function (o) {
|
|
14
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
15
|
-
}, _typeof(o);
|
|
16
|
-
}
|
|
17
|
-
function _defineProperties(e, r) {
|
|
18
|
-
for (var t = 0; t < r.length; t++) {
|
|
19
|
-
var o = r[t];
|
|
20
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function _createClass(e, r, t) {
|
|
24
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
25
|
-
writable: !1
|
|
26
|
-
}), e;
|
|
27
|
-
}
|
|
28
|
-
function _classCallCheck(a, n) {
|
|
29
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
30
|
-
}
|
|
31
|
-
function _defineProperty(e, r, t) {
|
|
32
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
33
|
-
value: t,
|
|
34
|
-
enumerable: !0,
|
|
35
|
-
configurable: !0,
|
|
36
|
-
writable: !0
|
|
37
|
-
}) : e[r] = t, e;
|
|
38
|
-
}
|
|
39
|
-
function _toPropertyKey(t) {
|
|
40
|
-
var i = _toPrimitive(t, "string");
|
|
41
|
-
return "symbol" == _typeof(i) ? i : i + "";
|
|
42
|
-
}
|
|
43
|
-
function _toPrimitive(t, r) {
|
|
44
|
-
if ("object" != _typeof(t) || !t) return t;
|
|
45
|
-
var e = t[Symbol.toPrimitive];
|
|
46
|
-
if (void 0 !== e) {
|
|
47
|
-
var i = e.call(t, r || "default");
|
|
48
|
-
if ("object" != _typeof(i)) return i;
|
|
49
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
50
|
-
}
|
|
51
|
-
return ("string" === r ? String : Number)(t);
|
|
52
|
-
}
|
|
53
|
-
var Native = /*#__PURE__*/_createClass(function Native() {
|
|
54
|
-
var _this = this;
|
|
55
|
-
_classCallCheck(this, Native);
|
|
56
|
-
_defineProperty(this, "find", function (obj) {
|
|
57
|
-
for (var c = 0; c < _this.children.length; c++) {
|
|
58
|
-
var child = _this.children[c];
|
|
59
|
-
if (child.token.value === obj.token.value && child.token.type === "variable") {
|
|
60
|
-
return child;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return _this.parent ? _this.parent.find(obj) : null;
|
|
64
|
-
});
|
|
65
|
-
_defineProperty(this, "greedy", function (tokens) {
|
|
66
|
-
var pos = 0,
|
|
67
|
-
obj;
|
|
68
|
-
if (_this.token.compiler.expr_types.includes(_this.token.type)) {
|
|
69
|
-
var _parse_expression = (0, _parse_expression3.parse_expression)(tokens.slice(pos + 1), _this, true),
|
|
70
|
-
obj_ = _parse_expression.obj,
|
|
71
|
-
pos_ = _parse_expression.pos;
|
|
72
|
-
obj = obj_;
|
|
73
|
-
pos += pos_;
|
|
74
|
-
} else if (_this.token.type === "keyword") {
|
|
75
|
-
if (["parse", "return"].includes(_this.token.value)) {
|
|
76
|
-
var _parse_expression2 = (0, _parse_expression3.parse_expression)(tokens.slice(pos + 1), _this),
|
|
77
|
-
_obj = _parse_expression2.obj,
|
|
78
|
-
_pos_ = _parse_expression2.pos;
|
|
79
|
-
_this.push(_obj);
|
|
80
|
-
pos += _pos_ + 1;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return {
|
|
84
|
-
obj: obj || _this,
|
|
85
|
-
pos: pos
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
_defineProperty(this, "set_parent", function (parent) {
|
|
89
|
-
_this.parent = parent;
|
|
90
|
-
_this.path = "".concat(_this.parent.path, "/").concat(_this.name);
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(this, "push", function (obj) {
|
|
93
|
-
if (!obj) return;
|
|
94
|
-
_this.children.push(obj);
|
|
95
|
-
if (obj.set_parent) obj.set_parent(_this);
|
|
96
|
-
});
|
|
97
|
-
this._id = Math.random();
|
|
98
|
-
this.children = new Array();
|
|
99
|
-
});
|
|
100
|
-
var _default = Native;
|
|
101
|
-
exports["default"] = _default;
|
package/build/operators.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.op_to_name = 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 op_to_name = {
|
|
110
|
-
"+": "add",
|
|
111
|
-
"-": "subtract",
|
|
112
|
-
"/": "divide",
|
|
113
|
-
"*": "multiply",
|
|
114
|
-
"=": "assign"
|
|
115
|
-
};
|
|
116
|
-
exports.op_to_name = op_to_name;
|
|
117
|
-
var Operator = /*#__PURE__*/function (_Native) {
|
|
118
|
-
_inherits(Operator, _Native);
|
|
119
|
-
var _super = _createSuper(Operator);
|
|
120
|
-
function Operator(token) {
|
|
121
|
-
var _this;
|
|
122
|
-
_classCallCheck(this, Operator);
|
|
123
|
-
_this = _super.call(this);
|
|
124
|
-
_defineProperty(_assertThisInitialized(_this), "generate_assembly", function (sequence) {
|
|
125
|
-
sequence.push("link ".concat(_this.token.compiler.account.physical_address, "/Opcodes/").concat(_this.name));
|
|
126
|
-
sequence.push("link ".concat(_this.token.compiler.account.physical_address, "/Datatypes/Twain"));
|
|
127
|
-
for (var c = 0; c < _this.children.length; c++) {
|
|
128
|
-
var child = _this.children[c];
|
|
129
|
-
child.generate_assembly(sequence);
|
|
130
|
-
sequence.push("cursor op".concat(c));
|
|
131
|
-
sequence.push("write {".concat(_this.token.compiler.datatypes.includes(child.token.type) ? "datapath" : "metadata.output", ":-1}"));
|
|
132
|
-
}
|
|
133
|
-
sequence.push("pop");
|
|
134
|
-
sequence.push("link ".concat(_this.token.compiler.account.physical_address, "/Datatypes/Twain"));
|
|
135
|
-
sequence.push("cursor inputs");
|
|
136
|
-
sequence.push("write ../{datapath:-1}");
|
|
137
|
-
sequence.push(_this.name);
|
|
138
|
-
sequence.push("pop ".concat(_this.token.compiler.account.physical_address, "/Datatypes/Twain"));
|
|
139
|
-
sequence.push("cursor {output}");
|
|
140
|
-
sequence.push("write ^{datapath:-1}");
|
|
141
|
-
sequence.push("pop Opcodes/".concat(_this.name));
|
|
142
|
-
});
|
|
143
|
-
_this.token = token;
|
|
144
|
-
_this.name = op_to_name[_this.token.value];
|
|
145
|
-
return _this;
|
|
146
|
-
}
|
|
147
|
-
return _createClass(Operator);
|
|
148
|
-
}(_native["default"]);
|
|
149
|
-
var _default = Operator;
|
|
150
|
-
exports["default"] = _default;
|