docs: fix example code

This commit is contained in:
Nathan Craddock 2022-06-11 16:46:01 -06:00
parent f9a62e70da
commit 0fa25e79a0
No known key found for this signature in database
GPG Key ID: ABE41A31B52E9DA7

View File

@ -187,6 +187,11 @@ Notice that the functions `lua.loadString()` and `lua.protectedCall()` return er
Registering a Zig function to be called from Lua is simple
```zig
const std = @import("std");
const ziglua = @import("ziglua");
const Lua = ziglua.Lua;
fn adder(lua: *Lua) i32 {
const a = lua.toInteger(1);
const b = lua.toInteger(2);