Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/parser/src/interface/sceneInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface ISentence {
args: Array<arg>; // 参数列表
sentenceAssets: Array<IAsset>; // 语句携带的资源列表
subScene: Array<string>; // 语句包含子场景列表
comment: string; // 语句行尾注释
}

/**
Expand Down
8 changes: 2 additions & 6 deletions packages/parser/src/scriptParser/scriptParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const scriptParser = (
args: [{ key: 'next', value: true }], // 参数列表
sentenceAssets: [], // 语句携带的资源列表
subScene: [], // 语句携带的子场景
comment: '',
};
}
// 截取命令
Expand Down Expand Up @@ -103,12 +104,6 @@ export const scriptParser = (
}
}

// 保留注释
const trimmedComment = sentenceComment.trim();
if (trimmedComment) {
args.push({ key: 'comment', value: trimmedComment });
}

content = contentParser(newSentenceRaw.trim(), command, assetSetter); // 将语句内容里的文件名转为相对或绝对路径
sentenceAssets = assetsScanner(command, content, args); // 扫描语句携带资源
subScene = subSceneScanner(command, content); // 扫描语句携带子场景
Expand All @@ -119,5 +114,6 @@ export const scriptParser = (
args: args, // 参数列表
sentenceAssets: sentenceAssets, // 语句携带的资源列表
subScene: subScene, // 语句携带的子场景
comment: sentenceComment.trim(),
};
};