Implement deque, fix luaconsole

This commit is contained in:
2021-07-12 00:37:07 -04:00
parent 16c0fd45de
commit 7290beee34
4 changed files with 202 additions and 124 deletions

View File

@@ -80,10 +80,11 @@ void LuaConsole::add(std::string line) {
int status = luaL_loadbuffer(lua_state_, partial.c_str(), partial.size(), "=stdin");
if (status == LUA_ERRSYNTAX)
{
const char *eof = "'<eof>'";
const char *eof = "<eof>";
int leof = strlen(eof);
size_t lmsg;
const char *msg = lua_tolstring(lua_state_, -1, &lmsg);
const char *tp = msg + lmsg - (sizeof(eof) - 1);
const char *tp = msg + lmsg - leof;
if (strstr(msg, eof) == tp) {
action_ = DO_NOTHING;
} else {