Skip to content

Commit

Permalink
修正合法的Lua标识符没有排除可见符号的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Nov 20, 2024
1 parent ad19406 commit 9812cd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/lua.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export function getValidName(name: string): string {
luaName = '_' + luaName;
}
// 把特殊符号替换成下划线
luaName = luaName.replace(/[\x00-\x08\x0B-\x1F\x7F-\x9F]/g, '_');
luaName = luaName.replace(/[\x00-\x08\x0B-\x2F\x3A-\x40\x5B-\x60\x7B-\x9F]/g, '_');
// 如果是关键字,后面加上下划线
if (keywords.has(luaName)) {
luaName = luaName + "_";
Expand Down

0 comments on commit 9812cd1

Please sign in to comment.