Replies: 5 comments
-
感觉不治本。还是不混用 $ 和注释比较好。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
我考虑加一个 # 注释。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
在替换 $ 之前,string.gsub 先把注释删掉,感觉已经很治本了 🐱 |
Beta Was this translation helpful? Give feedback.
0 replies
-
按 lua 的语法,[[ ]] 间的字符串,会忽略 — 语意。也就是说, — 未必是注释。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
如果配置文件含有
-- abc = "$XXX_PORT"
skynet 加载配置时会先替换环境变量,而没有检查这个 XXX_PORT 是否在 Lua 的注释里,找不到环境变量时报错。
skynet/skynet-src/skynet_main.c
Lines 103 to 106 in 65eb351
在 L104 与 L105 之间应该加一句
code = string.gsub(code, '%-%-.-[\\r\\n]', '\\n')\n\
先过滤掉注释
Beta Was this translation helpful? Give feedback.
All reactions