Ues linenoise in Lua, Python, and SQLite

This commit is contained in:
Justine Tunney 2021-08-14 11:26:23 -07:00
parent fe29710e4e
commit 1e5bd4d23e
14 changed files with 230 additions and 303 deletions

View file

@ -412,6 +412,14 @@ static int handle_luainit (lua_State *L) {
#define lua_saveline(L,line) ((void)L, add_history(line))
#define lua_freeline(L,b) ((void)L, free(b))
#elif defined(LUA_USE_LINENOISE)
#include "third_party/linenoise/linenoise.h"
#define lua_initreadline(L) ((void)L)
#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
#define lua_saveline(L,line) ((void)L, linenoiseHistoryAdd(line))
#define lua_freeline(L,b) ((void)L, free(b))
#else /* }{ */
#define lua_initreadline(L) ((void)L)

View file

@ -34,6 +34,7 @@ THIRD_PARTY_LUA_DIRECTDEPS = \
LIBC_TIME \
LIBC_TINYMATH \
LIBC_UNICODE \
THIRD_PARTY_LINENOISE \
THIRD_PARTY_GDTOA
THIRD_PARTY_LUA_DEPS := \

View file

@ -7,6 +7,7 @@
#include "third_party/gdtoa/gdtoa.h"
#define LUA_USE_POSIX
#define LUA_USE_LINENOISE
/* clang-format off */