MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / internal_execute

Method internal_execute

src/LuaState.cpp:136–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void LuaState::internal_execute(const char *statement, bool clear)
137{
138 // There may be other things on the stack so save the top of it
139 const int stacktop = lua_gettop(L);
140
141 int status = luaL_loadstring(L, statement);
142
143 if (status == LUA_OK) {
144 status = lua_pcall(L, 0, LUA_MULTRET, 0);
145 }
146 else if (status == LUA_ERRSYNTAX) {
147 qWarning("LUA_ERRSYNTAX: %s", statement);
148 }
149 else if (status == LUA_ERRMEM) {
150 qFatal("Lua memory allocation error");
151 }
152
153 if (status != LUA_OK) {
154 // Print an error message
155 //writeErrorToOutput(lua_tostring(L, -1));
156 //writeErrorToOutput("\r\n");
157 qWarning("%s", lua_tostring(L, -1));
158 }
159
160 if (clear)
161 lua_settop(L, stacktop);
162}
163
164void LuaState::executeFile(const QString &fileName)
165{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected