Skip to content

Commit

Permalink
Add dummy implementation of lualex
Browse files Browse the repository at this point in the history
  • Loading branch information
Askaholic committed Sep 21, 2021
1 parent 565f4a1 commit 7f22ef0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/lstrlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,12 @@ static int str_format (lua_State *L) {
}


static int str_lualex (lua_State *L) {
// TODO: Implement
return 1;
}


static const luaL_reg strlib[] = {
{"len", str_len},
{"sub", str_sub},
Expand All @@ -756,6 +762,7 @@ static const luaL_reg strlib[] = {
{"find", str_find},
{"gfind", gfind},
{"gsub", str_gsub},
{"lualex", str_lualex},
{NULL, NULL}
};

Expand Down
3 changes: 3 additions & 0 deletions test/faf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ assert(str:sub(2) == "bcdefghijklmnop")
assert(str:sub(2, -2) == "bcdefghijklmno")
assert(str:sub(2, 8) == "bcdefgh")

assert(str:lualex() == str)

local string_func_names = {}
local n=0

Expand All @@ -129,6 +131,7 @@ for k in string do
end
assert(table.concat(string_func_names) == table.concat({
"sub",
"lualex",
"gfind",
"rep",
"gsub",
Expand Down

0 comments on commit 7f22ef0

Please sign in to comment.