@famibee/skynovel 2.0.2 → 2.0.3
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/dist/Button.js +36 -34
- package/dist/Button.js.map +1 -1
- package/dist/CallStack.js +11 -6
- package/dist/CallStack.js.map +1 -1
- package/dist/CmnInterface.js +13 -11
- package/dist/CmnInterface.js.map +1 -1
- package/dist/CmnLib.js +58 -56
- package/dist/CmnLib.js.map +1 -1
- package/dist/Config.js +9 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigBase.js +52 -49
- package/dist/ConfigBase.js.map +1 -1
- package/dist/DebugMng.js +9 -6
- package/dist/DebugMng.js.map +1 -1
- package/dist/EventListenerCtn.js +6 -4
- package/dist/EventListenerCtn.js.map +1 -1
- package/dist/EventMng.js +522 -417
- package/dist/EventMng.js.map +1 -1
- package/dist/Grammar.js +22 -20
- package/dist/Grammar.js.map +1 -1
- package/dist/GrpLayer.js +58 -57
- package/dist/GrpLayer.js.map +1 -1
- package/dist/Layer.js +66 -64
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMng.js +461 -441
- package/dist/LayerMng.js.map +1 -1
- package/dist/Main.js +69 -67
- package/dist/Main.js.map +1 -1
- package/dist/PropParser.js +23 -19
- package/dist/PropParser.js.map +1 -1
- package/dist/Reading.js +422 -418
- package/dist/Reading.js.map +1 -1
- package/dist/RubySpliter.js +4 -2
- package/dist/RubySpliter.js.map +1 -1
- package/dist/ScriptIterator.js +374 -370
- package/dist/ScriptIterator.js.map +1 -1
- package/dist/SndBuf.js +643 -622
- package/dist/SndBuf.js.map +1 -1
- package/dist/SoundMng.js +59 -60
- package/dist/SoundMng.js.map +1 -1
- package/dist/SpritesMng.js +135 -129
- package/dist/SpritesMng.js.map +1 -1
- package/dist/SysBase.js +985 -950
- package/dist/SysBase.js.map +1 -1
- package/dist/TxtLayer.js +558 -551
- package/dist/TxtLayer.js.map +1 -1
- package/dist/Variable.js +47 -45
- package/dist/Variable.js.map +1 -1
- package/dist/chunk.js +11 -9
- package/dist/gamepad.js +396 -660
- package/dist/gamepad.js.map +1 -1
- package/dist/pixi.js +2631 -2593
- package/dist/pixi.js.map +1 -1
- package/dist/platform.js +6 -4
- package/dist/platform.js.map +1 -1
- package/dist/rolldown-runtime.js +20 -0
- package/dist/web.js +418 -418
- package/dist/web.js.map +1 -1
- package/dist_app/Button.js +36 -34
- package/dist_app/Button.js.map +1 -1
- package/dist_app/CallStack.js +11 -6
- package/dist_app/CallStack.js.map +1 -1
- package/dist_app/CmnInterface.js +13 -11
- package/dist_app/CmnInterface.js.map +1 -1
- package/dist_app/CmnLib.js +58 -56
- package/dist_app/CmnLib.js.map +1 -1
- package/dist_app/Config.js +9 -7
- package/dist_app/Config.js.map +1 -1
- package/dist_app/ConfigBase.js +52 -49
- package/dist_app/ConfigBase.js.map +1 -1
- package/dist_app/DebugMng.js +9 -6
- package/dist_app/DebugMng.js.map +1 -1
- package/dist_app/EventListenerCtn.js +6 -4
- package/dist_app/EventListenerCtn.js.map +1 -1
- package/dist_app/EventMng.js +522 -417
- package/dist_app/EventMng.js.map +1 -1
- package/dist_app/Grammar.js +22 -20
- package/dist_app/Grammar.js.map +1 -1
- package/dist_app/GrpLayer.js +58 -57
- package/dist_app/GrpLayer.js.map +1 -1
- package/dist_app/Layer.js +66 -64
- package/dist_app/Layer.js.map +1 -1
- package/dist_app/LayerMng.js +461 -441
- package/dist_app/LayerMng.js.map +1 -1
- package/dist_app/Main.js +69 -67
- package/dist_app/Main.js.map +1 -1
- package/dist_app/PropParser.js +23 -19
- package/dist_app/PropParser.js.map +1 -1
- package/dist_app/Reading.js +422 -418
- package/dist_app/Reading.js.map +1 -1
- package/dist_app/RubySpliter.js +4 -2
- package/dist_app/RubySpliter.js.map +1 -1
- package/dist_app/ScriptIterator.js +374 -370
- package/dist_app/ScriptIterator.js.map +1 -1
- package/dist_app/SndBuf.js +643 -622
- package/dist_app/SndBuf.js.map +1 -1
- package/dist_app/SoundMng.js +59 -60
- package/dist_app/SoundMng.js.map +1 -1
- package/dist_app/SpritesMng.js +135 -129
- package/dist_app/SpritesMng.js.map +1 -1
- package/dist_app/SysBase.js +985 -950
- package/dist_app/SysBase.js.map +1 -1
- package/dist_app/TxtLayer.js +558 -551
- package/dist_app/TxtLayer.js.map +1 -1
- package/dist_app/Variable.js +47 -45
- package/dist_app/Variable.js.map +1 -1
- package/dist_app/app.js +62 -63
- package/dist_app/app.js.map +1 -1
- package/dist_app/appMain.js +11 -11
- package/dist_app/appMain.js.map +1 -1
- package/dist_app/chunk.js +11 -9
- package/dist_app/gamepad.js +396 -660
- package/dist_app/gamepad.js.map +1 -1
- package/dist_app/pixi.js +2028 -1990
- package/dist_app/pixi.js.map +1 -1
- package/dist_app/platform.js +6 -4
- package/dist_app/platform.js.map +1 -1
- package/dist_app/preload.js +1 -1
- package/dist_app/preload.js.map +1 -1
- package/dist_app/rolldown-runtime.js +20 -0
- package/package.json +20 -21
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { t as
|
|
3
|
-
import { c as
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { a as e, d as t, l as n, s as r, t as i } from "./CmnLib.js";
|
|
2
|
+
import { t as a } from "./CmnInterface.js";
|
|
3
|
+
import { c as o } from "./pixi.js";
|
|
4
|
+
import { n as s } from "./ConfigBase.js";
|
|
5
|
+
import { t as c } from "./DebugMng.js";
|
|
6
|
+
import { n as l, r as u, t as d } from "./Reading.js";
|
|
7
|
+
import { t as f } from "./RubySpliter.js";
|
|
8
|
+
import { a as p, i as m, r as h, t as g } from "./Grammar.js";
|
|
9
|
+
import { n as _, r as v, t as y } from "./CallStack.js";
|
|
10
|
+
import "./SndBuf.js";
|
|
11
|
+
//#region src/sn/ScriptIterator.ts
|
|
12
|
+
var b = class b {
|
|
13
|
+
cfg;
|
|
14
|
+
hTag;
|
|
15
|
+
main;
|
|
16
|
+
val;
|
|
17
|
+
prpPrs;
|
|
18
|
+
sndMng;
|
|
19
|
+
sys;
|
|
17
20
|
#e = {
|
|
18
21
|
aToken: [""],
|
|
19
22
|
len: 1,
|
|
@@ -42,28 +45,28 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
42
45
|
}
|
|
43
46
|
#i = [];
|
|
44
47
|
#a;
|
|
45
|
-
#o = new
|
|
46
|
-
constructor(e,
|
|
47
|
-
this.cfg = e, this.hTag =
|
|
48
|
+
#o = new p();
|
|
49
|
+
constructor(e, t, n, r, a, o, s) {
|
|
50
|
+
this.cfg = e, this.hTag = t, this.main = n, this.val = r, this.prpPrs = a, this.sndMng = o, this.sys = s, t.let_ml = (e) => this.#k(e), t.endlet_ml = () => !1, t.dump_stack = () => this.#A(), t.dump_script = (e) => this.#M(e), t.else = t.elsif = t.endif = () => this.#z(), t.if = (e) => this.#B(e), t.call = (e) => this.#V(e), t.jump = (e) => this.#U(e), t.pop_stack = (e) => this.#W(e), t.return = (e) => this.#G(e), t.bracket2macro = (e) => this.#fe(e), t.char2macro = (e) => this.#pe(e), t.endmacro = (e) => this.#G(e), t.macro = (e) => this.#he(e), t.load = (e) => this.#ve(e), t.reload_script = (e) => this.#ye(e), t.record_place = () => this.#xe(), t.save = (e) => this.#Se(e), e.oCfg.debug.token && (this.#Z = (e) => {
|
|
48
51
|
e.trim() !== "" && console.log(`🌱 トークン ${this.#t}:${String(this.#r)} (i:${String(this.#n)} cs:${String(this.#i.length)}) %c【${e}】`, "background-color:#350;");
|
|
49
|
-
}), e.oCfg.debug.tag && (this.#S = (e) => console.log(`🌲 タグ解析 ${this.#t}:${String(this.#r)} (i:${String(this.#n)} cs:${String(this.#i.length)}) %c[${e} %o]`, "background-color:#30B;", this.#o.hPrm)),
|
|
50
|
-
let
|
|
51
|
-
if (this.#a.setEscape(
|
|
52
|
-
this.#c,
|
|
52
|
+
}), e.oCfg.debug.tag && (this.#S = (e) => console.log(`🌲 タグ解析 ${this.#t}:${String(this.#r)} (i:${String(this.#n)} cs:${String(this.#i.length)}) %c[${e} %o]`, "background-color:#30B;", this.#o.hPrm)), r.defTmp("const.sn.aIfStk.length", () => this.#R.length), r.defTmp("const.sn.vctCallStk.length", () => this.#i.length), this.#a = new g(e);
|
|
53
|
+
let c = e.oCfg.init.escape;
|
|
54
|
+
if (this.#a.setEscape(c), f.setEscape(c), i.isDbg) {
|
|
55
|
+
this.#c, s.addHook((e, t) => this.#c[e]?.(t)), this.isBreak = (e) => this.#y(e);
|
|
53
56
|
let e = () => this.analyzeInit();
|
|
54
57
|
this.analyzeInit = () => {
|
|
55
58
|
this.analyzeInit = () => {}, this.sys.send2Dbg("hi", {});
|
|
56
|
-
}, this.#c.auth = (
|
|
57
|
-
let
|
|
58
|
-
for (let [e,
|
|
59
|
-
|
|
60
|
-
for (let e of
|
|
61
|
-
if (
|
|
62
|
-
let
|
|
63
|
-
for (;
|
|
64
|
-
let e =
|
|
65
|
-
if (e === 91 || e === 38 || e === 42 &&
|
|
66
|
-
e === 10 && (this.#r +=
|
|
59
|
+
}, this.#c.auth = (t) => {
|
|
60
|
+
let n = t.hBreakpoint.hFn2hLineBP;
|
|
61
|
+
for (let [e, t] of Object.entries(n)) this.#s(e, t);
|
|
62
|
+
b.#_ = {};
|
|
63
|
+
for (let e of t.hBreakpoint.aFunc) b.#_[e.name] = 1;
|
|
64
|
+
if (t.stopOnEntry) {
|
|
65
|
+
let t;
|
|
66
|
+
for (; t = this.nextToken();) {
|
|
67
|
+
let e = t.charCodeAt(0);
|
|
68
|
+
if (e === 91 || e === 38 || e === 42 && t.length === 1) break;
|
|
69
|
+
e === 10 && (this.#r += t.length);
|
|
67
70
|
}
|
|
68
71
|
this.sys.callHook("stopOnEntry", {}), this.analyzeInit = e, this.analyzeInit();
|
|
69
72
|
} else this.noticeWait = () => {
|
|
@@ -73,8 +76,8 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
73
76
|
} else this.recodeDesign = () => {};
|
|
74
77
|
}
|
|
75
78
|
noticeWait = () => {};
|
|
76
|
-
#s(e,
|
|
77
|
-
|
|
79
|
+
#s(e, t) {
|
|
80
|
+
b.#g[this.#u(e)] = t;
|
|
78
81
|
}
|
|
79
82
|
destroy() {
|
|
80
83
|
this.isBreak = this.#xe = () => !1;
|
|
@@ -82,18 +85,18 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
82
85
|
#c = {
|
|
83
86
|
auth: () => {},
|
|
84
87
|
disconnect: () => {
|
|
85
|
-
|
|
88
|
+
b.#g = {}, b.#_ = {}, this.isBreak = () => !1, this.#c.continue({}), this.#v = 0;
|
|
86
89
|
},
|
|
87
90
|
restart: () => {
|
|
88
91
|
this.isBreak = () => !1;
|
|
89
92
|
},
|
|
90
93
|
add_break: (e) => this.#s(e.fn, e.o),
|
|
91
94
|
data_break: (e) => {
|
|
92
|
-
this.#v ===
|
|
95
|
+
this.#v === 0 && (this.#v = 1, this.main.setLoop(!1, `変数 ${String(e.dataId)}【${String(e.old_v)}】→【${String(e.new_v)}】データブレーク`), this.sys.callHook("stopOnDataBreakpoint", {}), this.sys.send2Dbg("stopOnDataBreakpoint", {}));
|
|
93
96
|
},
|
|
94
97
|
set_func_break: (e) => {
|
|
95
|
-
|
|
96
|
-
for (let
|
|
98
|
+
b.#_ = {};
|
|
99
|
+
for (let t of e.a) b.#_[t.name] = 1;
|
|
97
100
|
this.sys.send2Dbg(e.ri, {});
|
|
98
101
|
},
|
|
99
102
|
stack: (e) => this.sys.send2Dbg(e.ri, { a: this.#x() }),
|
|
@@ -101,161 +104,161 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
101
104
|
this.sys.send2Dbg(e.ri, { v: this.prpPrs.parse(e.txt) });
|
|
102
105
|
},
|
|
103
106
|
continue: () => {
|
|
104
|
-
this.#h() || (this.#n -= this.#m, this.#v =
|
|
107
|
+
this.#h() || (this.#n -= this.#m, this.#v = 3, this.main.setLoop(!0), this.main.resume());
|
|
105
108
|
},
|
|
106
109
|
stepover: (e) => this.#d(e),
|
|
107
110
|
stepin: () => {
|
|
108
111
|
if (this.#h()) return;
|
|
109
112
|
let e = this.#e.aToken[this.#n - this.#m];
|
|
110
|
-
this.sys.callHook(`stopOnStep${this.#_e.test(e ?? "") ? "In" : ""}`, {}), this.#n -= this.#m, this.#v = this.#v ===
|
|
113
|
+
this.sys.callHook(`stopOnStep${this.#_e.test(e ?? "") ? "In" : ""}`, {}), this.#n -= this.#m, this.#v = this.#v === 1 ? 4 : 5, this.main.setLoop(!0), this.main.resume();
|
|
111
114
|
},
|
|
112
115
|
stepout: (e) => {
|
|
113
116
|
this.#h() || (this.#i.length > 0 ? this.#f(!0) : this.#d(e));
|
|
114
117
|
},
|
|
115
118
|
pause: () => {
|
|
116
|
-
this.#v =
|
|
119
|
+
this.#v = 4, this.main.setLoop(!1, "一時停止"), this.sys.send2Dbg("stopOnStep", {});
|
|
117
120
|
},
|
|
118
121
|
stopOnEntry: () => {
|
|
119
|
-
this.#v =
|
|
122
|
+
this.#v = 4, this.main.setLoop(!1, "一時停止"), this.sys.send2Dbg("stopOnEntry", {});
|
|
120
123
|
}
|
|
121
124
|
};
|
|
122
|
-
#l = (e) => this.cfg.searchPath(e,
|
|
125
|
+
#l = (e) => this.cfg.searchPath(e, s.SCRIPT);
|
|
123
126
|
#u = (e) => this.sys.pathBaseCnvSnPath4Dbg + this.#l(e);
|
|
124
127
|
#d(e) {
|
|
125
128
|
if (this.#h()) return;
|
|
126
|
-
let
|
|
127
|
-
this.#_e.test(
|
|
129
|
+
let t = this.#e.aToken[this.#n - this.#m];
|
|
130
|
+
this.#_e.test(t ?? "") ? this.#f(!1) : (this.sys.callHook("stopOnStep", {}), this.#c.stepin(e));
|
|
128
131
|
}
|
|
129
132
|
#f(e) {
|
|
130
|
-
this.sys.callHook(`stopOnStep${e ? "Out" : ""}`, {}), this.#p = this.#i.length -
|
|
133
|
+
this.sys.callHook(`stopOnStep${e ? "Out" : ""}`, {}), this.#p = this.#i.length - +!!e, this.#n -= this.#m, this.#v = e ? 7 : 6, this.main.setLoop(!0), this.main.resume();
|
|
131
134
|
}
|
|
132
135
|
#p = 0;
|
|
133
136
|
get #m() {
|
|
134
|
-
return this.#v ===
|
|
137
|
+
return +(this.#v === 2 || this.#v === 4);
|
|
135
138
|
}
|
|
136
139
|
#h() {
|
|
137
140
|
return this.#n < this.#e.len ? !1 : (this.sys.callHook("stopOnEntry", {}), this.main.setLoop(!1, "スクリプト終端です isIdxOverLast"), !0);
|
|
138
141
|
}
|
|
139
142
|
static #g = {};
|
|
140
143
|
static #_ = {};
|
|
141
|
-
#v =
|
|
144
|
+
#v = 0;
|
|
142
145
|
isBreak = (e) => !1;
|
|
143
146
|
#y(e) {
|
|
144
147
|
switch (this.#v) {
|
|
145
|
-
case
|
|
146
|
-
this.#b(), this.#v =
|
|
148
|
+
case 6:
|
|
149
|
+
this.#b(), this.#v = 7;
|
|
147
150
|
break;
|
|
148
|
-
case
|
|
151
|
+
case 7:
|
|
149
152
|
if (this.#i.length !== this.#p) break;
|
|
150
|
-
return this.#v =
|
|
151
|
-
case
|
|
152
|
-
this.#b(), this.#v =
|
|
153
|
+
return this.#v = 4, this.main.setLoop(!1, "ステップ実行"), this.sys.send2Dbg("stopOnStep", {}), !0;
|
|
154
|
+
case 5:
|
|
155
|
+
this.#b(), this.#v = 4;
|
|
153
156
|
break;
|
|
154
|
-
case
|
|
155
|
-
case
|
|
156
|
-
this.#b(), this.#v =
|
|
157
|
+
case 4: return this.#b(), this.main.setLoop(!1, "ステップ実行"), this.sys.send2Dbg("stopOnStep", {}), !0;
|
|
158
|
+
case 3:
|
|
159
|
+
this.#b(), this.#v = 0;
|
|
157
160
|
break;
|
|
158
161
|
default:
|
|
159
|
-
if (
|
|
162
|
+
if (h(e) in b.#_) return this.#v = 2, this.main.setLoop(!1, `関数 ${e} ブレーク`), this.sys.callHook("stopOnBreakpoint", {}), this.sys.send2Dbg("stopOnBreakpoint", {}), !0;
|
|
160
163
|
{
|
|
161
|
-
let e =
|
|
164
|
+
let e = b.#g[this.#u(this.#t)];
|
|
162
165
|
if (!e) break;
|
|
163
|
-
let
|
|
164
|
-
if (!
|
|
165
|
-
if (
|
|
166
|
-
if (!this.prpPrs.parse(
|
|
167
|
-
} else if ("hitCondition" in
|
|
168
|
-
let
|
|
169
|
-
this.#v =
|
|
170
|
-
let
|
|
171
|
-
this.sys.callHook(
|
|
166
|
+
let t = e[this.#r];
|
|
167
|
+
if (!t) break;
|
|
168
|
+
if (t.condition) {
|
|
169
|
+
if (!this.prpPrs.parse(t.condition)) break;
|
|
170
|
+
} else if ("hitCondition" in t && --t.hitCondition > 0) break;
|
|
171
|
+
let n = this.#v === 0;
|
|
172
|
+
this.#v = 2, this.main.setLoop(!1, n ? (t.condition ? "条件" : "ヒットカウント") + "ブレーク" : "ステップ実行");
|
|
173
|
+
let r = n ? "stopOnBreakpoint" : "stopOnStep";
|
|
174
|
+
this.sys.callHook(r, {}), this.sys.send2Dbg(r, {});
|
|
172
175
|
}
|
|
173
176
|
return !0;
|
|
174
177
|
}
|
|
175
178
|
return !1;
|
|
176
179
|
}
|
|
177
180
|
#b() {
|
|
178
|
-
let e =
|
|
181
|
+
let e = b.#g[t(this.#t)]?.[this.#r];
|
|
179
182
|
e?.hitCondition && --e.hitCondition;
|
|
180
183
|
}
|
|
181
184
|
#x() {
|
|
182
|
-
let e = this.#v ===
|
|
185
|
+
let e = +(this.#v === 3), t = this.#e.aToken[this.#n - 1 + e], n = this.#u(this.#t), r = h(t), i = r ? `[${r}]` : t, a = String(this.val.getVal("mp:const.sn.macro") ?? "{}");
|
|
183
186
|
if (this.#n === 0) return [{
|
|
184
|
-
fn:
|
|
187
|
+
fn: n,
|
|
185
188
|
ln: 1,
|
|
186
189
|
col: 1,
|
|
187
|
-
nm:
|
|
188
|
-
ma:
|
|
190
|
+
nm: i,
|
|
191
|
+
ma: a
|
|
189
192
|
}];
|
|
190
|
-
let
|
|
191
|
-
fn:
|
|
192
|
-
ln:
|
|
193
|
-
col:
|
|
194
|
-
nm:
|
|
195
|
-
ma:
|
|
196
|
-
}],
|
|
197
|
-
if (
|
|
198
|
-
for (let e =
|
|
199
|
-
let
|
|
200
|
-
if (!
|
|
201
|
-
let
|
|
202
|
-
if (!
|
|
203
|
-
let
|
|
204
|
-
|
|
205
|
-
fn: this.#u(
|
|
206
|
-
ln:
|
|
207
|
-
col:
|
|
208
|
-
nm:
|
|
209
|
-
ma:
|
|
193
|
+
let o = this.#j(this.#e, this.#n), s = [{
|
|
194
|
+
fn: n,
|
|
195
|
+
ln: o.ln,
|
|
196
|
+
col: o.col_s + 1,
|
|
197
|
+
nm: i,
|
|
198
|
+
ma: a
|
|
199
|
+
}], c = this.#i.length;
|
|
200
|
+
if (c === 0) return s;
|
|
201
|
+
for (let e = c - 1; e >= 0; --e) {
|
|
202
|
+
let t = this.#i[e], n = this.#re[t.fn];
|
|
203
|
+
if (!n) continue;
|
|
204
|
+
let r = n.aToken[t.idx - 1];
|
|
205
|
+
if (!r) continue;
|
|
206
|
+
let i = this.#j(n, t.idx), a = h(r);
|
|
207
|
+
s.push({
|
|
208
|
+
fn: this.#u(t.fn),
|
|
209
|
+
ln: i.ln,
|
|
210
|
+
col: i.col_s + 1,
|
|
211
|
+
nm: a ? `[${a}]` : r,
|
|
212
|
+
ma: t.csArg[":hMp"]["const.sn.macro"]
|
|
210
213
|
});
|
|
211
214
|
}
|
|
212
|
-
return
|
|
215
|
+
return s;
|
|
213
216
|
}
|
|
214
217
|
#S = (e) => {};
|
|
215
|
-
async タグ解析(
|
|
216
|
-
let
|
|
217
|
-
if (!
|
|
218
|
-
this.#o.parse(
|
|
219
|
-
let
|
|
220
|
-
if (
|
|
221
|
-
let e =
|
|
218
|
+
async タグ解析(t, n) {
|
|
219
|
+
let i = this.hTag[t];
|
|
220
|
+
if (!i) throw `未定義のタグ【${t}】です`;
|
|
221
|
+
this.#o.parse(n), this.#S(t);
|
|
222
|
+
let a = this.#o.hPrm;
|
|
223
|
+
if (a.cond) {
|
|
224
|
+
let e = a.cond.val;
|
|
222
225
|
if (!e || e.startsWith("&")) throw "属性condは「&」が不要です";
|
|
223
|
-
let
|
|
224
|
-
if (
|
|
226
|
+
let t = this.prpPrs.parse(e), n = String(t);
|
|
227
|
+
if (n === "null" || n === "undefined" || !t) return !1;
|
|
225
228
|
}
|
|
226
|
-
let
|
|
229
|
+
let o = {}, s = this.#i.at(-1)?.csArg ?? _(), c = this.#i.length;
|
|
227
230
|
if (this.#o.isKomeParam) {
|
|
228
|
-
if (
|
|
229
|
-
|
|
231
|
+
if (c === 0) throw "属性「*」はマクロのみ有効です";
|
|
232
|
+
o = { ...s };
|
|
230
233
|
}
|
|
231
|
-
|
|
232
|
-
for (let [e, { val:
|
|
233
|
-
let
|
|
234
|
-
if (
|
|
235
|
-
if (
|
|
236
|
-
let
|
|
237
|
-
if (
|
|
238
|
-
|
|
234
|
+
o[":タグ名"] = t;
|
|
235
|
+
for (let [e, { val: t, def: n }] of Object.entries(a)) {
|
|
236
|
+
let r = t;
|
|
237
|
+
if (t.startsWith("%")) {
|
|
238
|
+
if (c === 0) throw "属性「%」はマクロ定義内でのみ使用できます(そのマクロの引数を示す簡略文法であるため)";
|
|
239
|
+
let t = s[r.slice(1)];
|
|
240
|
+
if (t) {
|
|
241
|
+
o[e] = t;
|
|
239
242
|
continue;
|
|
240
243
|
}
|
|
241
|
-
if (
|
|
242
|
-
|
|
244
|
+
if (n === void 0 || n === "null") continue;
|
|
245
|
+
r = n;
|
|
243
246
|
}
|
|
244
|
-
if (
|
|
245
|
-
|
|
247
|
+
if (r = this.prpPrs.getValAmpersand(r ?? ""), r !== "undefined") {
|
|
248
|
+
o[e] = r;
|
|
246
249
|
continue;
|
|
247
250
|
}
|
|
248
|
-
|
|
251
|
+
n !== void 0 && (r = this.prpPrs.getValAmpersand(n), r !== "undefined" && (o[e] = r));
|
|
249
252
|
}
|
|
250
|
-
if (
|
|
251
|
-
let { promise:
|
|
252
|
-
|
|
253
|
+
if (d.needGoTxt && this.#C.has(t)) {
|
|
254
|
+
let { promise: t, resolve: n } = Promise.withResolvers();
|
|
255
|
+
d.beginProc(e, () => n(0), !1, () => n(0)), d.goTxt(), this.val.saveKidoku(), await t;
|
|
253
256
|
}
|
|
254
|
-
this.#w.has(
|
|
255
|
-
let
|
|
256
|
-
return
|
|
257
|
+
this.#w.has(t) && (this.#D.hideHint(), u.stopEndTrans());
|
|
258
|
+
let l = this.#T[t];
|
|
259
|
+
return l && r(o, "canskip", this.#E[t] ?? !0) && this.#D.isSkipping ? l(o) : i(o);
|
|
257
260
|
}
|
|
258
|
-
#C = new Set([
|
|
261
|
+
#C = /* @__PURE__ */ new Set([
|
|
259
262
|
"trans",
|
|
260
263
|
"wt",
|
|
261
264
|
"wait_tsy",
|
|
@@ -272,7 +275,7 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
272
275
|
"quake",
|
|
273
276
|
"wq"
|
|
274
277
|
]);
|
|
275
|
-
#w = new Set([
|
|
278
|
+
#w = /* @__PURE__ */ new Set([
|
|
276
279
|
"finish_trans",
|
|
277
280
|
"trans",
|
|
278
281
|
"quake",
|
|
@@ -280,7 +283,7 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
280
283
|
"add_filter"
|
|
281
284
|
]);
|
|
282
285
|
#T = {
|
|
283
|
-
wt: () => (
|
|
286
|
+
wt: () => (u.stopEndTrans(), !1),
|
|
284
287
|
wait_tsy: (e) => this.hTag.stop_tsy(e),
|
|
285
288
|
wait: () => !1,
|
|
286
289
|
wb: () => this.hTag.stopfadese({ buf: "BGM" }),
|
|
@@ -302,60 +305,60 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
302
305
|
};
|
|
303
306
|
#D;
|
|
304
307
|
#O;
|
|
305
|
-
setOtherObj(e,
|
|
306
|
-
this.#D = e, this.#O =
|
|
308
|
+
setOtherObj(e, t) {
|
|
309
|
+
this.#D = e, this.#O = t;
|
|
307
310
|
}
|
|
308
311
|
#k(e) {
|
|
309
|
-
let { name:
|
|
310
|
-
if (!
|
|
311
|
-
let
|
|
312
|
-
for (; this.#n <
|
|
313
|
-
return e.text =
|
|
312
|
+
let { name: t } = e;
|
|
313
|
+
if (!t) throw "nameは必須です";
|
|
314
|
+
let n = "", r = this.#e.len;
|
|
315
|
+
for (; this.#n < r && (n = this.#e.aToken[this.#n], n === ""); ++this.#n);
|
|
316
|
+
return e.text = n, e.cast = "str", this.hTag.let(e), this.#n += 2, this.#r += (n.match(/\n/g) ?? []).length, !1;
|
|
314
317
|
}
|
|
315
318
|
#A() {
|
|
316
319
|
if (this.#n === 0) return console.group(`🥟 [dump_stack] スクリプト現在地 fn:${this.#t} line:1 col:0`), console.groupEnd(), !1;
|
|
317
|
-
let e = this.#j(this.#e, this.#n),
|
|
318
|
-
console.group(`🥟 [dump_stack] ${
|
|
319
|
-
let
|
|
320
|
-
if (
|
|
321
|
-
console.info(
|
|
322
|
-
for (let e =
|
|
323
|
-
let
|
|
324
|
-
console.info(`${String(
|
|
320
|
+
let e = this.#j(this.#e, this.#n), t = `スクリプト現在地 fn:${this.#t} line:${String(e.ln)} col:${String(e.col_s + 1)}`;
|
|
321
|
+
console.group(`🥟 [dump_stack] ${t}`);
|
|
322
|
+
let n = this.#i.length;
|
|
323
|
+
if (n > 0) {
|
|
324
|
+
console.info(t);
|
|
325
|
+
for (let e = n - 1; e >= 0; --e) {
|
|
326
|
+
let t = this.#i[e], r = t.csArg[":hMp"], i = r ? r[":タグ名"] : void 0, a = t.csArg[":タグ名"] ?? "", o = this.#j(this.#re[t.fn], t.idx);
|
|
327
|
+
console.info(`${String(n - e)}つ前のコール元 fn:${t.fn} line:${String(o.ln)} col:${String(o.col_s + 1)}${i ? "([" + i + "]マクロ内)" : " "}で [${a} ...]をコール`);
|
|
325
328
|
}
|
|
326
329
|
}
|
|
327
330
|
return console.groupEnd(), !1;
|
|
328
331
|
}
|
|
329
|
-
#j(e,
|
|
330
|
-
let
|
|
332
|
+
#j(e, t) {
|
|
333
|
+
let n = {
|
|
331
334
|
ln: 1,
|
|
332
335
|
col_s: 0,
|
|
333
336
|
col_e: 0
|
|
334
337
|
};
|
|
335
|
-
if (!e) return
|
|
336
|
-
let
|
|
337
|
-
for (; e.aLNum[
|
|
338
|
-
let
|
|
339
|
-
if (!
|
|
340
|
-
let e =
|
|
341
|
-
|
|
338
|
+
if (!e) return n;
|
|
339
|
+
let r = t - 1, i = n.ln = e.aLNum[r];
|
|
340
|
+
for (; e.aLNum[r] === i;) {
|
|
341
|
+
let t = e.aToken[r];
|
|
342
|
+
if (!t.startsWith("\n")) {
|
|
343
|
+
let e = t.length;
|
|
344
|
+
n.col_e > 0 && (n.col_s += e), n.col_e += e;
|
|
342
345
|
}
|
|
343
|
-
if (--
|
|
346
|
+
if (--r < 0) break;
|
|
344
347
|
}
|
|
345
|
-
return
|
|
348
|
+
return n;
|
|
346
349
|
}
|
|
347
350
|
#M(e) {
|
|
348
|
-
let { set_fnc:
|
|
349
|
-
if (!
|
|
350
|
-
if (this.#N = globalThis[
|
|
351
|
-
if (
|
|
351
|
+
let { set_fnc: t, break_fnc: n } = e;
|
|
352
|
+
if (!t) throw "set_fncは必須です";
|
|
353
|
+
if (this.#N = globalThis[t], !this.#N) {
|
|
354
|
+
if (r(e, "need_err", !0)) throw `HTML内に関数${t}が見つかりません`;
|
|
352
355
|
return this.#N = () => {}, !1;
|
|
353
356
|
}
|
|
354
357
|
if (this.noticeBreak = (e) => {
|
|
355
358
|
this.#F !== this.#t && (this.#F = this.#t, this.#N(this.#I[this.#t] ??= this.#e.aToken.join(""))), this.#P(this.#r, e);
|
|
356
|
-
}, this.noticeBreak(!0), !
|
|
357
|
-
if (this.#P = globalThis[
|
|
358
|
-
if (
|
|
359
|
+
}, this.noticeBreak(!0), !n) return !1;
|
|
360
|
+
if (this.#P = globalThis[n], !this.#P) {
|
|
361
|
+
if (r(e, "need_err", !0)) throw `HTML内に関数${n}が見つかりません`;
|
|
359
362
|
this.#P = () => {};
|
|
360
363
|
}
|
|
361
364
|
return !1;
|
|
@@ -372,13 +375,13 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
372
375
|
return;
|
|
373
376
|
}
|
|
374
377
|
let e = "";
|
|
375
|
-
for (let
|
|
376
|
-
let
|
|
377
|
-
console.group(`🥟 Error line (from ${String(
|
|
378
|
-
let
|
|
379
|
-
for (let e = 0; e <
|
|
380
|
-
let
|
|
381
|
-
e ===
|
|
378
|
+
for (let t = this.#n - 1; t >= 0 && (e = String(this.#e.aToken[t]) + e, !((e.match(/\n/g) ?? []).length >= this.#L)); --t);
|
|
379
|
+
let t = e.split("\n").slice(-this.#L), n = t.length;
|
|
380
|
+
console.group(`🥟 Error line (from ${String(n)} rows before) fn:${this.#t}`);
|
|
381
|
+
let r = String(this.#r).length, i = this.#j(this.#e, this.#n);
|
|
382
|
+
for (let e = 0; e < n; ++e) {
|
|
383
|
+
let a = this.#r - n + e + 1, o = `${String(a).padStart(r, " ")}: %c`, s = t[e], c = s.length > 75 ? s.slice(0, 75) + "…" : s;
|
|
384
|
+
e === n - 1 ? console.info(o + c.slice(0, i.col_s) + "%c" + c.slice(i.col_s), "color: black; background-color: skyblue;", "color: black; background-color: pink;") : console.info(o + c, "color: black; background-color: skyblue;");
|
|
382
385
|
}
|
|
383
386
|
console.groupEnd();
|
|
384
387
|
}
|
|
@@ -390,131 +393,131 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
390
393
|
return this.#n = e, this.#R.shift(), !1;
|
|
391
394
|
}
|
|
392
395
|
#B(e) {
|
|
393
|
-
let { exp:
|
|
394
|
-
if (!
|
|
395
|
-
if (
|
|
396
|
-
let
|
|
397
|
-
for (; this.#n <
|
|
396
|
+
let { exp: t } = e;
|
|
397
|
+
if (!t) throw "expは必須です";
|
|
398
|
+
if (t.startsWith("&")) throw "属性expは「&」が不要です";
|
|
399
|
+
let n = 0, r = this.prpPrs.parse(t) ? this.#n : -1, i = this.#e.aLNum[this.#n], a = this.#r - ((i ?? 0) || 0), o = this.#e.len;
|
|
400
|
+
for (; this.#n < o; ++this.#n) {
|
|
398
401
|
let e = this.#e.aLNum[this.#n];
|
|
399
|
-
this.#e.aLNum[this.#n] = ((e ?? 0) || 0) +
|
|
400
|
-
let
|
|
401
|
-
if (!
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
404
|
-
this.#r +=
|
|
402
|
+
this.#e.aLNum[this.#n] = ((e ?? 0) || 0) + a;
|
|
403
|
+
let t = this.#e.aToken[this.#n];
|
|
404
|
+
if (!t) continue;
|
|
405
|
+
let i = t.charCodeAt(0);
|
|
406
|
+
if (i === 10) {
|
|
407
|
+
this.#r += t.length;
|
|
405
408
|
continue;
|
|
406
409
|
}
|
|
407
|
-
if (
|
|
408
|
-
let [
|
|
409
|
-
if (!(
|
|
410
|
-
switch (this.#o.parse(
|
|
410
|
+
if (i !== 91) continue;
|
|
411
|
+
let [o, s] = m(t);
|
|
412
|
+
if (!(o in this.hTag)) throw `未定義のタグ[${o}]です`;
|
|
413
|
+
switch (this.#o.parse(s), o) {
|
|
411
414
|
case "if":
|
|
412
|
-
++
|
|
415
|
+
++n;
|
|
413
416
|
break;
|
|
414
417
|
case "elsif":
|
|
415
418
|
{
|
|
416
|
-
if (
|
|
419
|
+
if (n > 0 || r > -1) break;
|
|
417
420
|
let e = this.#o.hPrm.exp?.val;
|
|
418
421
|
if (!e) throw "expは必須です";
|
|
419
422
|
if (e.startsWith("&")) throw "属性expは「&」が不要です";
|
|
420
|
-
this.prpPrs.parse(e) && (
|
|
423
|
+
this.prpPrs.parse(e) && (r = this.#n + 1);
|
|
421
424
|
}
|
|
422
425
|
break;
|
|
423
426
|
case "else":
|
|
424
|
-
if (
|
|
425
|
-
|
|
427
|
+
if (n > 0) break;
|
|
428
|
+
r === -1 && (r = this.#n + 1);
|
|
426
429
|
break;
|
|
427
430
|
case "endif":
|
|
428
|
-
if (
|
|
429
|
-
--
|
|
431
|
+
if (n > 0) {
|
|
432
|
+
--n;
|
|
430
433
|
break;
|
|
431
434
|
}
|
|
432
|
-
return
|
|
435
|
+
return r === -1 ? (++this.#n, this.#e.aLNum[this.#n] += a) : (this.#R.unshift(this.#n + 1), this.#n = r, this.#r = this.#e.aLNum[this.#n]), !1;
|
|
433
436
|
}
|
|
434
437
|
}
|
|
435
438
|
throw "[endif]がないままスクリプト終端です";
|
|
436
439
|
}
|
|
437
440
|
#V(e) {
|
|
438
|
-
|
|
439
|
-
let { fn:
|
|
440
|
-
return
|
|
441
|
+
r(e, "count", !1) || this.#de();
|
|
442
|
+
let { fn: t } = e;
|
|
443
|
+
return t && this.#l(t), this.#H({ ...e }, l.popLocalEvts()), r(e, "clear_local_event", !1) && this.hTag.clear_event({}), this.#Y(t, e.label);
|
|
441
444
|
}
|
|
442
|
-
#H(e,
|
|
443
|
-
let
|
|
445
|
+
#H(e, t) {
|
|
446
|
+
let n = {
|
|
444
447
|
...e,
|
|
445
|
-
...
|
|
448
|
+
...t ? { ":hEvt1Time": t } : {},
|
|
446
449
|
":hMp": this.val.cloneMp(),
|
|
447
450
|
":lenIfStk": this.#R.length
|
|
448
451
|
};
|
|
449
|
-
this.#e.aLNum[this.#n] = this.#r, this.#K || (
|
|
452
|
+
this.#e.aLNum[this.#n] = this.#r, this.#K || (n[":resvToken"] = "", this.#q()), this.#i.push(new y(this.#t, this.#n, n)), this.#R.unshift(-1);
|
|
450
453
|
}
|
|
451
454
|
#U(e) {
|
|
452
|
-
return
|
|
455
|
+
return r(e, "count", !0) || this.#de(), this.#R[0] = -1, this.#Y(e.fn, e.label);
|
|
453
456
|
}
|
|
454
457
|
#W(e) {
|
|
455
|
-
if (
|
|
458
|
+
if (r(e, "clear", !1)) this.#i = [];
|
|
456
459
|
else if (!this.#i.pop()) throw "スタックが空です";
|
|
457
|
-
return this.#q(), this.#R = [-1], this.val.setMp(
|
|
460
|
+
return this.#q(), this.#R = [-1], this.val.setMp(v()), !1;
|
|
458
461
|
}
|
|
459
462
|
#G(e) {
|
|
460
|
-
let
|
|
461
|
-
if (!
|
|
462
|
-
let
|
|
463
|
-
this.#R = this.#R.slice(-
|
|
464
|
-
let
|
|
465
|
-
|
|
466
|
-
let
|
|
467
|
-
|
|
468
|
-
let { fn:
|
|
469
|
-
return
|
|
463
|
+
let t = this.#i.pop();
|
|
464
|
+
if (!t) throw "スタックが空です";
|
|
465
|
+
let n = t.csArg;
|
|
466
|
+
this.#R = this.#R.slice(-n[":lenIfStk"]);
|
|
467
|
+
let r = n[":hMp"];
|
|
468
|
+
r && this.val.setMp(r);
|
|
469
|
+
let i = n[":resvToken"];
|
|
470
|
+
i ? this.nextToken = () => (this.#q(), i) : this.#q(), n[":hEvt1Time"] && l.pushLocalEvts(n[":hEvt1Time"]);
|
|
471
|
+
let { fn: a, label: o } = e;
|
|
472
|
+
return a || o ? this.#Y(a, o) : t.fn in this.#re ? (this.#ae(t), !1) : this.#Y(t.fn, "", t.idx);
|
|
470
473
|
}
|
|
471
474
|
#K = "";
|
|
472
475
|
#q() {
|
|
473
476
|
this.#K = "", this.nextToken = () => this.#X();
|
|
474
477
|
}
|
|
475
478
|
#J = "";
|
|
476
|
-
#Y(e = "",
|
|
477
|
-
if (
|
|
479
|
+
#Y(e = "", t = "", n = 0) {
|
|
480
|
+
if (i.debugLog && console.log(`📜 %c1:jumpWork%c fn:${e} lbl:${t} idx:${String(n)}`, "color:#3B0;", ""), !e && !t && this.main.errScript("[jump系] fnまたはlabelは必須です"), t ? (t.startsWith("*") || this.main.errScript("[jump系] labelは*で始まります"), this.#J = t, this.#J.startsWith("**") || (this.#n = n)) : (this.#J = "", this.#n = n), !e) return this.analyzeInit(), !1;
|
|
478
481
|
if (e.includes("@")) throw "[jump系] fn には文字「@」は禁止です";
|
|
479
|
-
let
|
|
482
|
+
let r = this.#l(e);
|
|
480
483
|
if (e === this.#t) return this.analyzeInit(), !1;
|
|
481
484
|
this.#t = e;
|
|
482
|
-
let
|
|
483
|
-
if (
|
|
484
|
-
let
|
|
485
|
-
|
|
486
|
-
let
|
|
485
|
+
let a = this.#re[e];
|
|
486
|
+
if (a) return this.#e = a, this.analyzeInit(), !1;
|
|
487
|
+
let s = `jumpWork fn:${e}`;
|
|
488
|
+
d.beginProc(s);
|
|
489
|
+
let c = "", l = new o();
|
|
487
490
|
try {
|
|
488
|
-
|
|
491
|
+
c = this.#l(e + "@"), l.add({
|
|
489
492
|
name: e + ":base",
|
|
490
|
-
url:
|
|
491
|
-
}),
|
|
493
|
+
url: r
|
|
494
|
+
}), l.add({
|
|
492
495
|
name: e,
|
|
493
|
-
url:
|
|
496
|
+
url: c
|
|
494
497
|
});
|
|
495
498
|
} catch {
|
|
496
|
-
|
|
499
|
+
l.add({
|
|
497
500
|
name: e,
|
|
498
|
-
url:
|
|
501
|
+
url: r
|
|
499
502
|
});
|
|
500
503
|
}
|
|
501
|
-
return
|
|
502
|
-
this.sys.dec(e.extension, e.data).then((
|
|
503
|
-
e.data =
|
|
504
|
-
}).catch((
|
|
505
|
-
this.main.errScript(`[jump系]snロード失敗です fn:${e.name} ${String(
|
|
504
|
+
return l.use((e, t) => {
|
|
505
|
+
this.sys.dec(e.extension, e.data).then((n) => {
|
|
506
|
+
e.data = n, t();
|
|
507
|
+
}).catch((n) => {
|
|
508
|
+
this.main.errScript(`[jump系]snロード失敗です fn:${e.name} ${String(n)}`, !1), t();
|
|
506
509
|
});
|
|
507
|
-
}).load((
|
|
508
|
-
if (
|
|
509
|
-
let
|
|
510
|
-
for (let e = 0; e <
|
|
511
|
-
|
|
510
|
+
}).load((t, n) => {
|
|
511
|
+
if (d.endProc(s), c) {
|
|
512
|
+
let t = n[e + ":base"].data, r = n[e].data, i = t.split("\n"), a = r.split("\n"), o = i.length, s = a.length;
|
|
513
|
+
for (let e = 0; e < s && e < o; ++e) a[e] ||= i[e] ?? "";
|
|
514
|
+
n[e].data = a.join("\n"), delete n[e + ":base"];
|
|
512
515
|
}
|
|
513
|
-
this.nextToken = this.#X, this.#r = 1, this.#ie(
|
|
516
|
+
this.nextToken = this.#X, this.#r = 1, this.#ie(n[e].data), this.hTag.record_place({}), this.analyzeInit();
|
|
514
517
|
}), !0;
|
|
515
518
|
}
|
|
516
519
|
analyzeInit() {
|
|
517
|
-
|
|
520
|
+
i.debugLog && console.log(`📜 %c9:analyzeInit%c fn:${this.#t} lbl:${this.#J} idx:${String(this.#n)}`, "color:#3B0;", "");
|
|
518
521
|
let e = this.#ne(this.#e, !!this.val.getVal("mp:const.sn.macro.name"), this.#r, this.#J, this.#n);
|
|
519
522
|
this.#n = e.idx, this.#r = e.ln;
|
|
520
523
|
}
|
|
@@ -532,109 +535,109 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
532
535
|
#$ = /(\*{2,})([^|]*)/;
|
|
533
536
|
#ee = /^\[macro\s/;
|
|
534
537
|
#te = /^\[endmacro[\s\]]/;
|
|
535
|
-
#ne(e,
|
|
536
|
-
let
|
|
537
|
-
if (!
|
|
538
|
+
#ne(e, t, n, r, i) {
|
|
539
|
+
let a = e.aToken.length, o = n, s = r;
|
|
540
|
+
if (!s) {
|
|
538
541
|
if (this.#Q()) return {
|
|
539
|
-
idx:
|
|
540
|
-
ln:
|
|
542
|
+
idx: i,
|
|
543
|
+
ln: o
|
|
541
544
|
};
|
|
542
|
-
if (e.aLNum[
|
|
545
|
+
if (e.aLNum[i]) o = e.aLNum[i];
|
|
543
546
|
else {
|
|
544
|
-
|
|
545
|
-
for (let
|
|
546
|
-
e.aLNum[
|
|
547
|
-
let
|
|
548
|
-
|
|
547
|
+
o = 1;
|
|
548
|
+
for (let t = 0; t < i; ++t) {
|
|
549
|
+
e.aLNum[t] ||= o;
|
|
550
|
+
let n = e.aToken[t];
|
|
551
|
+
n.startsWith("\n") ? o += n.length : o += (n.match(/\n/g) ?? []).length;
|
|
549
552
|
}
|
|
550
|
-
e.aLNum[
|
|
553
|
+
e.aLNum[i] = o;
|
|
551
554
|
}
|
|
552
555
|
return {
|
|
553
|
-
idx:
|
|
554
|
-
ln:
|
|
556
|
+
idx: i,
|
|
557
|
+
ln: o
|
|
555
558
|
};
|
|
556
559
|
}
|
|
557
560
|
e.aLNum[0] = 1;
|
|
558
|
-
let
|
|
559
|
-
if (
|
|
560
|
-
|
|
561
|
-
let
|
|
562
|
-
switch (
|
|
561
|
+
let l = s.match(this.#$);
|
|
562
|
+
if (l) {
|
|
563
|
+
s = l[1];
|
|
564
|
+
let n = i;
|
|
565
|
+
switch (l[2]) {
|
|
563
566
|
case "before":
|
|
564
|
-
for (; e.aToken[--
|
|
565
|
-
${String(
|
|
567
|
+
for (; e.aToken[--n] !== s;) n === 0 && c.myTrace(`[jump系 無名ラベルbefore]
|
|
568
|
+
${String(o)} 行目以前で ${t ? "マクロ内に" : ""} ラベル【 ${s} 】がありません`, "ET"), t && e.aToken[n].search(this.#ee) > -1 && c.myTrace("[jump系 無名ラベルbefore] マクロ内にラベル【" + s + "】がありません", "ET");
|
|
566
569
|
return {
|
|
567
|
-
idx:
|
|
568
|
-
ln: e.aLNum[
|
|
570
|
+
idx: n + 1,
|
|
571
|
+
ln: e.aLNum[n]
|
|
569
572
|
};
|
|
570
573
|
case "after":
|
|
571
|
-
for (; e.aToken[++
|
|
574
|
+
for (; e.aToken[++n] !== s;) n === a && c.myTrace(`[jump系 無名ラベルafter] ${String(o)} 行目以後でマクロ内にラベル【${s}】がありません`, "ET"), e.aToken[n].search(this.#te) > -1 && c.myTrace(`[jump系 無名ラベルafter] ${String(o)} 行目以後でマクロ内にラベル【 ${s} 】がありません`, "ET");
|
|
572
575
|
return {
|
|
573
|
-
idx:
|
|
574
|
-
ln: e.aLNum[
|
|
576
|
+
idx: n + 1,
|
|
577
|
+
ln: e.aLNum[n]
|
|
575
578
|
};
|
|
576
|
-
default:
|
|
579
|
+
default: c.myTrace("[jump系] 無名ラベル指定【label=" + s + "】が間違っています", "ET");
|
|
577
580
|
}
|
|
578
581
|
}
|
|
579
|
-
|
|
580
|
-
let
|
|
581
|
-
for (let
|
|
582
|
-
e.aLNum[
|
|
583
|
-
let
|
|
584
|
-
if (
|
|
585
|
-
this.#a.testTagEndLetml(
|
|
582
|
+
o = 1;
|
|
583
|
+
let u = RegExp("^" + s.replaceAll("*", "\\*") + "(?=\\s|;|\\[|\\||$)"), d = !1;
|
|
584
|
+
for (let t = 0; t < a; ++t) {
|
|
585
|
+
e.aLNum[t] ||= o;
|
|
586
|
+
let n = e.aToken[t];
|
|
587
|
+
if (d) {
|
|
588
|
+
this.#a.testTagEndLetml(n) ? d = !1 : o += (n.match(/\n/g) ?? []).length;
|
|
586
589
|
continue;
|
|
587
590
|
}
|
|
588
|
-
let
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
+
let r = n.charCodeAt(0);
|
|
592
|
+
if (r === 10) {
|
|
593
|
+
o += n.length;
|
|
591
594
|
continue;
|
|
592
595
|
}
|
|
593
|
-
if (
|
|
594
|
-
if (
|
|
595
|
-
idx:
|
|
596
|
-
ln:
|
|
596
|
+
if (r === 42) {
|
|
597
|
+
if (n.search(u) > -1) return {
|
|
598
|
+
idx: t + 1,
|
|
599
|
+
ln: o
|
|
597
600
|
};
|
|
598
601
|
continue;
|
|
599
602
|
}
|
|
600
|
-
|
|
603
|
+
r === 91 && (o += (n.match(/\n/g) ?? []).length, this.#a.testTagLetml(n) && (d = !0));
|
|
601
604
|
}
|
|
602
|
-
throw
|
|
605
|
+
throw d ? "[let_ml]の終端・[endlet_ml]がありません" : (c.myTrace(`[jump系] ラベル【${s}】がありません`, "ET"), "Dummy");
|
|
603
606
|
}
|
|
604
607
|
#re = Object.create(null);
|
|
605
608
|
#ie(e) {
|
|
606
|
-
let
|
|
609
|
+
let t = "";
|
|
607
610
|
try {
|
|
608
|
-
|
|
609
|
-
let
|
|
610
|
-
|
|
611
|
+
t = "ScriptIterator.resolveScript";
|
|
612
|
+
let n = this.#a.resolveScript(e);
|
|
613
|
+
t = "ScriptIterator.replaceScript_Wildcard", this.#ce(n), this.#re[this.#t] = this.#e = n;
|
|
611
614
|
} catch (e) {
|
|
612
|
-
e instanceof Error ?
|
|
615
|
+
e instanceof Error ? t += `例外 mes=${e.message}(${e.name})` : t = String(e), this.main.errScript(t, !1);
|
|
613
616
|
}
|
|
614
617
|
this.val.touchAreaKidoku(this.#t);
|
|
615
618
|
}
|
|
616
619
|
#ae(e) {
|
|
617
620
|
this.#t = e.fn, this.#n = e.idx;
|
|
618
|
-
let
|
|
619
|
-
|
|
621
|
+
let t = this.#re[this.#t];
|
|
622
|
+
t && (this.#e = t), this.#r = this.#e.aLNum[e.idx];
|
|
620
623
|
}
|
|
621
624
|
#oe = /^\[(call|loadplugin)\s/;
|
|
622
625
|
#se = /\bfn\s*=\s*[^\s\]]+/;
|
|
623
626
|
#ce(e) {
|
|
624
|
-
for (let
|
|
625
|
-
let
|
|
626
|
-
if (!this.#oe.test(
|
|
627
|
-
let [
|
|
628
|
-
this.#o.parse(
|
|
629
|
-
let
|
|
630
|
-
if (!
|
|
631
|
-
let { val:
|
|
632
|
-
if (!
|
|
633
|
-
e.aToken.splice(
|
|
634
|
-
let
|
|
635
|
-
for (let
|
|
636
|
-
let
|
|
637
|
-
e.aToken.splice(
|
|
627
|
+
for (let n = e.len - 1; n >= 0; --n) {
|
|
628
|
+
let r = e.aToken[n];
|
|
629
|
+
if (!this.#oe.test(r)) continue;
|
|
630
|
+
let [i, a] = m(r);
|
|
631
|
+
this.#o.parse(a);
|
|
632
|
+
let o = this.#o.hPrm.fn;
|
|
633
|
+
if (!o) continue;
|
|
634
|
+
let { val: c } = o;
|
|
635
|
+
if (!c.endsWith("*")) continue;
|
|
636
|
+
e.aToken.splice(n, 1, " ", "; " + r), e.aLNum.splice(n, 1, NaN, NaN);
|
|
637
|
+
let l = i === "loadplugin" ? s.CSS : s.SN, u = this.cfg.matchPath("^" + c.slice(0, -1) + ".*", l);
|
|
638
|
+
for (let i of u) {
|
|
639
|
+
let a = r.replace(this.#se, "fn=" + decodeURIComponent(t(i[l])));
|
|
640
|
+
e.aToken.splice(n, 0, a), e.aLNum.splice(n, 0, NaN);
|
|
638
641
|
}
|
|
639
642
|
}
|
|
640
643
|
e.len = e.aToken.length;
|
|
@@ -655,14 +658,14 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
655
658
|
this.val.getAreaKidoku(this.#t)?.erase(this.#n), this.#ue = !1;
|
|
656
659
|
}
|
|
657
660
|
get isNextKidoku() {
|
|
658
|
-
let e = this.#t,
|
|
661
|
+
let e = this.#t, t = this.#n, n = this.#e.len;
|
|
659
662
|
if (this.#i.length > 0) {
|
|
660
|
-
let
|
|
661
|
-
e =
|
|
662
|
-
let
|
|
663
|
-
|
|
663
|
+
let r = this.#i[0];
|
|
664
|
+
e = r.fn, t = r.idx;
|
|
665
|
+
let i = this.#re[e];
|
|
666
|
+
i && (n = i.len);
|
|
664
667
|
}
|
|
665
|
-
return
|
|
668
|
+
return t === n ? !1 : this.val.getAreaKidoku(e)?.search(t) ?? !1;
|
|
666
669
|
}
|
|
667
670
|
get normalWait() {
|
|
668
671
|
return this.#ue ? this.val.tagCh_doWait_Kidoku ? this.val.tagCh_msecWait_Kidoku : 0 : this.val.tagCh_doWait ? this.val.tagCh_msecWait : 0;
|
|
@@ -675,83 +678,83 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
675
678
|
}
|
|
676
679
|
#me = /["'#;\\] ]+/;
|
|
677
680
|
#he(e) {
|
|
678
|
-
let { name:
|
|
679
|
-
if (!
|
|
680
|
-
if (
|
|
681
|
-
if (this.#me.test(
|
|
682
|
-
let
|
|
683
|
-
for (this.#ge += "|" +
|
|
684
|
-
...
|
|
681
|
+
let { name: t } = e;
|
|
682
|
+
if (!t) throw "nameは必須です";
|
|
683
|
+
if (t in this.hTag) throw `[${t}]はタグかすでに定義済みのマクロです`;
|
|
684
|
+
if (this.#me.test(t)) throw `[${t}]はマクロ名として異常です`;
|
|
685
|
+
let n = this.#r, r = new y(this.#t, this.#n);
|
|
686
|
+
for (this.#ge += "|" + t, this.#_e = RegExp(`\\[(${this.#ge})\\b`), this.hTag[t] = (t) => (this.#H(t), this.val.setMp({
|
|
687
|
+
...t,
|
|
685
688
|
"const.sn.macro": JSON.stringify({ name: e.name }),
|
|
686
689
|
"const.sn.me_call_scriptFn": this.#t
|
|
687
|
-
}), this.val.setVal_Nochk("mp", "const.sn.me_call_scriptFn", this.#t), this.#r =
|
|
690
|
+
}), this.val.setVal_Nochk("mp", "const.sn.me_call_scriptFn", this.#t), this.#r = n, this.#ae(r), !1); this.#n < this.#e.len; ++this.#n) {
|
|
688
691
|
this.#e.aLNum[this.#n] ||= this.#r;
|
|
689
692
|
let e = this.#e.aToken[this.#n];
|
|
690
693
|
if (e.search(this.#te) > -1) return ++this.#n, !1;
|
|
691
|
-
let
|
|
692
|
-
|
|
694
|
+
let t = e.charCodeAt(0);
|
|
695
|
+
t === 10 ? this.#r += e.length : t === 91 && (this.#r += (e.match(/\n/g) ?? []).length);
|
|
693
696
|
}
|
|
694
|
-
throw `マクロ[${
|
|
697
|
+
throw `マクロ[${t}]定義の終端・[endmacro]がありません`;
|
|
695
698
|
}
|
|
696
699
|
#ge = "call";
|
|
697
700
|
#_e = /\[(call)\b/;
|
|
698
701
|
#ve(e) {
|
|
699
702
|
if ("fn" in e != "label" in e) throw "fnとlabelはセットで指定して下さい";
|
|
700
|
-
let
|
|
701
|
-
if (!
|
|
702
|
-
return this.loadFromMark(e,
|
|
703
|
-
}
|
|
704
|
-
loadFromMark(e,
|
|
705
|
-
this.hTag.clear_event({}), this.val.mark2save(
|
|
706
|
-
let
|
|
707
|
-
|
|
703
|
+
let t = n(e, "place", 0), r = this.val.getMark(t);
|
|
704
|
+
if (!r) throw `place=${String(t)} は存在しません`;
|
|
705
|
+
return this.loadFromMark(e, r, 2);
|
|
706
|
+
}
|
|
707
|
+
loadFromMark(e, t, n = 0) {
|
|
708
|
+
this.hTag.clear_event({}), this.val.mark2save(t), this.val.setMp(v()), this.#O.recPagebreak();
|
|
709
|
+
let a = [];
|
|
710
|
+
n !== 1 && (a = this.sndMng.playLoopFromSaveObj(n === 2)), r(e, "do_rec", !0) && (this.#be = {
|
|
708
711
|
hSave: this.val.cloneSave(),
|
|
709
|
-
hPages: { ...
|
|
710
|
-
aIfStk: [...
|
|
712
|
+
hPages: { ...t.hPages },
|
|
713
|
+
aIfStk: [...t.aIfStk]
|
|
711
714
|
});
|
|
712
|
-
let
|
|
715
|
+
let o = {
|
|
713
716
|
enabled: !!this.val.getVal("save:const.sn.autowc.enabled"),
|
|
714
717
|
text: String(this.val.getVal("save:const.sn.autowc.text")),
|
|
715
718
|
time: Number(this.val.getVal("save:const.sn.autowc.time"))
|
|
716
719
|
};
|
|
717
|
-
this.hTag.autowc(
|
|
718
|
-
let
|
|
719
|
-
if (
|
|
720
|
-
this.#Y(
|
|
720
|
+
this.hTag.autowc(o), this.#R = [...this.#be.aIfStk], this.#i = [], u.stopAllTw();
|
|
721
|
+
let s = Promise.allSettled([...a, ...this.#O.playback(this.#be.hPages)]).then(() => this.#O.cover(!1)), { index: c, fn: l } = e;
|
|
722
|
+
if (c) return i.debugLog && console.log(`📜 %cloadFromMark index:${String(c)} move!%c fn:${l ?? ""}`, "color:#3B0;", ""), s.then(() => {
|
|
723
|
+
this.#Y(l, "", c) || this.main.resume();
|
|
721
724
|
}).catch((e) => console.error("loadFromMark e:%o", e)), !0;
|
|
722
725
|
this.#O.cover(!0);
|
|
723
|
-
let
|
|
724
|
-
delete this.#re[
|
|
725
|
-
let { label:
|
|
726
|
-
return
|
|
727
|
-
this.#t =
|
|
728
|
-
...
|
|
729
|
-
label:
|
|
726
|
+
let d = String(this.val.getVal("save:const.sn.scriptFn")), f = Number(this.val.getVal("save:const.sn.scriptIdx"));
|
|
727
|
+
delete this.#re[d];
|
|
728
|
+
let { label: p } = e;
|
|
729
|
+
return s.then(p ? () => {
|
|
730
|
+
this.#t = d, this.#n = f, this.hTag.call({
|
|
731
|
+
...l ? { fn: l } : {},
|
|
732
|
+
label: p
|
|
730
733
|
}) || this.main.resume();
|
|
731
734
|
} : () => {
|
|
732
|
-
this.#Y(
|
|
735
|
+
this.#Y(d, "", f) || this.main.resume();
|
|
733
736
|
}).catch((e) => console.error("loadFromMark e:%o", e)), !0;
|
|
734
737
|
}
|
|
735
738
|
#ye(e) {
|
|
736
|
-
let
|
|
737
|
-
if (!
|
|
738
|
-
delete this.#re[
|
|
739
|
-
let
|
|
739
|
+
let n = this.val.getMark(0);
|
|
740
|
+
if (!n) return !1;
|
|
741
|
+
delete this.#re[t(n.hSave["const.sn.scriptFn"])];
|
|
742
|
+
let r = {};
|
|
740
743
|
for (let e in this.#re) try {
|
|
741
744
|
this.#l(e + "@");
|
|
742
745
|
} catch {
|
|
743
|
-
|
|
746
|
+
r[e] = this.#re[e];
|
|
744
747
|
}
|
|
745
|
-
return this.#re =
|
|
748
|
+
return this.#re = r, e.do_rec = !1, this.loadFromMark(e, n, 1);
|
|
746
749
|
}
|
|
747
750
|
#be = {
|
|
748
|
-
hSave:
|
|
751
|
+
hSave: a(),
|
|
749
752
|
hPages: {},
|
|
750
753
|
aIfStk: [-1]
|
|
751
754
|
};
|
|
752
755
|
#xe = () => {
|
|
753
|
-
let { fn: e, idx:
|
|
754
|
-
return this.val.setVal_Nochk("save", "const.sn.scriptFn", e), this.val.setVal_Nochk("save", "const.sn.scriptIdx",
|
|
756
|
+
let { fn: e, idx: t } = this.nowScrIdx();
|
|
757
|
+
return this.val.setVal_Nochk("save", "const.sn.scriptFn", e), this.val.setVal_Nochk("save", "const.sn.scriptIdx", t), this.#be = {
|
|
755
758
|
hSave: this.val.cloneSave(),
|
|
756
759
|
hPages: this.#O.record(),
|
|
757
760
|
aIfStk: this.#R.slice(this.#i.length)
|
|
@@ -772,35 +775,36 @@ var BreakState = /* @__PURE__ */ function(e) {
|
|
|
772
775
|
return { ...this.#be };
|
|
773
776
|
}
|
|
774
777
|
nowScrFnLn() {
|
|
775
|
-
let { fn: e, idx:
|
|
778
|
+
let { fn: e, idx: t } = this.nowScrIdx(), n = this.#re[e];
|
|
776
779
|
return {
|
|
777
780
|
fn: e,
|
|
778
|
-
...this.#j(
|
|
781
|
+
...this.#j(n, t)
|
|
779
782
|
};
|
|
780
783
|
}
|
|
781
784
|
#Se(e) {
|
|
782
785
|
if (!("place" in e)) throw "placeは必須です";
|
|
783
|
-
let
|
|
784
|
-
delete e[":タグ名"], delete e.place, e.text = e.text ?? "", this.#be.json = e, this.val.setMark(
|
|
785
|
-
let
|
|
786
|
-
return
|
|
786
|
+
let t = e.place;
|
|
787
|
+
delete e[":タグ名"], delete e.place, e.text = e.text ?? "", this.#be.json = e, this.val.setMark(t, this.#be);
|
|
788
|
+
let n = Number(this.val.getVal("sys:const.sn.save.place"));
|
|
789
|
+
return t === n && this.val.setVal_Nochk("sys", "const.sn.save.place", n + 1), !1;
|
|
787
790
|
}
|
|
788
791
|
recodeDesign(e) {
|
|
789
|
-
let
|
|
790
|
-
if (e.design_unit &&
|
|
792
|
+
let t = "", n = 0, r = this.#i.length;
|
|
793
|
+
if (e.design_unit && r > 0) {
|
|
791
794
|
let e = this.#i[0];
|
|
792
|
-
|
|
793
|
-
} else
|
|
794
|
-
e[":path"] = this.#u(
|
|
795
|
-
let
|
|
796
|
-
e[":ln"] =
|
|
797
|
-
let
|
|
798
|
-
e[":idx_tkn"] =
|
|
795
|
+
t = e.fn, n = e.idx;
|
|
796
|
+
} else t = this.#t, n = this.#n;
|
|
797
|
+
e[":path"] = this.#u(t);
|
|
798
|
+
let i = this.#re[t], a = this.#j(i, n);
|
|
799
|
+
e[":ln"] = a.ln, e[":col_s"] = a.col_s, e[":col_e"] = a.col_e;
|
|
800
|
+
let o = n - 1;
|
|
801
|
+
e[":idx_tkn"] = o, e[":token"] = i.aToken[o] ?? "", this.sys.send2Dbg("_recodeDesign", e);
|
|
799
802
|
}
|
|
800
|
-
replace(e,
|
|
801
|
-
this.#e.aToken[e] =
|
|
803
|
+
replace(e, t) {
|
|
804
|
+
this.#e.aToken[e] = t;
|
|
802
805
|
}
|
|
803
806
|
};
|
|
804
|
-
|
|
807
|
+
//#endregion
|
|
808
|
+
export { b as ScriptIterator };
|
|
805
809
|
|
|
806
810
|
//# sourceMappingURL=ScriptIterator.js.map
|