From 6456087cf379b3aa7e8bec983907fa1758a4fa73 Mon Sep 17 00:00:00 2001 From: xiaoxustudio <1783558957@qq.com> Date: Sun, 18 Jan 2026 15:34:05 +0800 Subject: [PATCH 1/2] fix: sentence save end-of-line comment --- packages/parser/src/scriptParser/scriptParser.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/parser/src/scriptParser/scriptParser.ts b/packages/parser/src/scriptParser/scriptParser.ts index ba2db0ba6..8df9ffffb 100644 --- a/packages/parser/src/scriptParser/scriptParser.ts +++ b/packages/parser/src/scriptParser/scriptParser.ts @@ -102,6 +102,12 @@ export const scriptParser = ( args.push(e); } } + + // 保留注释 + if (sentenceComment.trim() !== '') { + args.push({ key: 'comment', value: sentenceComment.trim() }); + } + content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径 sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源 subScene = subSceneScanner(command, content); // 扫描语句携带子场景 From 3ce6e386a3fcbfe2e089f06ac0da7f2e307a2c3a Mon Sep 17 00:00:00 2001 From: Xuran <1783558957@qq.com> Date: Sun, 18 Jan 2026 16:56:12 +0800 Subject: [PATCH 2/2] chore: write to variable Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- packages/parser/src/scriptParser/scriptParser.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/parser/src/scriptParser/scriptParser.ts b/packages/parser/src/scriptParser/scriptParser.ts index 8df9ffffb..f17f7095d 100644 --- a/packages/parser/src/scriptParser/scriptParser.ts +++ b/packages/parser/src/scriptParser/scriptParser.ts @@ -104,8 +104,9 @@ export const scriptParser = ( } // 保留注释 - if (sentenceComment.trim() !== '') { - args.push({ key: 'comment', value: sentenceComment.trim() }); + const trimmedComment = sentenceComment.trim(); + if (trimmedComment) { + args.push({ key: 'comment', value: trimmedComment }); } content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径