diff options
| author | Zuhaitz <zuhaitz.zechhub@gmail.com> | 2026-01-26 00:39:31 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 00:39:31 +0000 |
| commit | ca08979910e5a234a2423e4448ad0e284bf4f508 (patch) | |
| tree | e09702f7b0850feb00a6af7f315bff7448c2ed26 /examples/scripting | |
| parent | 6bef876bf900458a36260ca3fe96e23b06749d74 (diff) | |
| parent | 97d0583c92c733aa8497a99f5267d50151f6e965 (diff) | |
Merge pull request #132 from Burnett01/fix/var-const-remains-in-examples
Housekeeping: Fix var/const remains in examples and docs
Diffstat (limited to 'examples/scripting')
| -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); } |
