reformatted with zig fmt

This commit is contained in:
Squibid 2026-03-01 22:23:31 -05:00
parent e6a45f91b6
commit 6be66b6a71
Signed by: squibid
GPG key ID: BECE5684D3C4005D
32 changed files with 2108 additions and 2237 deletions

View file

@ -6,23 +6,23 @@ const zlua = @import("zlua");
const gpa = std.heap.c_allocator;
pub fn getNestedField(L: *zlua.Lua, path: []u8) bool {
var tokens = std.mem.tokenizeScalar(u8, path, '.');
var first = true;
var tokens = std.mem.tokenizeScalar(u8, path, '.');
var first = true;
while (tokens.next()) |token| {
const tok = gpa.dupeZ(u8, token) catch return false;
if (first) {
_ = L.getGlobal(tok) catch return false;
first = false;
} else {
_ = L.getField(-1, tok);
L.remove(-2);
while (tokens.next()) |token| {
const tok = gpa.dupeZ(u8, token) catch return false;
if (first) {
_ = L.getGlobal(tok) catch return false;
first = false;
} else {
_ = L.getField(-1, tok);
L.remove(-2);
}
if (L.isNil(-1)) {
return false;
}
}
if (L.isNil(-1)) {
return false;
}
}
return true;
return true;
}