Migrated engine to using dlmalloc through eng::

This commit is contained in:
2022-02-24 02:17:41 -05:00
parent acc00289fb
commit f467944095
61 changed files with 631 additions and 590 deletions

View File

@@ -16,9 +16,9 @@ LuaConsole::~LuaConsole() {
lua_close(lua_state_);
}
static LuaConsole::StringVec split_words(const std::string &raw) {
static LuaConsole::StringVec split_words(const eng::string &raw) {
LuaConsole::StringVec result;
std::string acc;
eng::string acc;
for (char c : raw) {
if ((c == ' ')||(c == '\n')||(c == '\r')) {
if (!acc.empty()) {
@@ -41,7 +41,7 @@ LuaConsole::StringVec LuaConsole::get_command() {
return result;
}
void LuaConsole::synerr(const std::string &msg) {
void LuaConsole::synerr(const eng::string &msg) {
words_.clear();
words_.push_back("syntax");
words_.push_back(msg);
@@ -104,7 +104,7 @@ void LuaConsole::clear_raw_input() {
prompt_ = "> ";
}
void LuaConsole::add(std::string line) {
void LuaConsole::add(eng::string line) {
for (int i = 0; i < int(line.size()); i++) {
if (line[i] == '\n') line[i] = ' ';
}
@@ -122,17 +122,17 @@ void LuaConsole::add(std::string line) {
}
// Translate lua expression, deal with initial prefix.
std::string partial;
std::string lua_mode;
eng::string partial;
eng::string lua_mode;
if (util::has_prefix(raw_input_, "?=")) {
lua_mode = "luaprobe";
partial = std::string("return ") + raw_input_.substr(2);
partial = eng::string("return ") + raw_input_.substr(2);
} else if (util::has_prefix(raw_input_, "?")) {
lua_mode = "luaprobe";
partial = raw_input_.substr(1);
} else if (util::has_prefix(raw_input_, "=")) {
lua_mode = "luainvoke";
partial = std::string("return ") + raw_input_.substr(1);
partial = eng::string("return ") + raw_input_.substr(1);
} else {
lua_mode = "luainvoke";
partial = raw_input_;