Skip to content

Commit 20e76fa

Browse files
fix: variable regexp
1 parent 0b37a63 commit 20e76fa

File tree

1 file changed

+1
-1
lines changed
  • packages/webgal/src/Core/gameScripts

1 file changed

+1
-1
lines changed

packages/webgal/src/Core/gameScripts/setVar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const setVar = (sentence: ISentence): IPerform => {
3939
// 将变量替换为变量的值,然后合成表达式字符串
4040
const valExp2 = valExpArr
4141
.map((e) => {
42-
if (!e.trim().match(/^[a-zA-Z_][a-zA-Z0-9_]*$/)) {
42+
if (!e.trim().match(/^[a-zA-Z_$][a-zA-Z0-9_.]*$/)) {
4343
// 检查是否是变量名,不是就返回本身
4444
return e;
4545
}

0 commit comments

Comments
 (0)