const str = '@bgm file="cat.mp3" p2=1';
function to_token(pstr)
{
const parts = str.split(' ');
const command = parts[0].substring(1);
const params = {};
parts.slice(1).forEach((part) => {
const [key, value] = part.split('=');
params[key] = value;
});
var result = {}
result.command = command
result.params = params
return result
}
命令式视觉小说语言词法分析器(js)
最新推荐文章于 2024-11-10 22:45:39 发布