Replies: 3 comments
-
a.lua 的模块写法不对,外面的脚本域模块是 xmake 抽象定制过得,不走 require,不需要 return a.lua function _foo()
end
function test()
_foo()
end
function main()
end 其中 main 为入口函数,可选,如果设置,模块a可以直接被调用,例如: import("a")
a() 其他不带下划线的为 public 模块接口函数,例如 test, import("a")
a.test() 带下划线前缀的 _foo 是私有函数,模块内部使用,不对外导出,外面不可调用 |
Beta Was this translation helpful? Give feedback.
0 replies
-
把文档完善一下吧 |
Beta Was this translation helpful? Give feedback.
0 replies
-
东西太多,时间太少,有时间会逐步完善,但目前的精力不可能一下子全补全,还有大量扩展模块都没空写 |
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
Uh oh!
There was an error while loading. Please reload this page.
-
描述问题
import 导入本地lua 文件总是返回 {}
xmake/xmake/core/sandbox/sandbox.lua
Line 272 in 0ef8c1b
期待的结果
正确返回 lua return 内容
相关环境
其他信息
file: a.lua
file: xmake.lua
看了代码,最终走到
xmake/xmake/core/sandbox/sandbox.lua
Lines 266 to 279 in 0ef8c1b
errors 是 a.lua 的结果。但是并没有使用它
Beta Was this translation helpful? Give feedback.
All reactions