This is the main reference for the World of Warcraft Lua Runtime. Note that these are mostly standard Lua functions, available in most Lua environments. Arguably, we could just refer to the Lua web site, but a few functions differ slightly in Blizzar…
这是我在C里面跑出来的第一个Lua 文件, 纪念一下. 1.Set up envirnonment: Mac下面 Lua的src (即include) 和lib(binary)是分开的, 所以需要分别下载. 使用的是 5.2.3 的src 和 standard lib(5.2.1_MacOS107_lib). include 和 lib 在gcc 编译的时候需要用-L 引入. 2.代码: VERY IMPORTANT: ua_open() should not be used. In lua-5…
前面一篇文章中介绍了lua给下面代码生成最终的字节码的整个过程,这次我们来看看lua vm执行这些字节码的过程. foo = "bar" local a, b = "a", "b" foo = a 生成的字节码如下所示: 之前lua是在luaY_parser函数(入口)中完成了lua脚本的解析生成字节码的整个过程的,在生成了main func(过程见“lua解析赋值类型代码的过程“)后luaY_parser会返回一个Proto结构体指针tf,Pr…