diff --git a/src/ziglua-5.1/lib.zig b/src/ziglua-5.1/lib.zig index 13af5eb..2727896 100644 --- a/src/ziglua-5.1/lib.zig +++ b/src/ziglua-5.1/lib.zig @@ -1298,8 +1298,7 @@ pub const Lua = struct { /// Creates a copy of string `str`, replacing any occurrence of the string `pat` with the string `rep` /// Pushes the resulting string on the stack and returns it. /// See https://www.lua.org/manual/5.1/manual.html#luaL_gsub - /// TODO: rename to globalSub - pub fn gSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { + pub fn globalSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { return std.mem.span(c.luaL_gsub(lua.state, str.ptr, pat.ptr, rep.ptr)); } diff --git a/src/ziglua-5.1/tests.zig b/src/ziglua-5.1/tests.zig index e3dac5c..b0c07c5 100644 --- a/src/ziglua-5.1/tests.zig +++ b/src/ziglua-5.1/tests.zig @@ -995,11 +995,11 @@ test "checkOption" { try expectEqualStrings("bad argument #1 to '?' (invalid option 'unknown')", try lua.toBytes(-1)); } -test "gSub" { +test "globalSub" { var lua = try Lua.init(testing.allocator); defer lua.deinit(); - _ = lua.gSub("-gity -!", "-", "zig"); + _ = lua.globalSub("-gity -!", "-", "zig"); try expectEqualStrings("ziggity zig!", try lua.toBytes(-1)); } diff --git a/src/ziglua-5.2/lib.zig b/src/ziglua-5.2/lib.zig index 9e55020..2b2b99c 100644 --- a/src/ziglua-5.2/lib.zig +++ b/src/ziglua-5.2/lib.zig @@ -1407,7 +1407,7 @@ pub const Lua = struct { /// Creates a copy of string `str`, replacing any occurrence of the string `pat` with the string `rep` /// Pushes the resulting string on the stack and returns it. - pub fn gSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { + pub fn globalSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { return std.mem.span(c.luaL_gsub(lua.state, str.ptr, pat.ptr, rep.ptr)); } diff --git a/src/ziglua-5.2/tests.zig b/src/ziglua-5.2/tests.zig index f2354f7..b2516ca 100644 --- a/src/ziglua-5.2/tests.zig +++ b/src/ziglua-5.2/tests.zig @@ -1211,11 +1211,11 @@ test "checkOption" { try expectEqualStrings("bad argument #1 to '?' (invalid option 'unknown')", try lua.toBytes(-1)); } -test "gSub" { +test "globalSub" { var lua = try Lua.init(testing.allocator); defer lua.deinit(); - _ = lua.gSub("-gity -!", "-", "zig"); + _ = lua.globalSub("-gity -!", "-", "zig"); try expectEqualStrings("ziggity zig!", try lua.toBytes(-1)); } diff --git a/src/ziglua-5.3/lib.zig b/src/ziglua-5.3/lib.zig index 3bb3493..9e207a5 100644 --- a/src/ziglua-5.3/lib.zig +++ b/src/ziglua-5.3/lib.zig @@ -1463,7 +1463,7 @@ pub const Lua = struct { /// Creates a copy of string `str`, replacing any occurrence of the string `pat` with the string `rep` /// Pushes the resulting string on the stack and returns it. - pub fn gSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { + pub fn globalSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { return std.mem.span(c.luaL_gsub(lua.state, str.ptr, pat.ptr, rep.ptr)); } diff --git a/src/ziglua-5.3/tests.zig b/src/ziglua-5.3/tests.zig index 1919d9e..c41fb82 100644 --- a/src/ziglua-5.3/tests.zig +++ b/src/ziglua-5.3/tests.zig @@ -1240,11 +1240,11 @@ test "checkOption" { try expectEqualStrings("bad argument #1 to '?' (invalid option 'unknown')", try lua.toBytes(-1)); } -test "gSub" { +test "globalSub" { var lua = try Lua.init(testing.allocator); defer lua.deinit(); - _ = lua.gSub("-gity -!", "-", "zig"); + _ = lua.globalSub("-gity -!", "-", "zig"); try expectEqualStrings("ziggity zig!", try lua.toBytes(-1)); } diff --git a/src/ziglua-5.4/lib.zig b/src/ziglua-5.4/lib.zig index 4f59e4c..074403d 100644 --- a/src/ziglua-5.4/lib.zig +++ b/src/ziglua-5.4/lib.zig @@ -1507,7 +1507,7 @@ pub const Lua = struct { /// Creates a copy of string `str`, replacing any occurrence of the string `pat` with the string `rep` /// Pushes the resulting string on the stack and returns it. - pub fn gSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { + pub fn globalSub(lua: *Lua, str: [:0]const u8, pat: [:0]const u8, rep: [:0]const u8) [:0]const u8 { return std.mem.span(c.luaL_gsub(lua.state, str.ptr, pat.ptr, rep.ptr)); } diff --git a/src/ziglua-5.4/tests.zig b/src/ziglua-5.4/tests.zig index aad81a0..2ccd4f8 100644 --- a/src/ziglua-5.4/tests.zig +++ b/src/ziglua-5.4/tests.zig @@ -1321,11 +1321,11 @@ test "checkOption" { try expectEqualStrings("bad argument #1 to '?' (invalid option 'unknown')", try lua.toBytes(-1)); } -test "gSub" { +test "globalSub" { var lua = try Lua.init(testing.allocator); defer lua.deinit(); - _ = lua.gSub("-gity -!", "-", "zig"); + _ = lua.globalSub("-gity -!", "-", "zig"); try expectEqualStrings("ziggity zig!", try lua.toBytes(-1)); }