@famibee/skynovel 1.65.0 → 2.0.1

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.
Files changed (176) hide show
  1. package/README.md +3 -3
  2. package/dist/Button.js +131 -163
  3. package/dist/Button.js.map +1 -1
  4. package/dist/CallStack.js +19 -22
  5. package/dist/CallStack.js.map +1 -1
  6. package/dist/CmnInterface.js +91 -0
  7. package/dist/CmnInterface.js.map +1 -0
  8. package/dist/CmnLib.js +94 -0
  9. package/dist/CmnLib.js.map +1 -0
  10. package/dist/Config.js +26 -0
  11. package/dist/Config.js.map +1 -0
  12. package/dist/ConfigBase.js +152 -0
  13. package/dist/ConfigBase.js.map +1 -0
  14. package/dist/DebugMng.js +89 -102
  15. package/dist/DebugMng.js.map +1 -1
  16. package/dist/EventListenerCtn.js +21 -0
  17. package/dist/EventListenerCtn.js.map +1 -0
  18. package/dist/EventMng.js +1435 -1577
  19. package/dist/EventMng.js.map +1 -1
  20. package/dist/Grammar.js +194 -0
  21. package/dist/Grammar.js.map +1 -0
  22. package/dist/GrpLayer.js +163 -195
  23. package/dist/GrpLayer.js.map +1 -1
  24. package/dist/Layer.js +260 -0
  25. package/dist/Layer.js.map +1 -0
  26. package/dist/LayerMng.js +810 -991
  27. package/dist/LayerMng.js.map +1 -1
  28. package/dist/Main.js +144 -393
  29. package/dist/Main.js.map +1 -1
  30. package/dist/PropParser.js +936 -834
  31. package/dist/PropParser.js.map +1 -1
  32. package/dist/Reading.js +917 -786
  33. package/dist/Reading.js.map +1 -1
  34. package/dist/RubySpliter.js +59 -92
  35. package/dist/RubySpliter.js.map +1 -1
  36. package/dist/ScriptIterator.js +805 -1034
  37. package/dist/ScriptIterator.js.map +1 -1
  38. package/dist/SndBuf.js +1097 -1332
  39. package/dist/SndBuf.js.map +1 -1
  40. package/dist/SoundMng.js +124 -135
  41. package/dist/SoundMng.js.map +1 -1
  42. package/dist/SpritesMng.js +220 -232
  43. package/dist/SpritesMng.js.map +1 -1
  44. package/dist/SysBase.js +1729 -0
  45. package/dist/SysBase.js.map +1 -0
  46. package/dist/TxtLayer.js +1212 -1397
  47. package/dist/TxtLayer.js.map +1 -1
  48. package/dist/Variable.js +398 -466
  49. package/dist/Variable.js.map +1 -1
  50. package/dist/chunk.js +18 -0
  51. package/dist/gamepad.js +723 -511
  52. package/dist/gamepad.js.map +1 -1
  53. package/dist/pixi.js +13422 -0
  54. package/dist/pixi.js.map +1 -0
  55. package/dist/platform.js +424 -369
  56. package/dist/platform.js.map +1 -1
  57. package/dist/sn/AnalyzeTagArg.d.ts +1 -1
  58. package/dist/sn/AnalyzeTagArg.d.ts.map +1 -1
  59. package/dist/sn/CmnInterface.d.ts +3 -1
  60. package/dist/sn/CmnInterface.d.ts.map +1 -1
  61. package/dist/sn/CmnLib.d.ts.map +1 -1
  62. package/dist/sn/CmnTween.d.ts +3 -3
  63. package/dist/sn/CmnTween.d.ts.map +1 -1
  64. package/dist/sn/EventMng.d.ts.map +1 -1
  65. package/dist/sn/Grammar.d.ts +1 -1
  66. package/dist/sn/Grammar.d.ts.map +1 -1
  67. package/dist/sn/PropParser.d.ts +2 -2
  68. package/dist/sn/PropParser.d.ts.map +1 -1
  69. package/dist/sn/Reading.d.ts +6 -0
  70. package/dist/sn/Reading.d.ts.map +1 -1
  71. package/dist/sn/ScriptIterator.d.ts.map +1 -1
  72. package/dist/sn/SndBuf.d.ts +27 -16
  73. package/dist/sn/SndBuf.d.ts.map +1 -1
  74. package/dist/sn/SoundMng.d.ts +4 -1
  75. package/dist/sn/SoundMng.d.ts.map +1 -1
  76. package/dist/sn/SysBase.d.ts.map +1 -1
  77. package/dist/sn/TxtStage.d.ts +2 -1
  78. package/dist/sn/TxtStage.d.ts.map +1 -1
  79. package/dist/test/ValTest.d.ts +1 -1
  80. package/dist/test/ValTest.d.ts.map +1 -1
  81. package/dist/web.js +653 -8
  82. package/dist/web.js.map +1 -1
  83. package/dist_app/Button.js +131 -163
  84. package/dist_app/Button.js.map +1 -1
  85. package/dist_app/CallStack.js +19 -22
  86. package/dist_app/CallStack.js.map +1 -1
  87. package/dist_app/CmnInterface.js +91 -0
  88. package/dist_app/CmnInterface.js.map +1 -0
  89. package/dist_app/CmnLib.js +94 -0
  90. package/dist_app/CmnLib.js.map +1 -0
  91. package/dist_app/Config.js +26 -0
  92. package/dist_app/Config.js.map +1 -0
  93. package/dist_app/ConfigBase.js +152 -0
  94. package/dist_app/ConfigBase.js.map +1 -0
  95. package/dist_app/DebugMng.js +92 -0
  96. package/dist_app/DebugMng.js.map +1 -0
  97. package/dist_app/EventListenerCtn.js +21 -0
  98. package/dist_app/EventListenerCtn.js.map +1 -0
  99. package/dist_app/EventMng.js +1435 -1577
  100. package/dist_app/EventMng.js.map +1 -1
  101. package/dist_app/Grammar.js +194 -0
  102. package/dist_app/Grammar.js.map +1 -0
  103. package/dist_app/GrpLayer.js +163 -195
  104. package/dist_app/GrpLayer.js.map +1 -1
  105. package/dist_app/Layer.js +260 -0
  106. package/dist_app/Layer.js.map +1 -0
  107. package/dist_app/LayerMng.js +810 -991
  108. package/dist_app/LayerMng.js.map +1 -1
  109. package/dist_app/Main.js +144 -392
  110. package/dist_app/Main.js.map +1 -1
  111. package/dist_app/PropParser.js +936 -834
  112. package/dist_app/PropParser.js.map +1 -1
  113. package/dist_app/Reading.js +917 -786
  114. package/dist_app/Reading.js.map +1 -1
  115. package/dist_app/RubySpliter.js +59 -92
  116. package/dist_app/RubySpliter.js.map +1 -1
  117. package/dist_app/ScriptIterator.js +805 -1033
  118. package/dist_app/ScriptIterator.js.map +1 -1
  119. package/dist_app/SndBuf.js +1097 -1332
  120. package/dist_app/SndBuf.js.map +1 -1
  121. package/dist_app/SoundMng.js +124 -135
  122. package/dist_app/SoundMng.js.map +1 -1
  123. package/dist_app/SpritesMng.js +220 -231
  124. package/dist_app/SpritesMng.js.map +1 -1
  125. package/dist_app/SysBase.js +1729 -0
  126. package/dist_app/SysBase.js.map +1 -0
  127. package/dist_app/TxtLayer.js +1212 -1396
  128. package/dist_app/TxtLayer.js.map +1 -1
  129. package/dist_app/Variable.js +398 -466
  130. package/dist_app/Variable.js.map +1 -1
  131. package/dist_app/app.js +211 -8
  132. package/dist_app/app.js.map +1 -1
  133. package/dist_app/appMain.js +20 -21
  134. package/dist_app/appMain.js.map +1 -1
  135. package/dist_app/chunk.js +18 -0
  136. package/dist_app/gamepad.js +723 -511
  137. package/dist_app/gamepad.js.map +1 -1
  138. package/dist_app/pixi.js +11181 -0
  139. package/dist_app/pixi.js.map +1 -0
  140. package/dist_app/platform.js +424 -369
  141. package/dist_app/platform.js.map +1 -1
  142. package/dist_app/preload.js +2 -2
  143. package/dist_app/preload.js.map +1 -1
  144. package/dist_app/sn/AnalyzeTagArg.d.ts +1 -1
  145. package/dist_app/sn/AnalyzeTagArg.d.ts.map +1 -1
  146. package/dist_app/sn/CmnInterface.d.ts +3 -1
  147. package/dist_app/sn/CmnInterface.d.ts.map +1 -1
  148. package/dist_app/sn/CmnLib.d.ts.map +1 -1
  149. package/dist_app/sn/CmnTween.d.ts +3 -3
  150. package/dist_app/sn/CmnTween.d.ts.map +1 -1
  151. package/dist_app/sn/EventMng.d.ts.map +1 -1
  152. package/dist_app/sn/Grammar.d.ts +1 -1
  153. package/dist_app/sn/Grammar.d.ts.map +1 -1
  154. package/dist_app/sn/PropParser.d.ts +2 -2
  155. package/dist_app/sn/PropParser.d.ts.map +1 -1
  156. package/dist_app/sn/Reading.d.ts +6 -0
  157. package/dist_app/sn/Reading.d.ts.map +1 -1
  158. package/dist_app/sn/ScriptIterator.d.ts.map +1 -1
  159. package/dist_app/sn/SndBuf.d.ts +27 -16
  160. package/dist_app/sn/SndBuf.d.ts.map +1 -1
  161. package/dist_app/sn/SoundMng.d.ts +4 -1
  162. package/dist_app/sn/SoundMng.d.ts.map +1 -1
  163. package/dist_app/sn/SysBase.d.ts.map +1 -1
  164. package/dist_app/sn/TxtStage.d.ts +2 -1
  165. package/dist_app/sn/TxtStage.d.ts.map +1 -1
  166. package/dist_app/test/ValTest.d.ts +1 -1
  167. package/dist_app/test/ValTest.d.ts.map +1 -1
  168. package/package.json +23 -13
  169. package/dist/CmnTween.js +0 -1005
  170. package/dist/CmnTween.js.map +0 -1
  171. package/dist/web2.js +0 -21644
  172. package/dist/web2.js.map +0 -1
  173. package/dist_app/CmnTween.js +0 -1005
  174. package/dist_app/CmnTween.js.map +0 -1
  175. package/dist_app/app2.js +0 -18547
  176. package/dist_app/app2.js.map +0 -1
@@ -1,835 +1,937 @@
1
- import { i as dt } from "./app2.js";
2
- var lt = { exports: {} }, Ht = lt.exports, Lt;
3
- function Xt() {
4
- return Lt || (Lt = 1, function(At, e) {
5
- (function(c, l) {
6
- At.exports = l();
7
- })(typeof self < "u" ? self : Ht, function() {
8
- return function(c) {
9
- var l = {};
10
- function p(o) {
11
- if (l[o]) return l[o].exports;
12
- var f = l[o] = { i: o, l: !1, exports: {} };
13
- return c[o].call(f.exports, f, f.exports, p), f.l = !0, f.exports;
14
- }
15
- return p.m = c, p.c = l, p.d = function(o, f, I) {
16
- p.o(o, f) || Object.defineProperty(o, f, { configurable: !1, enumerable: !0, get: I });
17
- }, p.r = function(o) {
18
- Object.defineProperty(o, "__esModule", { value: !0 });
19
- }, p.n = function(o) {
20
- var f = o && o.__esModule ? function() {
21
- return o.default;
22
- } : function() {
23
- return o;
24
- };
25
- return p.d(f, "a", f), f;
26
- }, p.o = function(o, f) {
27
- return Object.prototype.hasOwnProperty.call(o, f);
28
- }, p.p = "", p(p.s = 0);
29
- }([function(c, l, p) {
30
- function o(t) {
31
- if (!(this instanceof o)) return new o(t);
32
- this._ = t;
33
- }
34
- var f = o.prototype;
35
- function I(t, r) {
36
- for (var n = 0; n < t; n++) r(n);
37
- }
38
- function x(t, r, n) {
39
- return function(i, u) {
40
- I(u.length, function(s) {
41
- i(u[s], s, u);
42
- });
43
- }(function(i, u, s) {
44
- r = t(r, i, u, s);
45
- }, n), r;
46
- }
47
- function O(t, r) {
48
- return x(function(n, i, u, s) {
49
- return n.concat([t(i, u, s)]);
50
- }, [], r);
51
- }
52
- function ht(t, r) {
53
- var n = { v: 0, buf: r };
54
- return I(t, function() {
55
- var i;
56
- n = { v: n.v << 1 | (i = n.buf, i[0] >> 7), buf: function(u) {
57
- var s = x(function(a, h, v, S) {
58
- return a.concat(v === S.length - 1 ? Buffer.from([h, 0]).readUInt16BE(0) : S.readUInt16BE(v));
59
- }, [], u);
60
- return Buffer.from(O(function(a) {
61
- return (a << 1 & 65535) >> 8;
62
- }, s));
63
- }(n.buf) };
64
- }), n;
65
- }
66
- function tt() {
67
- return typeof Buffer < "u";
68
- }
69
- function D() {
70
- if (!tt()) throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.");
71
- }
72
- function rt(t) {
73
- D();
74
- var r = x(function(s, a) {
75
- return s + a;
76
- }, 0, t);
77
- if (r % 8 != 0) throw new Error("The bits [" + t.join(", ") + "] add up to " + r + " which is not an even number of bytes; the total should be divisible by 8");
78
- var n, i = r / 8, u = (n = function(s) {
79
- return s > 48;
80
- }, x(function(s, a) {
81
- return s || (n(a) ? a : s);
82
- }, null, t));
83
- if (u) throw new Error(u + " bit range requested exceeds 48 bit (6 byte) Number max.");
84
- return new o(function(s, a) {
85
- var h = i + a;
86
- return h > s.length ? B(a, i.toString() + " bytes") : b(h, x(function(v, S) {
87
- var N = ht(S, v.buf);
88
- return { coll: v.coll.concat(N.v), buf: N.buf };
89
- }, { coll: [], buf: s.slice(a, h) }, t).coll);
90
- });
91
- }
92
- function P(t, r) {
93
- return new o(function(n, i) {
94
- return D(), i + r > n.length ? B(i, r + " bytes for " + t) : b(i + r, n.slice(i, i + r));
95
- });
96
- }
97
- function W(t, r) {
98
- if (typeof (n = r) != "number" || Math.floor(n) !== n || r < 0 || r > 6) throw new Error(t + " requires integer length in range [0, 6].");
99
- var n;
100
- }
101
- function Z(t) {
102
- return W("uintBE", t), P("uintBE(" + t + ")", t).map(function(r) {
103
- return r.readUIntBE(0, t);
104
- });
105
- }
106
- function $(t) {
107
- return W("uintLE", t), P("uintLE(" + t + ")", t).map(function(r) {
108
- return r.readUIntLE(0, t);
109
- });
110
- }
111
- function m(t) {
112
- return W("intBE", t), P("intBE(" + t + ")", t).map(function(r) {
113
- return r.readIntBE(0, t);
114
- });
115
- }
116
- function y(t) {
117
- return W("intLE", t), P("intLE(" + t + ")", t).map(function(r) {
118
- return r.readIntLE(0, t);
119
- });
120
- }
121
- function d(t) {
122
- return t instanceof o;
123
- }
124
- function E(t) {
125
- return {}.toString.call(t) === "[object Array]";
126
- }
127
- function L(t) {
128
- return tt() && Buffer.isBuffer(t);
129
- }
130
- function b(t, r) {
131
- return { status: !0, index: t, value: r, furthest: -1, expected: [] };
132
- }
133
- function B(t, r) {
134
- return E(r) || (r = [r]), { status: !1, index: -1, value: null, furthest: t, expected: r };
135
- }
136
- function j(t, r) {
137
- if (!r || t.furthest > r.furthest) return t;
138
- var n = t.furthest === r.furthest ? function(i, u) {
139
- if (function() {
140
- if (o._supportsSet !== void 0) return o._supportsSet;
141
- var q = typeof Set < "u";
142
- return o._supportsSet = q, q;
143
- }() && Array.from) {
144
- for (var s = new Set(i), a = 0; a < u.length; a++) s.add(u[a]);
145
- var h = Array.from(s);
146
- return h.sort(), h;
147
- }
148
- for (var v = {}, S = 0; S < i.length; S++) v[i[S]] = !0;
149
- for (var N = 0; N < u.length; N++) v[u[N]] = !0;
150
- var k = [];
151
- for (var _ in v) ({}).hasOwnProperty.call(v, _) && k.push(_);
152
- return k.sort(), k;
153
- }(t.expected, r.expected) : r.expected;
154
- return { status: t.status, index: t.index, value: t.value, furthest: r.furthest, expected: n };
155
- }
156
- var nt = {};
157
- function vt(t, r) {
158
- if (L(t)) return { offset: r, line: -1, column: -1 };
159
- t in nt || (nt[t] = {});
160
- for (var n = nt[t], i = 0, u = 0, s = 0, a = r; a >= 0; ) {
161
- if (a in n) {
162
- i = n[a].line, s === 0 && (s = n[a].lineStart);
163
- break;
164
- }
165
- (t.charAt(a) === `
166
- ` || t.charAt(a) === "\r" && t.charAt(a + 1) !== `
167
- `) && (u++, s === 0 && (s = a + 1)), a--;
168
- }
169
- var h = i + u, v = r - s;
170
- return n[r] = { line: h, lineStart: s }, { offset: r, line: h + 1, column: v + 1 };
171
- }
172
- function G(t) {
173
- if (!d(t)) throw new Error("not a parser: " + t);
174
- }
175
- function et(t, r) {
176
- return typeof t == "string" ? t.charAt(r) : t[r];
177
- }
178
- function U(t) {
179
- if (typeof t != "number") throw new Error("not a number: " + t);
180
- }
181
- function M(t) {
182
- if (typeof t != "function") throw new Error("not a function: " + t);
183
- }
184
- function J(t) {
185
- if (typeof t != "string") throw new Error("not a string: " + t);
186
- }
187
- var kt = 2, qt = 3, R = 8, It = 5 * R, Rt = 4 * R, yt = " ";
188
- function it(t, r) {
189
- return new Array(r + 1).join(t);
190
- }
191
- function ot(t, r, n) {
192
- var i = r - t.length;
193
- return i <= 0 ? t : it(n, i) + t;
194
- }
195
- function Et(t, r, n, i) {
196
- return { from: t - r > 0 ? t - r : 0, to: t + n > i ? i : t + n };
197
- }
198
- function Mt(t, r) {
199
- var n, i, u, s, a, h = r.index, v = h.offset, S = 1;
200
- if (v === t.length) return "Got the end of the input";
201
- if (L(t)) {
202
- var N = v - v % R, k = v - N, _ = Et(N, It, Rt + R, t.length), q = O(function(w) {
203
- return O(function(C) {
204
- return ot(C.toString(16), 2, "0");
205
- }, w);
206
- }, function(w, C) {
207
- var H = w.length, V = [], X = 0;
208
- if (H <= C) return [w.slice()];
209
- for (var Y = 0; Y < H; Y++) V[X] || V.push([]), V[X].push(w[Y]), (Y + 1) % C == 0 && X++;
210
- return V;
211
- }(t.slice(_.from, _.to).toJSON().data, R));
212
- s = function(w) {
213
- return w.from === 0 && w.to === 1 ? { from: w.from, to: w.to } : { from: w.from / R, to: Math.floor(w.to / R) };
214
- }(_), i = N / R, n = 3 * k, k >= 4 && (n += 1), S = 2, u = O(function(w) {
215
- return w.length <= 4 ? w.join(" ") : w.slice(0, 4).join(" ") + " " + w.slice(4).join(" ");
216
- }, q), (a = (8 * (s.to > 0 ? s.to - 1 : s.to)).toString(16).length) < 2 && (a = 2);
217
- } else {
218
- var T = t.split(/\r\n|[\n\r\u2028\u2029]/);
219
- n = h.column - 1, i = h.line - 1, s = Et(i, kt, qt, T.length), u = T.slice(s.from, s.to), a = s.to.toString().length;
220
- }
221
- var Ct = i - s.from;
222
- return L(t) && (a = (8 * (s.to > 0 ? s.to - 1 : s.to)).toString(16).length) < 2 && (a = 2), x(function(w, C, H) {
223
- var V, X = H === Ct, Y = X ? "> " : yt;
224
- return V = L(t) ? ot((8 * (s.from + H)).toString(16), a, "0") : ot((s.from + H + 1).toString(), a, " "), [].concat(w, [Y + V + " | " + C], X ? [yt + it(" ", a) + " | " + ot("", n, " ") + it("^", S)] : []);
225
- }, [], u).join(`
226
- `);
227
- }
228
- function wt(t, r) {
229
- return [`
230
- `, "-- PARSING FAILED " + it("-", 50), `
231
-
232
- `, Mt(t, r), `
233
-
234
- `, (n = r.expected, n.length === 1 ? `Expected:
235
-
236
- ` + n[0] : `Expected one of the following:
237
-
238
- ` + n.join(", ")), `
239
- `].join("");
240
- var n;
241
- }
242
- function xt(t) {
243
- return t.flags !== void 0 ? t.flags : [t.global ? "g" : "", t.ignoreCase ? "i" : "", t.multiline ? "m" : "", t.unicode ? "u" : "", t.sticky ? "y" : ""].join("");
244
- }
245
- function ut() {
246
- for (var t = [].slice.call(arguments), r = t.length, n = 0; n < r; n += 1) G(t[n]);
247
- return o(function(i, u) {
248
- for (var s, a = new Array(r), h = 0; h < r; h += 1) {
249
- if (!(s = j(t[h]._(i, u), s)).status) return s;
250
- a[h] = s.value, u = s.index;
251
- }
252
- return j(b(u, a), s);
253
- });
254
- }
255
- function F() {
256
- var t = [].slice.call(arguments);
257
- if (t.length === 0) throw new Error("seqMap needs at least one argument");
258
- var r = t.pop();
259
- return M(r), ut.apply(null, t).map(function(n) {
260
- return r.apply(null, n);
261
- });
262
- }
263
- function st() {
264
- var t = [].slice.call(arguments), r = t.length;
265
- if (r === 0) return at("zero alternates");
266
- for (var n = 0; n < r; n += 1) G(t[n]);
267
- return o(function(i, u) {
268
- for (var s, a = 0; a < t.length; a += 1) if ((s = j(t[a]._(i, u), s)).status) return s;
269
- return s;
270
- });
271
- }
272
- function Nt(t, r) {
273
- return pt(t, r).or(z([]));
274
- }
275
- function pt(t, r) {
276
- return G(t), G(r), F(t, r.then(t).many(), function(n, i) {
277
- return [n].concat(i);
278
- });
279
- }
280
- function K(t) {
281
- J(t);
282
- var r = "'" + t + "'";
283
- return o(function(n, i) {
284
- var u = i + t.length, s = n.slice(i, u);
285
- return s === t ? b(u, s) : B(i, r);
286
- });
287
- }
288
- function A(t, r) {
289
- (function(u) {
290
- if (!(u instanceof RegExp)) throw new Error("not a regexp: " + u);
291
- for (var s = xt(u), a = 0; a < s.length; a++) {
292
- var h = s.charAt(a);
293
- if (h !== "i" && h !== "m" && h !== "u" && h !== "s") throw new Error('unsupported regexp flag "' + h + '": ' + u);
294
- }
295
- })(t), arguments.length >= 2 ? U(r) : r = 0;
296
- var n = function(u) {
297
- return RegExp("^(?:" + u.source + ")", xt(u));
298
- }(t), i = "" + t;
299
- return o(function(u, s) {
300
- var a = n.exec(u.slice(s));
301
- if (a) {
302
- if (0 <= r && r <= a.length) {
303
- var h = a[0], v = a[r];
304
- return b(s + h.length, v);
305
- }
306
- return B(s, "valid match group (0 to " + a.length + ") in " + i);
307
- }
308
- return B(s, i);
309
- });
310
- }
311
- function z(t) {
312
- return o(function(r, n) {
313
- return b(n, t);
314
- });
315
- }
316
- function at(t) {
317
- return o(function(r, n) {
318
- return B(n, t);
319
- });
320
- }
321
- function ft(t) {
322
- if (d(t)) return o(function(r, n) {
323
- var i = t._(r, n);
324
- return i.index = n, i.value = "", i;
325
- });
326
- if (typeof t == "string") return ft(K(t));
327
- if (t instanceof RegExp) return ft(A(t));
328
- throw new Error("not a string, regexp, or parser: " + t);
329
- }
330
- function St(t) {
331
- return G(t), o(function(r, n) {
332
- var i = t._(r, n), u = r.slice(n, i.index);
333
- return i.status ? B(n, 'not "' + u + '"') : b(n, null);
334
- });
335
- }
336
- function ct(t) {
337
- return M(t), o(function(r, n) {
338
- var i = et(r, n);
339
- return n < r.length && t(i) ? b(n + 1, i) : B(n, "a character/byte matching " + t);
340
- });
341
- }
342
- function Bt(t, r) {
343
- arguments.length < 2 && (r = t, t = void 0);
344
- var n = o(function(i, u) {
345
- return n._ = r()._, n._(i, u);
346
- });
347
- return t ? n.desc(t) : n;
348
- }
349
- function mt() {
350
- return at("fantasy-land/empty");
351
- }
352
- f.parse = function(t) {
353
- if (typeof t != "string" && !L(t)) throw new Error(".parse must be called with a string or Buffer as its argument");
354
- var r, n = this.skip(gt)._(t, 0);
355
- return r = n.status ? { status: !0, value: n.value } : { status: !1, index: vt(t, n.furthest), expected: n.expected }, delete nt[t], r;
356
- }, f.tryParse = function(t) {
357
- var r = this.parse(t);
358
- if (r.status) return r.value;
359
- var n = wt(t, r), i = new Error(n);
360
- throw i.type = "ParsimmonError", i.result = r, i;
361
- }, f.assert = function(t, r) {
362
- return this.chain(function(n) {
363
- return t(n) ? z(n) : at(r);
364
- });
365
- }, f.or = function(t) {
366
- return st(this, t);
367
- }, f.trim = function(t) {
368
- return this.wrap(t, t);
369
- }, f.wrap = function(t, r) {
370
- return F(t, this, r, function(n, i) {
371
- return i;
372
- });
373
- }, f.thru = function(t) {
374
- return t(this);
375
- }, f.then = function(t) {
376
- return G(t), ut(this, t).map(function(r) {
377
- return r[1];
378
- });
379
- }, f.many = function() {
380
- var t = this;
381
- return o(function(r, n) {
382
- for (var i = [], u = void 0; ; ) {
383
- if (!(u = j(t._(r, n), u)).status) return j(b(n, i), u);
384
- if (n === u.index) throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");
385
- n = u.index, i.push(u.value);
386
- }
387
- });
388
- }, f.tieWith = function(t) {
389
- return J(t), this.map(function(r) {
390
- if (function(u) {
391
- if (!E(u)) throw new Error("not an array: " + u);
392
- }(r), r.length) {
393
- J(r[0]);
394
- for (var n = r[0], i = 1; i < r.length; i++) J(r[i]), n += t + r[i];
395
- return n;
396
- }
397
- return "";
398
- });
399
- }, f.tie = function() {
400
- return this.tieWith("");
401
- }, f.times = function(t, r) {
402
- var n = this;
403
- return arguments.length < 2 && (r = t), U(t), U(r), o(function(i, u) {
404
- for (var s = [], a = void 0, h = void 0, v = 0; v < t; v += 1) {
405
- if (h = j(a = n._(i, u), h), !a.status) return h;
406
- u = a.index, s.push(a.value);
407
- }
408
- for (; v < r && (h = j(a = n._(i, u), h), a.status); v += 1) u = a.index, s.push(a.value);
409
- return j(b(u, s), h);
410
- });
411
- }, f.result = function(t) {
412
- return this.map(function() {
413
- return t;
414
- });
415
- }, f.atMost = function(t) {
416
- return this.times(0, t);
417
- }, f.atLeast = function(t) {
418
- return F(this.times(t), this.many(), function(r, n) {
419
- return r.concat(n);
420
- });
421
- }, f.map = function(t) {
422
- M(t);
423
- var r = this;
424
- return o(function(n, i) {
425
- var u = r._(n, i);
426
- return u.status ? j(b(u.index, t(u.value)), u) : u;
427
- });
428
- }, f.contramap = function(t) {
429
- M(t);
430
- var r = this;
431
- return o(function(n, i) {
432
- var u = r.parse(t(n.slice(i)));
433
- return u.status ? b(i + n.length, u.value) : u;
434
- });
435
- }, f.promap = function(t, r) {
436
- return M(t), M(r), this.contramap(t).map(r);
437
- }, f.skip = function(t) {
438
- return ut(this, t).map(function(r) {
439
- return r[0];
440
- });
441
- }, f.mark = function() {
442
- return F(Q, this, Q, function(t, r, n) {
443
- return { start: t, value: r, end: n };
444
- });
445
- }, f.node = function(t) {
446
- return F(Q, this, Q, function(r, n, i) {
447
- return { name: t, value: n, start: r, end: i };
448
- });
449
- }, f.sepBy = function(t) {
450
- return Nt(this, t);
451
- }, f.sepBy1 = function(t) {
452
- return pt(this, t);
453
- }, f.lookahead = function(t) {
454
- return this.skip(ft(t));
455
- }, f.notFollowedBy = function(t) {
456
- return this.skip(St(t));
457
- }, f.desc = function(t) {
458
- E(t) || (t = [t]);
459
- var r = this;
460
- return o(function(n, i) {
461
- var u = r._(n, i);
462
- return u.status || (u.expected = t), u;
463
- });
464
- }, f.fallback = function(t) {
465
- return this.or(z(t));
466
- }, f.ap = function(t) {
467
- return F(t, this, function(r, n) {
468
- return r(n);
469
- });
470
- }, f.chain = function(t) {
471
- var r = this;
472
- return o(function(n, i) {
473
- var u = r._(n, i);
474
- return u.status ? j(t(u.value)._(n, u.index), u) : u;
475
- });
476
- }, f.concat = f.or, f.empty = mt, f.of = z, f["fantasy-land/ap"] = f.ap, f["fantasy-land/chain"] = f.chain, f["fantasy-land/concat"] = f.concat, f["fantasy-land/empty"] = f.empty, f["fantasy-land/of"] = f.of, f["fantasy-land/map"] = f.map;
477
- var Q = o(function(t, r) {
478
- return b(r, vt(t, r));
479
- }), Ft = o(function(t, r) {
480
- return r >= t.length ? B(r, "any character/byte") : b(r + 1, et(t, r));
481
- }), zt = o(function(t, r) {
482
- return b(t.length, t.slice(r));
483
- }), gt = o(function(t, r) {
484
- return r < t.length ? B(r, "EOF") : b(r, null);
485
- }), Vt = A(/[0-9]/).desc("a digit"), Dt = A(/[0-9]*/).desc("optional digits"), Wt = A(/[a-z]/i).desc("a letter"), $t = A(/[a-z]*/i).desc("optional letters"), Gt = A(/\s*/).desc("optional whitespace"), Ut = A(/\s+/).desc("whitespace"), _t = K("\r"), Pt = K(`
486
- `), jt = K(`\r
487
- `), Ot = st(jt, Pt, _t).desc("newline"), Tt = st(Ot, gt);
488
- o.all = zt, o.alt = st, o.any = Ft, o.cr = _t, o.createLanguage = function(t) {
489
- var r = {};
490
- for (var n in t) ({}).hasOwnProperty.call(t, n) && function(i) {
491
- r[i] = Bt(function() {
492
- return t[i](r);
493
- });
494
- }(n);
495
- return r;
496
- }, o.crlf = jt, o.custom = function(t) {
497
- return o(t(b, B));
498
- }, o.digit = Vt, o.digits = Dt, o.empty = mt, o.end = Tt, o.eof = gt, o.fail = at, o.formatError = wt, o.index = Q, o.isParser = d, o.lazy = Bt, o.letter = Wt, o.letters = $t, o.lf = Pt, o.lookahead = ft, o.makeFailure = B, o.makeSuccess = b, o.newline = Ot, o.noneOf = function(t) {
499
- return ct(function(r) {
500
- return t.indexOf(r) < 0;
501
- }).desc("none of '" + t + "'");
502
- }, o.notFollowedBy = St, o.of = z, o.oneOf = function(t) {
503
- for (var r = t.split(""), n = 0; n < r.length; n++) r[n] = "'" + r[n] + "'";
504
- return ct(function(i) {
505
- return t.indexOf(i) >= 0;
506
- }).desc(r);
507
- }, o.optWhitespace = Gt, o.Parser = o, o.range = function(t, r) {
508
- return ct(function(n) {
509
- return t <= n && n <= r;
510
- }).desc(t + "-" + r);
511
- }, o.regex = A, o.regexp = A, o.sepBy = Nt, o.sepBy1 = pt, o.seq = ut, o.seqMap = F, o.seqObj = function() {
512
- for (var t, r = {}, n = 0, i = (t = arguments, Array.prototype.slice.call(t)), u = i.length, s = 0; s < u; s += 1) {
513
- var a = i[s];
514
- if (!d(a)) {
515
- if (E(a) && a.length === 2 && typeof a[0] == "string" && d(a[1])) {
516
- var h = a[0];
517
- if (Object.prototype.hasOwnProperty.call(r, h)) throw new Error("seqObj: duplicate key " + h);
518
- r[h] = !0, n++;
519
- continue;
520
- }
521
- throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.");
522
- }
523
- }
524
- if (n === 0) throw new Error("seqObj expects at least one named parser, found zero");
525
- return o(function(v, S) {
526
- for (var N, k = {}, _ = 0; _ < u; _ += 1) {
527
- var q, T;
528
- if (E(i[_]) ? (q = i[_][0], T = i[_][1]) : (q = null, T = i[_]), !(N = j(T._(v, S), N)).status) return N;
529
- q && (k[q] = N.value), S = N.index;
530
- }
531
- return j(b(S, k), N);
532
- });
533
- }, o.string = K, o.succeed = z, o.takeWhile = function(t) {
534
- return M(t), o(function(r, n) {
535
- for (var i = n; i < r.length && t(et(r, i)); ) i++;
536
- return b(i, r.slice(n, i));
537
- });
538
- }, o.test = ct, o.whitespace = Ut, o["fantasy-land/empty"] = mt, o["fantasy-land/of"] = z, o.Binary = { bitSeq: rt, bitSeqObj: function(t) {
539
- D();
540
- var r = {}, n = 0, i = O(function(s) {
541
- if (E(s)) {
542
- var a = s;
543
- if (a.length !== 2) throw new Error("[" + a.join(", ") + "] should be length 2, got length " + a.length);
544
- if (J(a[0]), U(a[1]), Object.prototype.hasOwnProperty.call(r, a[0])) throw new Error("duplicate key in bitSeqObj: " + a[0]);
545
- return r[a[0]] = !0, n++, a;
546
- }
547
- return U(s), [null, s];
548
- }, t);
549
- if (n < 1) throw new Error("bitSeqObj expects at least one named pair, got [" + t.join(", ") + "]");
550
- var u = O(function(s) {
551
- return s[0];
552
- }, i);
553
- return rt(O(function(s) {
554
- return s[1];
555
- }, i)).map(function(s) {
556
- return x(function(a, h) {
557
- return h[0] !== null && (a[h[0]] = h[1]), a;
558
- }, {}, O(function(a, h) {
559
- return [a, s[h]];
560
- }, u));
561
- });
562
- }, byte: function(t) {
563
- if (D(), U(t), t > 255) throw new Error("Value specified to byte constructor (" + t + "=0x" + t.toString(16) + ") is larger in value than a single byte.");
564
- var r = (t > 15 ? "0x" : "0x0") + t.toString(16);
565
- return o(function(n, i) {
566
- var u = et(n, i);
567
- return u === t ? b(i + 1, u) : B(i, r);
568
- });
569
- }, buffer: function(t) {
570
- return P("buffer", t).map(function(r) {
571
- return Buffer.from(r);
572
- });
573
- }, encodedString: function(t, r) {
574
- return P("string", r).map(function(n) {
575
- return n.toString(t);
576
- });
577
- }, uintBE: Z, uint8BE: Z(1), uint16BE: Z(2), uint32BE: Z(4), uintLE: $, uint8LE: $(1), uint16LE: $(2), uint32LE: $(4), intBE: m, int8BE: m(1), int16BE: m(2), int32BE: m(4), intLE: y, int8LE: y(1), int16LE: y(2), int32LE: y(4), floatBE: P("floatBE", 4).map(function(t) {
578
- return t.readFloatBE(0);
579
- }), floatLE: P("floatLE", 4).map(function(t) {
580
- return t.readFloatLE(0);
581
- }), doubleBE: P("doubleBE", 8).map(function(t) {
582
- return t.readDoubleBE(0);
583
- }), doubleLE: P("doubleLE", 8).map(function(t) {
584
- return t.readDoubleLE(0);
585
- }) }, c.exports = o;
586
- }]);
587
- });
588
- }(lt)), lt.exports;
589
- }
590
- var g = Xt();
591
- class bt {
592
- constructor(e, c = "\\") {
593
- this.val = e;
594
- function l(m) {
595
- const y = [];
596
- for (const d of m) y.push(
597
- (typeof d == "string" ? g.string(d) : g.regex(d)).trim(g.optWhitespace)
598
- );
599
- return g.alt(...y);
600
- }
601
- function p(m) {
602
- const d = Object.keys(m).sort().map(
603
- (E) => (typeof m[E] == "string" ? g.string(m[E]) : g.regex(m[E])).trim(g.optWhitespace).result(E)
604
- );
605
- return g.alt(...d);
606
- }
607
- function o(m, y) {
608
- const d = g.lazy(() => g.seq(m, d).or(y));
609
- return d;
610
- }
611
- function f(m, y) {
612
- return g.seqMap(y, m.many(), (d, E) => E.reduce((L, b) => [b, L], d));
613
- }
614
- function I(m, y) {
615
- const d = g.lazy(
616
- () => y.chain(
617
- (E) => g.seq(
618
- m,
619
- g.of(E),
620
- d
621
- ).or(g.of(E))
622
- )
623
- );
624
- return d;
625
- }
626
- function x(m, y) {
627
- return g.seqMap(
628
- y,
629
- g.seq(m, y).many(),
630
- (d, E) => E.reduce((L, b) => [b[0], L, b[1]], d)
631
- );
632
- }
633
- const O = g.alt(
634
- g.alt(
635
- g.regex(/-?(0|[1-9][0-9]*)\.[0-9]+/),
636
- g.regex(/0x[0-9a-fA-F]+/)
637
- ).map(Number),
638
- g.alt(
639
- g.regex(/-?(0|[1-9][0-9]*)/)
640
- ).map((m) => dt(m))
641
- ).map((m) => ["!num!", m]).desc("number"), ht = g.string("null").map(() => ["!str!", null]), tt = g.regex(/(true|false)/).map((m) => ["!bool!", m === "true"]).desc("boolean"), D = g.regex(new RegExp(`(?:"(?:\\${c}["'#\\n]|[^"])*"|'(?:\\${c}["'#\\n]|[^'])*'|\\#(?:\\${c}["'#\\n]|[^#])*\\#)`)).map((m) => ["!str!", m.slice(1, -1).replaceAll(c, "")]).desc("string"), rt = /\[[^\]]+\]/g, P = g.regex(/-?(?:(?:tmp|sys|save|mp):)?[^\s!-/:-@[-^`{-~]+(?:\.[^\s!-/:-@[-^`{-~]+|\[[^\]]+\])*(?:@str)?/).map((m) => {
642
- const y = m.replaceAll(
643
- rt,
644
- (E) => (
645
- // eslint-disable-next-line @typescript-eslint/restrict-plus-operands
646
- "." + this.parse(E.slice(1, -1))
647
- )
648
- ), d = this.val.getVal(y);
649
- return d == null ? ["!str!", d] : typeof d == "boolean" ? ["!bool!", d] : Object.prototype.toString.call(d) === "[object String]" ? ["!str!", String(d)] : ["!num!", Number(d)];
650
- }).desc("string"), W = g.lazy(
651
- () => g.string("(").then(this.#e).skip(g.string(")")).or(O).or(ht).or(tt).or(D).or(P)
652
- ), $ = [
653
- // 演算子の優先順位 - JavaScript | MDN https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Operator_precedence
654
- // 優先順位:18(メンバーへのアクセス、計算値によるメンバーへのアクセス)
655
- // a.b a[b]
656
- { type: o, ops: l([/[A-Za-z_][A-Za-z0-9_]*(?=\()/]) },
657
- // 優先順位:16
658
- { type: f, ops: p({ PostfixInc: "++" }) },
659
- { type: f, ops: p({ PostfixDec: "--" }) },
660
- // 【未サポート】後置インクリメント・デクリメント
661
- // 優先順位:15
662
- { type: o, ops: l([/!(?!=)|~/]) },
663
- // 論理 NOT (!)、ビット単位 NOT (~)
664
- { type: o, ops: p({ PrefixInc: "++" }) },
665
- { type: o, ops: p({ PrefixDec: "--" }) },
666
- // 【未サポート】前置インクリメント・デクリメント
667
- // {type: PREFIX, ops: opeH({Unaryplus: /\+(?!\+)/})}, // 単項プラス
668
- { type: o, ops: p({ UnaryNegate: /-(?!-)/ }) },
669
- // 単項マイナス
670
- // 優先順位:14以下(並びに注意)
671
- { type: I, ops: l(["**"]) },
672
- { type: x, ops: l(["*", "/", "¥", "%"]) },
673
- { type: x, ops: l(["+", "-"]) },
674
- { type: x, ops: l([/>>>|<<|>>/]) },
675
- { type: x, ops: l([/<=|<|>=|>/]) },
676
- { type: x, ops: l([/===|!==|==|!=/]) },
677
- { type: x, ops: l([/&(?!&)/]) },
678
- { type: x, ops: l(["^"]) },
679
- { type: x, ops: l([/\|(?!\|)/]) },
680
- { type: x, ops: l(["&&"]) },
681
- { type: x, ops: l(["||"]) },
682
- { type: I, ops: l([":"]) },
683
- { type: I, ops: l(["?"]) }
684
- ].reduce(
685
- (m, y) => y.type(y.ops, m),
686
- W
687
- );
688
- this.#e = $.trim(g.optWhitespace);
689
- }
690
- #e = null;
691
- parse(e) {
692
- const c = this.#e.parse(e);
693
- if (!c.status) throw Error("(PropParser)文法エラー【" + e + "】");
694
- const l = c.value;
695
- return l[0] === "!str!" ? this.#i(l[1]) : this.#t(l);
696
- }
697
- #t(e) {
698
- const c = e.shift();
699
- if (c instanceof Array) return this.#t(c);
700
- const l = this.#r[c];
701
- return l ? l(e) : Object(null);
702
- }
703
- #r = {
704
- "!num!": (e) => e.shift(),
705
- "!str!": (e) => this.#i(e.shift()),
706
- "!bool!": (e) => e.shift(),
707
- PostfixInc: (e) => {
708
- throw Error("(PropParser)後置インクリメントは未サポートです");
709
- },
710
- PostfixDec: (e) => {
711
- throw Error("(PropParser)後置デクリメントは未サポートです");
712
- },
713
- PrefixInc: (e) => {
714
- throw Error("(PropParser)前置インクリメントは未サポートです");
715
- },
716
- PrefixDec: (e) => {
717
- throw Error("(PropParser)前置デクリメントは未サポートです");
718
- },
719
- // 論理 NOT
720
- "!": (e) => !this.#r.Boolean(e),
721
- // チルダ演算子(ビット反転)
722
- "~": (e) => ~Number(this.#t(e.shift())),
723
- // UnaryNegate: a=> -Number(this.#calc(a.shift())),
724
- UnaryNegate: (e) => -this.#r.Number(e),
725
- // Unaryplus: a=> this.#hFnc['Number'](a),
726
- // 乗算、除算、剰余
727
- "**": (e) => Number(this.#t(e.shift())) ** Number(this.#t(e.shift())),
728
- "*": (e) => Number(this.#t(e.shift())) * Number(this.#t(e.shift())),
729
- "/": (e) => Number(this.#t(e.shift())) / Number(this.#t(e.shift())),
730
- "¥": (e) => Math.floor(this.#r["/"](e)),
731
- "%": (e) => Number(this.#t(e.shift())) % Number(this.#t(e.shift())),
732
- // 加算、減算、文字列の連結
733
- "+": (e) => {
734
- const c = this.#t(e.shift()), l = this.#t(e.shift());
735
- return Object.prototype.toString.call(c) === "[object String]" || Object.prototype.toString.call(l) === "[object String]" ? String(c) + String(l) : Number(c) + Number(l);
736
- },
737
- "-": (e) => Number(this.#t(e.shift())) - Number(this.#t(e.shift())),
738
- // 関数
739
- int: (e) => dt(this.#n(e.shift())),
740
- parseInt: (e) => dt(this.#r.Number(e)),
741
- Number: (e) => {
742
- const c = this.#t(e.shift());
743
- return Object.prototype.toString.call(c) === "[object String]" ? this.#n(this.#e.parse(String(c)).value) : Number(c);
744
- },
745
- Boolean: (e) => {
746
- const c = e.shift();
747
- return c[0] === "!bool!" ? !!c[1] : !!this.#t(c);
748
- },
749
- ceil: (e) => Math.ceil(this.#n(e.shift())),
750
- floor: (e) => Math.floor(this.#n(e.shift())),
751
- round: (e) => Math.round(this.#n(e.shift())),
752
- isNaN: (e) => Number.isNaN(this.#n(e.shift())),
753
- // ビットシフト
754
- "<<": (e) => Number(this.#t(e.shift())) << Number(this.#t(e.shift())),
755
- ">>": (e) => Number(this.#t(e.shift())) >> Number(this.#t(e.shift())),
756
- ">>>": (e) => Number(this.#t(e.shift())) >>> Number(this.#t(e.shift())),
757
- // 等値、非等値、厳密等価、厳密非等価
758
- "<": (e) => Number(this.#t(e.shift())) < Number(this.#t(e.shift())),
759
- "<=": (e) => Number(this.#t(e.shift())) <= Number(this.#t(e.shift())),
760
- ">": (e) => Number(this.#t(e.shift())) > Number(this.#t(e.shift())),
761
- ">=": (e) => Number(this.#t(e.shift())) >= Number(this.#t(e.shift())),
762
- // 小なり、以下、大なり、以上
763
- "==": (e) => {
764
- const c = this.#t(e.shift()), l = this.#t(e.shift());
765
- return c == null && l == null ? c == l : String(c) === String(l);
766
- },
767
- "!=": (e) => !this.#r["=="](e),
768
- "===": (e) => {
769
- const c = this.#t(e.shift()), l = this.#t(e.shift());
770
- return Object.prototype.toString.call(c) != Object.prototype.toString.call(l) ? !1 : String(c) === String(l);
771
- },
772
- "!==": (e) => !this.#r["==="](e),
773
- // ビット演算子
774
- "&": (e) => Number(this.#t(e.shift())) & Number(this.#t(e.shift())),
775
- "^": (e) => Number(this.#t(e.shift())) ^ Number(this.#t(e.shift())),
776
- "|": (e) => Number(this.#t(e.shift())) | Number(this.#t(e.shift())),
777
- // 論理 AND,OR
778
- "&&": (e) => String(this.#t(e.shift())) === "true" && String(this.#t(e.shift())) === "true",
779
- "||": (e) => String(this.#t(e.shift())) === "true" || String(this.#t(e.shift())) === "true",
780
- // 条件
781
- "?": (e) => {
782
- const c = this.#r.Boolean(e), l = e.shift();
783
- if (l[0] !== ":") throw Error("(PropParser)三項演算子の文法エラーです。: が見つかりません");
784
- return this.#t(l[c ? 1 : 2]);
785
- },
786
- ":": () => {
787
- throw Error("(PropParser)三項演算子の文法エラーです。? が見つかりません");
788
- }
789
- };
790
- #n(e) {
791
- const c = this.#t(e);
792
- if (Object.prototype.toString.call(c) !== "[object Number]") throw Error("(PropParser)引数【" + String(c) + "】が数値ではありません");
793
- return Number(c);
794
- }
795
- #o = /(\$((tmp|sys|save|mp):)?[^\s!--/:-@[-^`{-~]+|#\{[^}]+})/g;
796
- #i(e) {
797
- return e == null ? e : String(e).replaceAll(
798
- this.#o,
799
- (c) => String(c.startsWith("$") ? this.val.getVal(c.slice(1)) : this.parse(c.slice(2, -1)))
800
- );
801
- }
802
- getValAmpersand = (e) => e.startsWith("&") ? String(this.parse(e.slice(1))) : e;
803
- static #u = /^((?<scope>\w+?):)?(?<name>[^\s :@]+)(?<at>@str)?$/;
804
- // 522 match 18413 step(~10ms) https://regex101.com/r/tmCKuE/1
805
- // →これは改良しようがない。いい意味で改善の余地なし
806
- static getValName(e) {
807
- const l = this.#u.exec(e.trim())?.groups;
808
- if (!l) return null;
809
- const { scope: p = "tmp", name: o, at: f = "" } = l;
810
- if (!bt.#s.includes(p)) throw `[変数に値セット] scopeが異常【${p}】です`;
811
- return {
812
- scope: p,
813
- name: bt.#a(o),
814
- at: f
815
- };
816
- }
817
- static #s = ["tmp", "sys", "save", "mp"];
818
- static #a(e) {
819
- let c = 0, l = 0, p = e;
820
- for (; ; ) {
821
- if (c = p.indexOf('["'), c < 0) {
822
- if (c = p.indexOf("['"), c < 0) break;
823
- l = p.indexOf("']", c + 2);
824
- } else
825
- l = p.indexOf('"]', c + 2);
826
- if (l < 0) break;
827
- p = p.slice(0, c) + "." + p.slice(c + 2, l) + p.slice(l + 2), c = l - 2;
828
- }
829
- return p;
830
- }
831
- }
832
- export {
833
- bt as PropParser
1
+ import { t as __commonJSMin } from "./chunk.js";
2
+ import { p as int } from "./CmnLib.js";
3
+ var import_parsimmon_umd_min = (/* @__PURE__ */ __commonJSMin(((e, t) => {
4
+ (function(n, r) {
5
+ typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.Parsimmon = r() : n.Parsimmon = r();
6
+ })(typeof self < "u" ? self : e, function() {
7
+ return function(e) {
8
+ var t = {};
9
+ function n(r) {
10
+ if (t[r]) return t[r].exports;
11
+ var i = t[r] = {
12
+ i: r,
13
+ l: !1,
14
+ exports: {}
15
+ };
16
+ return e[r].call(i.exports, i, i.exports, n), i.l = !0, i.exports;
17
+ }
18
+ return n.m = e, n.c = t, n.d = function(e, t, r) {
19
+ n.o(e, t) || Object.defineProperty(e, t, {
20
+ configurable: !1,
21
+ enumerable: !0,
22
+ get: r
23
+ });
24
+ }, n.r = function(e) {
25
+ Object.defineProperty(e, "__esModule", { value: !0 });
26
+ }, n.n = function(e) {
27
+ var t = e && e.__esModule ? function() {
28
+ return e.default;
29
+ } : function() {
30
+ return e;
31
+ };
32
+ return n.d(t, "a", t), t;
33
+ }, n.o = function(e, t) {
34
+ return Object.prototype.hasOwnProperty.call(e, t);
35
+ }, n.p = "", n(n.s = 0);
36
+ }([function(e, t, n) {
37
+ function r(e) {
38
+ if (!(this instanceof r)) return new r(e);
39
+ this._ = e;
40
+ }
41
+ var i = r.prototype;
42
+ function a(e, t) {
43
+ for (var n = 0; n < e; n++) t(n);
44
+ }
45
+ function o(e, t, n) {
46
+ return function(e, t) {
47
+ a(t.length, function(n) {
48
+ e(t[n], n, t);
49
+ });
50
+ }(function(n, r, i) {
51
+ t = e(t, n, r, i);
52
+ }, n), t;
53
+ }
54
+ function s(e, t) {
55
+ return o(function(t, n, r, i) {
56
+ return t.concat([e(n, r, i)]);
57
+ }, [], t);
58
+ }
59
+ function c(e, t) {
60
+ var n = {
61
+ v: 0,
62
+ buf: t
63
+ };
64
+ return a(e, function() {
65
+ var e;
66
+ n = {
67
+ v: n.v << 1 | (e = n.buf, e[0] >> 7),
68
+ buf: function(e) {
69
+ var t = o(function(e, t, n, r) {
70
+ return e.concat(n === r.length - 1 ? Buffer.from([t, 0]).readUInt16BE(0) : r.readUInt16BE(n));
71
+ }, [], e);
72
+ return Buffer.from(s(function(e) {
73
+ return (e << 1 & 65535) >> 8;
74
+ }, t));
75
+ }(n.buf)
76
+ };
77
+ }), n;
78
+ }
79
+ function l() {
80
+ return typeof Buffer < "u";
81
+ }
82
+ function u() {
83
+ if (!l()) throw Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.");
84
+ }
85
+ function d(e) {
86
+ u();
87
+ var t = o(function(e, t) {
88
+ return e + t;
89
+ }, 0, e);
90
+ if (t % 8 != 0) throw Error("The bits [" + e.join(", ") + "] add up to " + t + " which is not an even number of bytes; the total should be divisible by 8");
91
+ var n, i = t / 8, a = (n = function(e) {
92
+ return e > 48;
93
+ }, o(function(e, t) {
94
+ return e || (n(t) ? t : e);
95
+ }, null, e));
96
+ if (a) throw Error(a + " bit range requested exceeds 48 bit (6 byte) Number max.");
97
+ return new r(function(t, n) {
98
+ var r = i + n;
99
+ return r > t.length ? S(n, i.toString() + " bytes") : x(r, o(function(e, t) {
100
+ var n = c(t, e.buf);
101
+ return {
102
+ coll: e.coll.concat(n.v),
103
+ buf: n.buf
104
+ };
105
+ }, {
106
+ coll: [],
107
+ buf: t.slice(n, r)
108
+ }, e).coll);
109
+ });
110
+ }
111
+ function f(e, t) {
112
+ return new r(function(n, r) {
113
+ return u(), r + t > n.length ? S(r, t + " bytes for " + e) : x(r + t, n.slice(r, r + t));
114
+ });
115
+ }
116
+ function p(e, t) {
117
+ if (typeof (n = t) != "number" || Math.floor(n) !== n || t < 0 || t > 6) throw Error(e + " requires integer length in range [0, 6].");
118
+ var n;
119
+ }
120
+ function m(e) {
121
+ return p("uintBE", e), f("uintBE(" + e + ")", e).map(function(t) {
122
+ return t.readUIntBE(0, e);
123
+ });
124
+ }
125
+ function h(e) {
126
+ return p("uintLE", e), f("uintLE(" + e + ")", e).map(function(t) {
127
+ return t.readUIntLE(0, e);
128
+ });
129
+ }
130
+ function g(e) {
131
+ return p("intBE", e), f("intBE(" + e + ")", e).map(function(t) {
132
+ return t.readIntBE(0, e);
133
+ });
134
+ }
135
+ function _(e) {
136
+ return p("intLE", e), f("intLE(" + e + ")", e).map(function(t) {
137
+ return t.readIntLE(0, e);
138
+ });
139
+ }
140
+ function v(e) {
141
+ return e instanceof r;
142
+ }
143
+ function y(e) {
144
+ return {}.toString.call(e) === "[object Array]";
145
+ }
146
+ function b(e) {
147
+ return l() && Buffer.isBuffer(e);
148
+ }
149
+ function x(e, t) {
150
+ return {
151
+ status: !0,
152
+ index: e,
153
+ value: t,
154
+ furthest: -1,
155
+ expected: []
156
+ };
157
+ }
158
+ function S(e, t) {
159
+ return y(t) || (t = [t]), {
160
+ status: !1,
161
+ index: -1,
162
+ value: null,
163
+ furthest: e,
164
+ expected: t
165
+ };
166
+ }
167
+ function C(e, t) {
168
+ if (!t || e.furthest > t.furthest) return e;
169
+ var n = e.furthest === t.furthest ? function(e, t) {
170
+ if (function() {
171
+ if (r._supportsSet !== void 0) return r._supportsSet;
172
+ var e = typeof Set < "u";
173
+ return r._supportsSet = e, e;
174
+ }() && Array.from) {
175
+ for (var n = new Set(e), i = 0; i < t.length; i++) n.add(t[i]);
176
+ var a = Array.from(n);
177
+ return a.sort(), a;
178
+ }
179
+ for (var o = {}, s = 0; s < e.length; s++) o[e[s]] = !0;
180
+ for (var c = 0; c < t.length; c++) o[t[c]] = !0;
181
+ var l = [];
182
+ for (var u in o) ({}).hasOwnProperty.call(o, u) && l.push(u);
183
+ return l.sort(), l;
184
+ }(e.expected, t.expected) : t.expected;
185
+ return {
186
+ status: e.status,
187
+ index: e.index,
188
+ value: e.value,
189
+ furthest: t.furthest,
190
+ expected: n
191
+ };
192
+ }
193
+ var w = {};
194
+ function T(e, t) {
195
+ if (b(e)) return {
196
+ offset: t,
197
+ line: -1,
198
+ column: -1
199
+ };
200
+ e in w || (w[e] = {});
201
+ for (var n = w[e], r = 0, i = 0, a = 0, o = t; o >= 0;) {
202
+ if (o in n) {
203
+ r = n[o].line, a === 0 && (a = n[o].lineStart);
204
+ break;
205
+ }
206
+ (e.charAt(o) === "\n" || e.charAt(o) === "\r" && e.charAt(o + 1) !== "\n") && (i++, a === 0 && (a = o + 1)), o--;
207
+ }
208
+ var s = r + i, c = t - a;
209
+ return n[t] = {
210
+ line: s,
211
+ lineStart: a
212
+ }, {
213
+ offset: t,
214
+ line: s + 1,
215
+ column: c + 1
216
+ };
217
+ }
218
+ function E(e) {
219
+ if (!v(e)) throw Error("not a parser: " + e);
220
+ }
221
+ function D(e, t) {
222
+ return typeof e == "string" ? e.charAt(t) : e[t];
223
+ }
224
+ function O(e) {
225
+ if (typeof e != "number") throw Error("not a number: " + e);
226
+ }
227
+ function k(e) {
228
+ if (typeof e != "function") throw Error("not a function: " + e);
229
+ }
230
+ function A(e) {
231
+ if (typeof e != "string") throw Error("not a string: " + e);
232
+ }
233
+ var ee = 2, te = 3, j = 8, ne = 5 * j, re = 4 * j, M = " ";
234
+ function N(e, t) {
235
+ return Array(t + 1).join(e);
236
+ }
237
+ function P(e, t, n) {
238
+ var r = t - e.length;
239
+ return r <= 0 ? e : N(n, r) + e;
240
+ }
241
+ function F(e, t, n, r) {
242
+ return {
243
+ from: e - t > 0 ? e - t : 0,
244
+ to: e + n > r ? r : e + n
245
+ };
246
+ }
247
+ function ie(e, t) {
248
+ var n, r, i, a, c, l = t.index, u = l.offset, d = 1;
249
+ if (u === e.length) return "Got the end of the input";
250
+ if (b(e)) {
251
+ var f = u - u % j, p = u - f, m = F(f, ne, re + j, e.length), h = s(function(e) {
252
+ return s(function(e) {
253
+ return P(e.toString(16), 2, "0");
254
+ }, e);
255
+ }, function(e, t) {
256
+ var n = e.length, r = [], i = 0;
257
+ if (n <= t) return [e.slice()];
258
+ for (var a = 0; a < n; a++) r[i] || r.push([]), r[i].push(e[a]), (a + 1) % t == 0 && i++;
259
+ return r;
260
+ }(e.slice(m.from, m.to).toJSON().data, j));
261
+ a = function(e) {
262
+ return e.from === 0 && e.to === 1 ? {
263
+ from: e.from,
264
+ to: e.to
265
+ } : {
266
+ from: e.from / j,
267
+ to: Math.floor(e.to / j)
268
+ };
269
+ }(m), r = f / j, n = 3 * p, p >= 4 && (n += 1), d = 2, i = s(function(e) {
270
+ return e.length <= 4 ? e.join(" ") : e.slice(0, 4).join(" ") + " " + e.slice(4).join(" ");
271
+ }, h), (c = (8 * (a.to > 0 ? a.to - 1 : a.to)).toString(16).length) < 2 && (c = 2);
272
+ } else {
273
+ var g = e.split(/\r\n|[\n\r\u2028\u2029]/);
274
+ n = l.column - 1, r = l.line - 1, a = F(r, ee, te, g.length), i = g.slice(a.from, a.to), c = a.to.toString().length;
275
+ }
276
+ var _ = r - a.from;
277
+ return b(e) && (c = (8 * (a.to > 0 ? a.to - 1 : a.to)).toString(16).length) < 2 && (c = 2), o(function(t, r, i) {
278
+ var o, s = i === _, l = s ? "> " : M;
279
+ return o = b(e) ? P((8 * (a.from + i)).toString(16), c, "0") : P((a.from + i + 1).toString(), c, " "), [].concat(t, [l + o + " | " + r], s ? [M + N(" ", c) + " | " + P("", n, " ") + N("^", d)] : []);
280
+ }, [], i).join("\n");
281
+ }
282
+ function I(e, t) {
283
+ return [
284
+ "\n",
285
+ "-- PARSING FAILED " + N("-", 50),
286
+ "\n\n",
287
+ ie(e, t),
288
+ "\n\n",
289
+ (n = t.expected, n.length === 1 ? "Expected:\n\n" + n[0] : "Expected one of the following: \n\n" + n.join(", ")),
290
+ "\n"
291
+ ].join("");
292
+ var n;
293
+ }
294
+ function L(e) {
295
+ return e.flags === void 0 ? [
296
+ e.global ? "g" : "",
297
+ e.ignoreCase ? "i" : "",
298
+ e.multiline ? "m" : "",
299
+ e.unicode ? "u" : "",
300
+ e.sticky ? "y" : ""
301
+ ].join("") : e.flags;
302
+ }
303
+ function R() {
304
+ for (var e = [].slice.call(arguments), t = e.length, n = 0; n < t; n += 1) E(e[n]);
305
+ return r(function(n, r) {
306
+ for (var i, a = Array(t), o = 0; o < t; o += 1) {
307
+ if (!(i = C(e[o]._(n, r), i)).status) return i;
308
+ a[o] = i.value, r = i.index;
309
+ }
310
+ return C(x(r, a), i);
311
+ });
312
+ }
313
+ function z() {
314
+ var e = [].slice.call(arguments);
315
+ if (e.length === 0) throw Error("seqMap needs at least one argument");
316
+ var t = e.pop();
317
+ return k(t), R.apply(null, e).map(function(e) {
318
+ return t.apply(null, e);
319
+ });
320
+ }
321
+ function B() {
322
+ var e = [].slice.call(arguments), t = e.length;
323
+ if (t === 0) return G("zero alternates");
324
+ for (var n = 0; n < t; n += 1) E(e[n]);
325
+ return r(function(t, n) {
326
+ for (var r, i = 0; i < e.length; i += 1) if ((r = C(e[i]._(t, n), r)).status) return r;
327
+ return r;
328
+ });
329
+ }
330
+ function ae(e, t) {
331
+ return V(e, t).or(W([]));
332
+ }
333
+ function V(e, t) {
334
+ return E(e), E(t), z(e, t.then(e).many(), function(e, t) {
335
+ return [e].concat(t);
336
+ });
337
+ }
338
+ function H(e) {
339
+ A(e);
340
+ var t = "'" + e + "'";
341
+ return r(function(n, r) {
342
+ var i = r + e.length, a = n.slice(r, i);
343
+ return a === e ? x(i, a) : S(r, t);
344
+ });
345
+ }
346
+ function U(e, t) {
347
+ (function(e) {
348
+ if (!(e instanceof RegExp)) throw Error("not a regexp: " + e);
349
+ for (var t = L(e), n = 0; n < t.length; n++) {
350
+ var r = t.charAt(n);
351
+ if (r !== "i" && r !== "m" && r !== "u" && r !== "s") throw Error("unsupported regexp flag \"" + r + "\": " + e);
352
+ }
353
+ })(e), arguments.length >= 2 ? O(t) : t = 0;
354
+ var n = function(e) {
355
+ return RegExp("^(?:" + e.source + ")", L(e));
356
+ }(e), i = "" + e;
357
+ return r(function(e, r) {
358
+ var a = n.exec(e.slice(r));
359
+ if (a) {
360
+ if (0 <= t && t <= a.length) {
361
+ var o = a[0], s = a[t];
362
+ return x(r + o.length, s);
363
+ }
364
+ return S(r, "valid match group (0 to " + a.length + ") in " + i);
365
+ }
366
+ return S(r, i);
367
+ });
368
+ }
369
+ function W(e) {
370
+ return r(function(t, n) {
371
+ return x(n, e);
372
+ });
373
+ }
374
+ function G(e) {
375
+ return r(function(t, n) {
376
+ return S(n, e);
377
+ });
378
+ }
379
+ function K(e) {
380
+ if (v(e)) return r(function(t, n) {
381
+ var r = e._(t, n);
382
+ return r.index = n, r.value = "", r;
383
+ });
384
+ if (typeof e == "string") return K(H(e));
385
+ if (e instanceof RegExp) return K(U(e));
386
+ throw Error("not a string, regexp, or parser: " + e);
387
+ }
388
+ function q(e) {
389
+ return E(e), r(function(t, n) {
390
+ var r = e._(t, n), i = t.slice(n, r.index);
391
+ return r.status ? S(n, "not \"" + i + "\"") : x(n, null);
392
+ });
393
+ }
394
+ function J(e) {
395
+ return k(e), r(function(t, n) {
396
+ var r = D(t, n);
397
+ return n < t.length && e(r) ? x(n + 1, r) : S(n, "a character/byte matching " + e);
398
+ });
399
+ }
400
+ function Y(e, t) {
401
+ arguments.length < 2 && (t = e, e = void 0);
402
+ var n = r(function(e, r) {
403
+ return n._ = t()._, n._(e, r);
404
+ });
405
+ return e ? n.desc(e) : n;
406
+ }
407
+ function X() {
408
+ return G("fantasy-land/empty");
409
+ }
410
+ i.parse = function(e) {
411
+ if (typeof e != "string" && !b(e)) throw Error(".parse must be called with a string or Buffer as its argument");
412
+ var t, n = this.skip(Q)._(e, 0);
413
+ return t = n.status ? {
414
+ status: !0,
415
+ value: n.value
416
+ } : {
417
+ status: !1,
418
+ index: T(e, n.furthest),
419
+ expected: n.expected
420
+ }, delete w[e], t;
421
+ }, i.tryParse = function(e) {
422
+ var t = this.parse(e);
423
+ if (t.status) return t.value;
424
+ var n = I(e, t), r = Error(n);
425
+ throw r.type = "ParsimmonError", r.result = t, r;
426
+ }, i.assert = function(e, t) {
427
+ return this.chain(function(n) {
428
+ return e(n) ? W(n) : G(t);
429
+ });
430
+ }, i.or = function(e) {
431
+ return B(this, e);
432
+ }, i.trim = function(e) {
433
+ return this.wrap(e, e);
434
+ }, i.wrap = function(e, t) {
435
+ return z(e, this, t, function(e, t) {
436
+ return t;
437
+ });
438
+ }, i.thru = function(e) {
439
+ return e(this);
440
+ }, i.then = function(e) {
441
+ return E(e), R(this, e).map(function(e) {
442
+ return e[1];
443
+ });
444
+ }, i.many = function() {
445
+ var e = this;
446
+ return r(function(t, n) {
447
+ for (var r = [], i = void 0;;) {
448
+ if (!(i = C(e._(t, n), i)).status) return C(x(n, r), i);
449
+ if (n === i.index) throw Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");
450
+ n = i.index, r.push(i.value);
451
+ }
452
+ });
453
+ }, i.tieWith = function(e) {
454
+ return A(e), this.map(function(t) {
455
+ if (function(e) {
456
+ if (!y(e)) throw Error("not an array: " + e);
457
+ }(t), t.length) {
458
+ A(t[0]);
459
+ for (var n = t[0], r = 1; r < t.length; r++) A(t[r]), n += e + t[r];
460
+ return n;
461
+ }
462
+ return "";
463
+ });
464
+ }, i.tie = function() {
465
+ return this.tieWith("");
466
+ }, i.times = function(e, t) {
467
+ var n = this;
468
+ return arguments.length < 2 && (t = e), O(e), O(t), r(function(r, i) {
469
+ for (var a = [], o = void 0, s = void 0, c = 0; c < e; c += 1) {
470
+ if (s = C(o = n._(r, i), s), !o.status) return s;
471
+ i = o.index, a.push(o.value);
472
+ }
473
+ for (; c < t && (s = C(o = n._(r, i), s), o.status); c += 1) i = o.index, a.push(o.value);
474
+ return C(x(i, a), s);
475
+ });
476
+ }, i.result = function(e) {
477
+ return this.map(function() {
478
+ return e;
479
+ });
480
+ }, i.atMost = function(e) {
481
+ return this.times(0, e);
482
+ }, i.atLeast = function(e) {
483
+ return z(this.times(e), this.many(), function(e, t) {
484
+ return e.concat(t);
485
+ });
486
+ }, i.map = function(e) {
487
+ k(e);
488
+ var t = this;
489
+ return r(function(n, r) {
490
+ var i = t._(n, r);
491
+ return i.status ? C(x(i.index, e(i.value)), i) : i;
492
+ });
493
+ }, i.contramap = function(e) {
494
+ k(e);
495
+ var t = this;
496
+ return r(function(n, r) {
497
+ var i = t.parse(e(n.slice(r)));
498
+ return i.status ? x(r + n.length, i.value) : i;
499
+ });
500
+ }, i.promap = function(e, t) {
501
+ return k(e), k(t), this.contramap(e).map(t);
502
+ }, i.skip = function(e) {
503
+ return R(this, e).map(function(e) {
504
+ return e[0];
505
+ });
506
+ }, i.mark = function() {
507
+ return z(Z, this, Z, function(e, t, n) {
508
+ return {
509
+ start: e,
510
+ value: t,
511
+ end: n
512
+ };
513
+ });
514
+ }, i.node = function(e) {
515
+ return z(Z, this, Z, function(t, n, r) {
516
+ return {
517
+ name: e,
518
+ value: n,
519
+ start: t,
520
+ end: r
521
+ };
522
+ });
523
+ }, i.sepBy = function(e) {
524
+ return ae(this, e);
525
+ }, i.sepBy1 = function(e) {
526
+ return V(this, e);
527
+ }, i.lookahead = function(e) {
528
+ return this.skip(K(e));
529
+ }, i.notFollowedBy = function(e) {
530
+ return this.skip(q(e));
531
+ }, i.desc = function(e) {
532
+ y(e) || (e = [e]);
533
+ var t = this;
534
+ return r(function(n, r) {
535
+ var i = t._(n, r);
536
+ return i.status || (i.expected = e), i;
537
+ });
538
+ }, i.fallback = function(e) {
539
+ return this.or(W(e));
540
+ }, i.ap = function(e) {
541
+ return z(e, this, function(e, t) {
542
+ return e(t);
543
+ });
544
+ }, i.chain = function(e) {
545
+ var t = this;
546
+ return r(function(n, r) {
547
+ var i = t._(n, r);
548
+ return i.status ? C(e(i.value)._(n, i.index), i) : i;
549
+ });
550
+ }, i.concat = i.or, i.empty = X, i.of = W, i["fantasy-land/ap"] = i.ap, i["fantasy-land/chain"] = i.chain, i["fantasy-land/concat"] = i.concat, i["fantasy-land/empty"] = i.empty, i["fantasy-land/of"] = i.of, i["fantasy-land/map"] = i.map;
551
+ var Z = r(function(e, t) {
552
+ return x(t, T(e, t));
553
+ }), oe = r(function(e, t) {
554
+ return t >= e.length ? S(t, "any character/byte") : x(t + 1, D(e, t));
555
+ }), se = r(function(e, t) {
556
+ return x(e.length, e.slice(t));
557
+ }), Q = r(function(e, t) {
558
+ return t < e.length ? S(t, "EOF") : x(t, null);
559
+ }), ce = U(/[0-9]/).desc("a digit"), le = U(/[0-9]*/).desc("optional digits"), ue = U(/[a-z]/i).desc("a letter"), de = U(/[a-z]*/i).desc("optional letters"), fe = U(/\s*/).desc("optional whitespace"), pe = U(/\s+/).desc("whitespace"), $ = H("\r"), me = H("\n"), he = H("\r\n"), ge = B(he, me, $).desc("newline"), _e = B(ge, Q);
560
+ r.all = se, r.alt = B, r.any = oe, r.cr = $, r.createLanguage = function(e) {
561
+ var t = {};
562
+ for (var n in e) ({}).hasOwnProperty.call(e, n) && function(n) {
563
+ t[n] = Y(function() {
564
+ return e[n](t);
565
+ });
566
+ }(n);
567
+ return t;
568
+ }, r.crlf = he, r.custom = function(e) {
569
+ return r(e(x, S));
570
+ }, r.digit = ce, r.digits = le, r.empty = X, r.end = _e, r.eof = Q, r.fail = G, r.formatError = I, r.index = Z, r.isParser = v, r.lazy = Y, r.letter = ue, r.letters = de, r.lf = me, r.lookahead = K, r.makeFailure = S, r.makeSuccess = x, r.newline = ge, r.noneOf = function(e) {
571
+ return J(function(t) {
572
+ return e.indexOf(t) < 0;
573
+ }).desc("none of '" + e + "'");
574
+ }, r.notFollowedBy = q, r.of = W, r.oneOf = function(e) {
575
+ for (var t = e.split(""), n = 0; n < t.length; n++) t[n] = "'" + t[n] + "'";
576
+ return J(function(t) {
577
+ return e.indexOf(t) >= 0;
578
+ }).desc(t);
579
+ }, r.optWhitespace = fe, r.Parser = r, r.range = function(e, t) {
580
+ return J(function(n) {
581
+ return e <= n && n <= t;
582
+ }).desc(e + "-" + t);
583
+ }, r.regex = U, r.regexp = U, r.sepBy = ae, r.sepBy1 = V, r.seq = R, r.seqMap = z, r.seqObj = function() {
584
+ for (var e, t = {}, n = 0, i = (e = arguments, Array.prototype.slice.call(e)), a = i.length, o = 0; o < a; o += 1) {
585
+ var s = i[o];
586
+ if (!v(s)) {
587
+ if (y(s) && s.length === 2 && typeof s[0] == "string" && v(s[1])) {
588
+ var c = s[0];
589
+ if (Object.prototype.hasOwnProperty.call(t, c)) throw Error("seqObj: duplicate key " + c);
590
+ t[c] = !0, n++;
591
+ continue;
592
+ }
593
+ throw Error("seqObj arguments must be parsers or [string, parser] array pairs.");
594
+ }
595
+ }
596
+ if (n === 0) throw Error("seqObj expects at least one named parser, found zero");
597
+ return r(function(e, t) {
598
+ for (var n, r = {}, o = 0; o < a; o += 1) {
599
+ var s, c;
600
+ if (y(i[o]) ? (s = i[o][0], c = i[o][1]) : (s = null, c = i[o]), !(n = C(c._(e, t), n)).status) return n;
601
+ s && (r[s] = n.value), t = n.index;
602
+ }
603
+ return C(x(t, r), n);
604
+ });
605
+ }, r.string = H, r.succeed = W, r.takeWhile = function(e) {
606
+ return k(e), r(function(t, n) {
607
+ for (var r = n; r < t.length && e(D(t, r));) r++;
608
+ return x(r, t.slice(n, r));
609
+ });
610
+ }, r.test = J, r.whitespace = pe, r["fantasy-land/empty"] = X, r["fantasy-land/of"] = W, r.Binary = {
611
+ bitSeq: d,
612
+ bitSeqObj: function(e) {
613
+ u();
614
+ var t = {}, n = 0, r = s(function(e) {
615
+ if (y(e)) {
616
+ var r = e;
617
+ if (r.length !== 2) throw Error("[" + r.join(", ") + "] should be length 2, got length " + r.length);
618
+ if (A(r[0]), O(r[1]), Object.prototype.hasOwnProperty.call(t, r[0])) throw Error("duplicate key in bitSeqObj: " + r[0]);
619
+ return t[r[0]] = !0, n++, r;
620
+ }
621
+ return O(e), [null, e];
622
+ }, e);
623
+ if (n < 1) throw Error("bitSeqObj expects at least one named pair, got [" + e.join(", ") + "]");
624
+ var i = s(function(e) {
625
+ return e[0];
626
+ }, r);
627
+ return d(s(function(e) {
628
+ return e[1];
629
+ }, r)).map(function(e) {
630
+ return o(function(e, t) {
631
+ return t[0] !== null && (e[t[0]] = t[1]), e;
632
+ }, {}, s(function(t, n) {
633
+ return [t, e[n]];
634
+ }, i));
635
+ });
636
+ },
637
+ byte: function(e) {
638
+ if (u(), O(e), e > 255) throw Error("Value specified to byte constructor (" + e + "=0x" + e.toString(16) + ") is larger in value than a single byte.");
639
+ var t = (e > 15 ? "0x" : "0x0") + e.toString(16);
640
+ return r(function(n, r) {
641
+ var i = D(n, r);
642
+ return i === e ? x(r + 1, i) : S(r, t);
643
+ });
644
+ },
645
+ buffer: function(e) {
646
+ return f("buffer", e).map(function(e) {
647
+ return Buffer.from(e);
648
+ });
649
+ },
650
+ encodedString: function(e, t) {
651
+ return f("string", t).map(function(t) {
652
+ return t.toString(e);
653
+ });
654
+ },
655
+ uintBE: m,
656
+ uint8BE: m(1),
657
+ uint16BE: m(2),
658
+ uint32BE: m(4),
659
+ uintLE: h,
660
+ uint8LE: h(1),
661
+ uint16LE: h(2),
662
+ uint32LE: h(4),
663
+ intBE: g,
664
+ int8BE: g(1),
665
+ int16BE: g(2),
666
+ int32BE: g(4),
667
+ intLE: _,
668
+ int8LE: _(1),
669
+ int16LE: _(2),
670
+ int32LE: _(4),
671
+ floatBE: f("floatBE", 4).map(function(e) {
672
+ return e.readFloatBE(0);
673
+ }),
674
+ floatLE: f("floatLE", 4).map(function(e) {
675
+ return e.readFloatLE(0);
676
+ }),
677
+ doubleBE: f("doubleBE", 8).map(function(e) {
678
+ return e.readDoubleBE(0);
679
+ }),
680
+ doubleLE: f("doubleLE", 8).map(function(e) {
681
+ return e.readDoubleLE(0);
682
+ })
683
+ }, e.exports = r;
684
+ }]);
685
+ });
686
+ })))(), PropParser = class e {
687
+ #e = null;
688
+ constructor(e, r = "\\") {
689
+ this.val = e;
690
+ function i(e) {
691
+ let t = [];
692
+ for (let r of e) t.push((typeof r == "string" ? (0, import_parsimmon_umd_min.string)(r) : (0, import_parsimmon_umd_min.regex)(r)).trim(import_parsimmon_umd_min.optWhitespace));
693
+ return (0, import_parsimmon_umd_min.alt)(...t);
694
+ }
695
+ function a(e) {
696
+ return (0, import_parsimmon_umd_min.alt)(...Object.keys(e).sort().map((t) => (typeof e[t] == "string" ? (0, import_parsimmon_umd_min.string)(e[t]) : (0, import_parsimmon_umd_min.regex)(e[t])).trim(import_parsimmon_umd_min.optWhitespace).result(t)));
697
+ }
698
+ function o(e, t) {
699
+ let r = (0, import_parsimmon_umd_min.lazy)(() => (0, import_parsimmon_umd_min.seq)(e, r).or(t));
700
+ return r;
701
+ }
702
+ function s(e, t) {
703
+ return (0, import_parsimmon_umd_min.seqMap)(t, e.many(), (e, t) => t.reduce((e, t) => [t, e], e));
704
+ }
705
+ function c(e, t) {
706
+ let r = (0, import_parsimmon_umd_min.lazy)(() => t.chain((t) => (0, import_parsimmon_umd_min.seq)(e, (0, import_parsimmon_umd_min.of)(t), r).or((0, import_parsimmon_umd_min.of)(t))));
707
+ return r;
708
+ }
709
+ function l(e, t) {
710
+ return (0, import_parsimmon_umd_min.seqMap)(t, (0, import_parsimmon_umd_min.seq)(e, t).many(), (e, t) => t.reduce((e, t) => [
711
+ t[0],
712
+ e,
713
+ t[1]
714
+ ], e));
715
+ }
716
+ let u = (0, import_parsimmon_umd_min.alt)((0, import_parsimmon_umd_min.alt)((0, import_parsimmon_umd_min.regex)(/-?(0|[1-9][0-9]*)\.[0-9]+/), (0, import_parsimmon_umd_min.regex)(/0x[0-9a-fA-F]+/)).map(Number), (0, import_parsimmon_umd_min.alt)((0, import_parsimmon_umd_min.regex)(/-?(0|[1-9][0-9]*)/)).map((e) => int(e))).map((e) => ["!num!", e]).desc("number"), d = (0, import_parsimmon_umd_min.string)("null").map(() => ["!str!", null]), f = (0, import_parsimmon_umd_min.regex)(/(true|false)/).map((e) => ["!bool!", e === "true"]).desc("boolean"), p = (0, import_parsimmon_umd_min.regex)(/* @__PURE__ */ RegExp(`(?:"(?:\\${r}["'#\\n]|[^"])*"|'(?:\\${r}["'#\\n]|[^'])*'|\\#(?:\\${r}["'#\\n]|[^#])*\\#)`)).map((e) => ["!str!", e.slice(1, -1).replaceAll(r, "")]).desc("string"), m = /\[[^\]]+\]/g, h = (0, import_parsimmon_umd_min.regex)(/-?(?:(?:tmp|sys|save|mp):)?[^\s!-/:-@[-^`{-~]+(?:\.[^\s!-/:-@[-^`{-~]+|\[[^\]]+\])*(?:@str)?/).map((e) => {
717
+ let t = e.replaceAll(m, (e) => "." + this.parse(e.slice(1, -1))), n = this.val.getVal(t);
718
+ return n == null ? ["!str!", n] : typeof n == "boolean" ? ["!bool!", n] : Object.prototype.toString.call(n) === "[object String]" ? ["!str!", String(n)] : ["!num!", Number(n)];
719
+ }).desc("string"), g = (0, import_parsimmon_umd_min.lazy)(() => (0, import_parsimmon_umd_min.string)("(").then(this.#e).skip((0, import_parsimmon_umd_min.string)(")")).or(u).or(d).or(f).or(p).or(h));
720
+ this.#e = [
721
+ {
722
+ type: o,
723
+ ops: i([/[A-Za-z_][A-Za-z0-9_]*(?=\()/])
724
+ },
725
+ {
726
+ type: s,
727
+ ops: a({ PostfixInc: "++" })
728
+ },
729
+ {
730
+ type: s,
731
+ ops: a({ PostfixDec: "--" })
732
+ },
733
+ {
734
+ type: o,
735
+ ops: i([/!(?!=)|~/])
736
+ },
737
+ {
738
+ type: o,
739
+ ops: a({ PrefixInc: "++" })
740
+ },
741
+ {
742
+ type: o,
743
+ ops: a({ PrefixDec: "--" })
744
+ },
745
+ {
746
+ type: o,
747
+ ops: a({ UnaryNegate: /-(?!-)/ })
748
+ },
749
+ {
750
+ type: c,
751
+ ops: i(["**"])
752
+ },
753
+ {
754
+ type: l,
755
+ ops: i([
756
+ "*",
757
+ "/",
758
+ "¥",
759
+ "%"
760
+ ])
761
+ },
762
+ {
763
+ type: l,
764
+ ops: i(["+", "-"])
765
+ },
766
+ {
767
+ type: l,
768
+ ops: i([/>>>|<<|>>/])
769
+ },
770
+ {
771
+ type: l,
772
+ ops: i([/<=|<|>=|>/])
773
+ },
774
+ {
775
+ type: l,
776
+ ops: i([/===|!==|==|!=/])
777
+ },
778
+ {
779
+ type: l,
780
+ ops: i([/&(?!&)/])
781
+ },
782
+ {
783
+ type: l,
784
+ ops: i(["^"])
785
+ },
786
+ {
787
+ type: l,
788
+ ops: i([/\|(?!\|)/])
789
+ },
790
+ {
791
+ type: l,
792
+ ops: i(["&&"])
793
+ },
794
+ {
795
+ type: l,
796
+ ops: i(["||"])
797
+ },
798
+ {
799
+ type: c,
800
+ ops: i([":"])
801
+ },
802
+ {
803
+ type: c,
804
+ ops: i(["?"])
805
+ }
806
+ ].reduce((e, t) => t.type(t.ops, e), g).trim(import_parsimmon_umd_min.optWhitespace);
807
+ }
808
+ parse(e) {
809
+ let t = this.#e.parse(e);
810
+ if (!t.status) throw Error("(PropParser)文法エラー【" + e + "】");
811
+ let n = t.value;
812
+ return n[0] === "!str!" ? this.#a(n[1]) : this.#t(n);
813
+ }
814
+ #t(e) {
815
+ let t = e.shift();
816
+ if (t instanceof Array) return this.#t(t);
817
+ let n = this.#n[t];
818
+ return n ? n(e) : Object(null);
819
+ }
820
+ #n = {
821
+ "!num!": (e) => e.shift(),
822
+ "!str!": (e) => this.#a(e.shift()),
823
+ "!bool!": (e) => e.shift(),
824
+ PostfixInc: (e) => {
825
+ throw Error("(PropParser)後置インクリメントは未サポートです");
826
+ },
827
+ PostfixDec: (e) => {
828
+ throw Error("(PropParser)後置デクリメントは未サポートです");
829
+ },
830
+ PrefixInc: (e) => {
831
+ throw Error("(PropParser)前置インクリメントは未サポートです");
832
+ },
833
+ PrefixDec: (e) => {
834
+ throw Error("(PropParser)前置デクリメントは未サポートです");
835
+ },
836
+ "!": (e) => !this.#n.Boolean(e),
837
+ "~": (e) => ~Number(this.#t(e.shift())),
838
+ UnaryNegate: (e) => -this.#n.Number(e),
839
+ "**": (e) => Number(this.#t(e.shift())) ** Number(this.#t(e.shift())),
840
+ "*": (e) => Number(this.#t(e.shift())) * Number(this.#t(e.shift())),
841
+ "/": (e) => Number(this.#t(e.shift())) / Number(this.#t(e.shift())),
842
+ "¥": (e) => Math.floor(this.#n["/"](e)),
843
+ "%": (e) => Number(this.#t(e.shift())) % Number(this.#t(e.shift())),
844
+ "+": (e) => {
845
+ let t = this.#t(e.shift()), n = this.#t(e.shift());
846
+ return Object.prototype.toString.call(t) === "[object String]" || Object.prototype.toString.call(n) === "[object String]" ? String(t) + String(n) : Number(t) + Number(n);
847
+ },
848
+ "-": (e) => Number(this.#t(e.shift())) - Number(this.#t(e.shift())),
849
+ int: (e) => int(this.#r(e.shift())),
850
+ parseInt: (e) => int(this.#n.Number(e)),
851
+ Number: (e) => {
852
+ let t = this.#t(e.shift());
853
+ return Object.prototype.toString.call(t) === "[object String]" ? this.#r(this.#e.parse(String(t)).value) : Number(t);
854
+ },
855
+ Boolean: (e) => {
856
+ let t = e.shift();
857
+ return t[0] === "!bool!" ? !!t[1] : !!this.#t(t);
858
+ },
859
+ ceil: (e) => Math.ceil(this.#r(e.shift())),
860
+ floor: (e) => Math.floor(this.#r(e.shift())),
861
+ round: (e) => Math.round(this.#r(e.shift())),
862
+ isNaN: (e) => Number.isNaN(this.#r(e.shift())),
863
+ "<<": (e) => Number(this.#t(e.shift())) << Number(this.#t(e.shift())),
864
+ ">>": (e) => Number(this.#t(e.shift())) >> Number(this.#t(e.shift())),
865
+ ">>>": (e) => Number(this.#t(e.shift())) >>> Number(this.#t(e.shift())),
866
+ "<": (e) => Number(this.#t(e.shift())) < Number(this.#t(e.shift())),
867
+ "<=": (e) => Number(this.#t(e.shift())) <= Number(this.#t(e.shift())),
868
+ ">": (e) => Number(this.#t(e.shift())) > Number(this.#t(e.shift())),
869
+ ">=": (e) => Number(this.#t(e.shift())) >= Number(this.#t(e.shift())),
870
+ "==": (e) => {
871
+ let t = this.#t(e.shift()), n = this.#t(e.shift());
872
+ return t == null && n == null ? t == n : String(t) === String(n);
873
+ },
874
+ "!=": (e) => !this.#n["=="](e),
875
+ "===": (e) => {
876
+ let t = this.#t(e.shift()), n = this.#t(e.shift());
877
+ return Object.prototype.toString.call(t) == Object.prototype.toString.call(n) ? String(t) === String(n) : !1;
878
+ },
879
+ "!==": (e) => !this.#n["==="](e),
880
+ "&": (e) => Number(this.#t(e.shift())) & Number(this.#t(e.shift())),
881
+ "^": (e) => Number(this.#t(e.shift())) ^ Number(this.#t(e.shift())),
882
+ "|": (e) => Number(this.#t(e.shift())) | Number(this.#t(e.shift())),
883
+ "&&": (e) => String(this.#t(e.shift())) === "true" && String(this.#t(e.shift())) === "true",
884
+ "||": (e) => String(this.#t(e.shift())) === "true" || String(this.#t(e.shift())) === "true",
885
+ "?": (e) => {
886
+ let t = this.#n.Boolean(e), n = e.shift();
887
+ if (n[0] !== ":") throw Error("(PropParser)三項演算子の文法エラーです。: が見つかりません");
888
+ return this.#t(n[t ? 1 : 2]);
889
+ },
890
+ ":": () => {
891
+ throw Error("(PropParser)三項演算子の文法エラーです。? が見つかりません");
892
+ }
893
+ };
894
+ #r(e) {
895
+ let t = this.#t(e);
896
+ if (Object.prototype.toString.call(t) !== "[object Number]") throw Error("(PropParser)引数【" + String(t) + "】が数値ではありません");
897
+ return Number(t);
898
+ }
899
+ #i = /(\$((tmp|sys|save|mp):)?[^\s!--/:-@[-^`{-~]+|#\{[^}]+})/g;
900
+ #a(e) {
901
+ return e == null ? e : String(e).replaceAll(this.#i, (e) => String(e.startsWith("$") ? this.val.getVal(e.slice(1)) : this.parse(e.slice(2, -1))));
902
+ }
903
+ getValAmpersand = (e) => e.startsWith("&") ? String(this.parse(e.slice(1))) : e;
904
+ static #o = /^((?<scope>\w+?):)?(?<name>[^\s :@]+)(?<at>@str)?$/;
905
+ static getValName(t) {
906
+ let n = this.#o.exec(t.trim())?.groups;
907
+ if (!n) return null;
908
+ let { scope: r = "tmp", name: i, at: a = "" } = n;
909
+ if (!e.#s.includes(r)) throw `[変数に値セット] scopeが異常【${r}】です`;
910
+ return {
911
+ scope: r,
912
+ name: e.#c(i),
913
+ at: a
914
+ };
915
+ }
916
+ static #s = [
917
+ "tmp",
918
+ "sys",
919
+ "save",
920
+ "mp"
921
+ ];
922
+ static #c(e) {
923
+ let t = 0, n = 0, r = e;
924
+ for (;;) {
925
+ if (t = r.indexOf("[\""), t < 0) {
926
+ if (t = r.indexOf("['"), t < 0) break;
927
+ n = r.indexOf("']", t + 2);
928
+ } else n = r.indexOf("\"]", t + 2);
929
+ if (n < 0) break;
930
+ r = r.slice(0, t) + "." + r.slice(t + 2, n) + r.slice(n + 2), t = n - 2;
931
+ }
932
+ return r;
933
+ }
834
934
  };
835
- //# sourceMappingURL=PropParser.js.map
935
+ export { PropParser };
936
+
937
+ //# sourceMappingURL=PropParser.js.map