From 3fe77cbf3eae108a3963f16bf69cb8e06ddc4cbd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 25 Sep 2021 19:05:15 -0700 Subject: :eachmatch() -> :matches() --- Lua/lbp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Lua/lbp.c') diff --git a/Lua/lbp.c b/Lua/lbp.c index 050d0e8..51ba9d2 100644 --- a/Lua/lbp.c +++ b/Lua/lbp.c @@ -3,11 +3,11 @@ * API: * bp.match(pat, str, [start_index]) -> nil or match_table * bp.replace(pat, replacement, str, [start_index]) -> str with replacements, num_replacements -* for match_table in bp.eachmatch(pat, str, [start_index]) do ... end +* for match_table in bp.matches(pat, str, [start_index]) do ... end * bp.compile(pat) -> pattern object * pat:match(str, [start_index]) * pat:replace(replacement, str, [start_index]) -* for match in pat:eachmatch(str, [start_index]) do ... end +* for match in pat:matches(str, [start_index]) do ... end */ #include @@ -240,7 +240,7 @@ static int iter(lua_State *L) return Lmatch(L); } -static int Leachmatch(lua_State *L) +static int Lmatches(lua_State *L) { int nargs = lua_gettop(L); lua_pushcfunction(L, iter); // iter @@ -294,7 +294,7 @@ static const luaL_Reg match_metamethods[] = { static const luaL_Reg pat_methods[] = { {"match", Lmatch}, {"replace", Lreplace}, - {"eachmatch", Leachmatch}, + {"matches", Lmatches}, {NULL, NULL} }; @@ -309,7 +309,7 @@ static const luaL_Reg bp_methods[] = { {"match", Lmatch}, {"replace", Lreplace}, {"compile", Lcompile}, - {"eachmatch", Leachmatch}, + {"matches", Lmatches}, {NULL, NULL} }; -- cgit v1.2.3