diff options
Diffstat (limited to 'examples/scripting/lua/lua.zc')
| -rw-r--r-- | examples/scripting/lua/lua.zc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/scripting/lua/lua.zc b/examples/scripting/lua/lua.zc index a8463fa..ebd3ae6 100644 --- a/examples/scripting/lua/lua.zc +++ b/examples/scripting/lua/lua.zc @@ -8,7 +8,7 @@ import "lauxlib.h"; import "lualib.h"; fn l_zenc_hello(L: lua_State*) -> int { - const name: string = (string)luaL_optstring(L, 1, "world"); + let name: string = (string)luaL_optstring(L, 1, "world"); println "hello from Zen-C, {name}" return 0; } @@ -27,21 +27,21 @@ fn main() { lua_setglobal(L, "zenc_hello"); // Run some Lua from a Zen-C variable - const script = "print('hello from lua')\nzenc_hello('test')\n"; + let script = "print('hello from lua')\nzenc_hello('test')\n"; if (luaL_dostring(L, script) != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua error: {err}" lua_pop(L, 1); } // Run some Lua from a script file if (luaL_loadfile(L, "script.lua") != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua load-error: {err}" lua_pop(L, 1); } else if (lua_pcall(L, 0, 0, 0) != LUA_OK) { - const err: string = (string)lua_tostring(L, -1); + let err: string = (string)lua_tostring(L, -1); !"lua error: {err}" lua_pop(L, 1); } |
