webgal-parser 4.4.15 → 4.5.2
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/build/cjs/index.cjs
CHANGED
|
@@ -436,8 +436,9 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
|
|
|
436
436
|
let parsedCommand; // 解析后的命令
|
|
437
437
|
let commandRaw;
|
|
438
438
|
// 正式开始解析
|
|
439
|
-
//
|
|
440
|
-
let newSentenceRaw = sentenceRaw.split(
|
|
439
|
+
// 去分号
|
|
440
|
+
let newSentenceRaw = sentenceRaw.split(/(?<!\\);/)[0];
|
|
441
|
+
newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
|
|
441
442
|
if (newSentenceRaw === '') {
|
|
442
443
|
// 注释提前返回
|
|
443
444
|
return {
|
|
@@ -487,12 +488,12 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
|
|
|
487
488
|
args.push(e);
|
|
488
489
|
}
|
|
489
490
|
}
|
|
490
|
-
content = contentParser(newSentenceRaw, command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
491
|
+
content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
491
492
|
sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
|
|
492
493
|
subScene = subSceneScanner(command, content); // 扫描语句携带子场景
|
|
493
494
|
return {
|
|
494
495
|
command: command,
|
|
495
|
-
commandRaw: commandRaw,
|
|
496
|
+
commandRaw: commandRaw.trim(),
|
|
496
497
|
content: content,
|
|
497
498
|
args: args,
|
|
498
499
|
sentenceAssets: sentenceAssets,
|
package/build/es/index.js
CHANGED
|
@@ -432,8 +432,9 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
|
|
|
432
432
|
let parsedCommand; // 解析后的命令
|
|
433
433
|
let commandRaw;
|
|
434
434
|
// 正式开始解析
|
|
435
|
-
//
|
|
436
|
-
let newSentenceRaw = sentenceRaw.split(
|
|
435
|
+
// 去分号
|
|
436
|
+
let newSentenceRaw = sentenceRaw.split(/(?<!\\);/)[0];
|
|
437
|
+
newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
|
|
437
438
|
if (newSentenceRaw === '') {
|
|
438
439
|
// 注释提前返回
|
|
439
440
|
return {
|
|
@@ -483,12 +484,12 @@ const scriptParser = (sentenceRaw, assetSetter, ADD_NEXT_ARG_LIST, SCRIPT_CONFIG
|
|
|
483
484
|
args.push(e);
|
|
484
485
|
}
|
|
485
486
|
}
|
|
486
|
-
content = contentParser(newSentenceRaw, command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
487
|
+
content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
487
488
|
sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
|
|
488
489
|
subScene = subSceneScanner(command, content); // 扫描语句携带子场景
|
|
489
490
|
return {
|
|
490
491
|
command: command,
|
|
491
|
-
commandRaw: commandRaw,
|
|
492
|
+
commandRaw: commandRaw.trim(),
|
|
492
493
|
content: content,
|
|
493
494
|
args: args,
|
|
494
495
|
sentenceAssets: sentenceAssets,
|
|
@@ -435,8 +435,9 @@ var webgalParser = (function (exports) {
|
|
|
435
435
|
let parsedCommand; // 解析后的命令
|
|
436
436
|
let commandRaw;
|
|
437
437
|
// 正式开始解析
|
|
438
|
-
//
|
|
439
|
-
let newSentenceRaw = sentenceRaw.split(
|
|
438
|
+
// 去分号
|
|
439
|
+
let newSentenceRaw = sentenceRaw.split(/(?<!\\);/)[0];
|
|
440
|
+
newSentenceRaw = newSentenceRaw.replaceAll('\\;', ';');
|
|
440
441
|
if (newSentenceRaw === '') {
|
|
441
442
|
// 注释提前返回
|
|
442
443
|
return {
|
|
@@ -486,12 +487,12 @@ var webgalParser = (function (exports) {
|
|
|
486
487
|
args.push(e);
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
|
-
content = contentParser(newSentenceRaw, command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
490
|
+
content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
490
491
|
sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
|
|
491
492
|
subScene = subSceneScanner(command, content); // 扫描语句携带子场景
|
|
492
493
|
return {
|
|
493
494
|
command: command,
|
|
494
|
-
commandRaw: commandRaw,
|
|
495
|
+
commandRaw: commandRaw.trim(),
|
|
495
496
|
content: content,
|
|
496
497
|
args: args,
|
|
497
498
|
sentenceAssets: sentenceAssets,
|
package/package.json
CHANGED
|
@@ -35,8 +35,9 @@ export const scriptParser = (
|
|
|
35
35
|
|
|
36
36
|
// 正式开始解析
|
|
37
37
|
|
|
38
|
-
//
|
|
39
|
-
let newSentenceRaw = sentenceRaw.split(
|
|
38
|
+
// 去分号
|
|
39
|
+
let newSentenceRaw = sentenceRaw.split(/(?<!\\);/)[0];
|
|
40
|
+
newSentenceRaw = newSentenceRaw.replaceAll('\\;',';');
|
|
40
41
|
if (newSentenceRaw === '') {
|
|
41
42
|
// 注释提前返回
|
|
42
43
|
return {
|
|
@@ -56,7 +57,11 @@ export const scriptParser = (
|
|
|
56
57
|
// 没有command,说明这是一条连续对话或单条语句
|
|
57
58
|
if (getCommandResult === null) {
|
|
58
59
|
commandRaw = newSentenceRaw;
|
|
59
|
-
parsedCommand = commandParser(
|
|
60
|
+
parsedCommand = commandParser(
|
|
61
|
+
commandRaw,
|
|
62
|
+
ADD_NEXT_ARG_LIST,
|
|
63
|
+
SCRIPT_CONFIG_MAP,
|
|
64
|
+
);
|
|
60
65
|
command = parsedCommand.type;
|
|
61
66
|
for (const e of parsedCommand.additionalArgs) {
|
|
62
67
|
// 由于是连续对话,所以我们去除 speaker 参数。
|
|
@@ -72,7 +77,11 @@ export const scriptParser = (
|
|
|
72
77
|
getCommandResult.index + 1,
|
|
73
78
|
newSentenceRaw.length,
|
|
74
79
|
);
|
|
75
|
-
parsedCommand = commandParser(
|
|
80
|
+
parsedCommand = commandParser(
|
|
81
|
+
commandRaw,
|
|
82
|
+
ADD_NEXT_ARG_LIST,
|
|
83
|
+
SCRIPT_CONFIG_MAP,
|
|
84
|
+
);
|
|
76
85
|
command = parsedCommand.type;
|
|
77
86
|
for (const e of parsedCommand.additionalArgs) {
|
|
78
87
|
args.push(e);
|
|
@@ -91,12 +100,12 @@ export const scriptParser = (
|
|
|
91
100
|
args.push(e);
|
|
92
101
|
}
|
|
93
102
|
}
|
|
94
|
-
content = contentParser(newSentenceRaw, command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
103
|
+
content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
|
|
95
104
|
sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
|
|
96
105
|
subScene = subSceneScanner(command, content); // 扫描语句携带子场景
|
|
97
106
|
return {
|
|
98
107
|
command: command, // 语句类型
|
|
99
|
-
commandRaw: commandRaw, // 命令原始内容,方便调试
|
|
108
|
+
commandRaw: commandRaw.trim(), // 命令原始内容,方便调试
|
|
100
109
|
content: content, // 语句内容
|
|
101
110
|
args: args, // 参数列表
|
|
102
111
|
sentenceAssets: sentenceAssets, // 语句携带的资源列表
|