Improved README.md

This commit is contained in:
abux 2026-07-27 09:23:51 +01:00
parent a28b585cd4
commit 196b56935c
2 changed files with 32 additions and 1 deletions

View file

@ -1,3 +1,34 @@
**Simple**
```zig
// --- ZLA ---
var zla: Zla = try .init();
defer zla.deinit();
// --- EXEC FILE ---
try zla.execFromFile(
void,
"src/scripts/basic.lua",
);
// --- CALL ---
try zla.call(void, "hello", .{"World"});
try zla.call(void, "hello", .{"..."});
```
**Call function from lua**
```zig
try zla.call(void, "hello", .{"World"});
```
**Call function from lua with return type**
```zig
const coords = try zl.call(
struct { f64, f64 },
"getCoords",
.{},
);
```
**Dependancies** **Dependancies**
```bash ```bash
sudo pacman -Sy lua --needed sudo pacman -Sy lua --needed

View file

@ -368,7 +368,7 @@ fn increment(ctx: *Ctx) i64 {
test "exec" { test "exec" {
// --- ZLA --- // --- ZLA ---
var zl = try Self.init(); var zl: Self = try .init();
defer zl.deinit(); defer zl.deinit();
// --- REGISTER FUNCTIONS TO LUA --- // --- REGISTER FUNCTIONS TO LUA ---