diff options
author | David Walter Seikel | 2014-08-14 06:37:29 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-08-14 06:37:29 +1000 |
commit | ba57301e92831606a18289ec10c314edd756f311 (patch) | |
tree | bb07db3340db45afc5bf795518e288a991c6312d /src/LuaSL/LuaSL_main.c | |
parent | Remove a warning in lemon. (diff) | |
download | SledjHamr-ba57301e92831606a18289ec10c314edd756f311.zip SledjHamr-ba57301e92831606a18289ec10c314edd756f311.tar.gz SledjHamr-ba57301e92831606a18289ec10c314edd756f311.tar.bz2 SledjHamr-ba57301e92831606a18289ec10c314edd756f311.tar.xz |
Considerable cleanup of the top level compiling code.
Diffstat (limited to '')
-rw-r--r-- | src/LuaSL/LuaSL_main.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c index 3ed9004..f316fdb 100644 --- a/src/LuaSL/LuaSL_main.c +++ b/src/LuaSL/LuaSL_main.c | |||
@@ -186,10 +186,6 @@ static void _compileCb(LuaCompiler *compiler) | |||
186 | sendBack(compiler->client, compiler->SID, "compiled(true)"); | 186 | sendBack(compiler->client, compiler->SID, "compiled(true)"); |
187 | else | 187 | else |
188 | sendBack(compiler->client, compiler->SID, "compiled(false)"); | 188 | sendBack(compiler->client, compiler->SID, "compiled(false)"); |
189 | free(compiler->luaName); | ||
190 | free(compiler->SID); | ||
191 | free(compiler->file); | ||
192 | free(compiler); | ||
193 | } | 189 | } |
194 | 190 | ||
195 | static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Data *ev) | 191 | static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_Data *ev) |
@@ -218,7 +214,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
218 | { | 214 | { |
219 | char *temp; | 215 | char *temp; |
220 | char *file; | 216 | char *file; |
221 | LuaSL_compiler *compiler = calloc(1, sizeof(LuaSL_compiler)); | 217 | LuaCompiler *compiler = calloc(1, sizeof(LuaCompiler)); |
222 | 218 | ||
223 | strcpy(buf, &command[8]); | 219 | strcpy(buf, &command[8]); |
224 | temp = buf; | 220 | temp = buf; |
@@ -227,23 +223,13 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D | |||
227 | temp++; | 223 | temp++; |
228 | temp[0] = '\0'; | 224 | temp[0] = '\0'; |
229 | 225 | ||
230 | compiler->compiler.file = strdup(file); | 226 | compiler->file = strdup(file); |
231 | compiler->compiler.SID = strdup(SID); | 227 | compiler->SID = strdup(SID); |
232 | compiler->compiler.client = ev->client; | 228 | compiler->client = ev->client; |
233 | compiler->compiler.data = ourGlobals; | ||
234 | compiler->compiler.cb = _compileCb; | ||
235 | compiler->doConstants = FALSE; | 229 | compiler->doConstants = FALSE; |
236 | #if COMPILE_THREADED | 230 | compiler->parser = (compileCb) compileLSL; |
237 | compiler->compiler.parser = (compileCb) compileLSL; | 231 | compiler->cb = _compileCb; |
238 | compileScript(&compiler->compiler); | 232 | compileScript(compiler, COMPILE_THREADED); |
239 | #else | ||
240 | if (!compileLSL(compiler)) | ||
241 | { | ||
242 | compiler->compiler.bugCount++; | ||
243 | PE("Compile of %s failed in a mysterious way.", file); | ||
244 | _compileCb(&(compiler->compiler)); | ||
245 | } | ||
246 | #endif | ||
247 | } | 233 | } |
248 | else if (0 == strncmp(command, "run(", 4)) | 234 | else if (0 == strncmp(command, "run(", 4)) |
249 | { | 235 | { |