aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL_main.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-08-09 20:09:28 +1000
committerDavid Walter Seikel2014-08-09 20:09:28 +1000
commitb4dae31e4a688dea7779b83451b8179437b9c0c3 (patch)
tree4f3ca77c787a8d6ab6f29ee47d5100b4d8ef1855 /src/LuaSL/LuaSL_main.c
parentMention compiler speed even if the last one failed. (diff)
downloadSledjHamr-b4dae31e4a688dea7779b83451b8179437b9c0c3.zip
SledjHamr-b4dae31e4a688dea7779b83451b8179437b9c0c3.tar.gz
SledjHamr-b4dae31e4a688dea7779b83451b8179437b9c0c3.tar.bz2
SledjHamr-b4dae31e4a688dea7779b83451b8179437b9c0c3.tar.xz
Major cleanup of compileLSL() and friends, including threading it.
Diffstat (limited to 'src/LuaSL/LuaSL_main.c')
-rw-r--r--src/LuaSL/LuaSL_main.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/LuaSL/LuaSL_main.c b/src/LuaSL/LuaSL_main.c
index 41576c2..0378792 100644
--- a/src/LuaSL/LuaSL_main.c
+++ b/src/LuaSL/LuaSL_main.c
@@ -226,7 +226,7 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
226 char *temp; 226 char *temp;
227 char *file; 227 char *file;
228 char *name; 228 char *name;
229 LuaCompiler *compiler = calloc(1, sizeof(LuaCompiler)); 229 LuaSL_compiler *compiler = calloc(1, sizeof(LuaSL_compiler));
230 230
231 strcpy(buf, &command[8]); 231 strcpy(buf, &command[8]);
232 temp = buf; 232 temp = buf;
@@ -237,17 +237,23 @@ static Eina_Bool _data(void *data, int type __UNUSED__, Ecore_Con_Event_Client_D
237 237
238 name = &file[strlen(prefix_data_get())]; 238 name = &file[strlen(prefix_data_get())];
239 PD("Compiling %s, %s.", SID, name); 239 PD("Compiling %s, %s.", SID, name);
240 compiler->file = strdup(file); 240 compiler->compiler.file = strdup(file);
241 compiler->SID = strdup(SID); 241 compiler->compiler.SID = strdup(SID);
242 compiler->client = ev->client; 242 compiler->compiler.client = ev->client;
243 compiler->data = ourGlobals; 243 compiler->compiler.data = ourGlobals;
244 compiler->cb = _compileCb; 244 compiler->compiler.cb = _compileCb;
245 if (!compileLSL(compiler, ourGlobals, ev->client, SID, file, FALSE)) 245 compiler->doConstants = FALSE;
246#if COMPILE_THREADED
247 compiler->compiler.parser = (compileCb) compileLSL;
248 compileScript(&compiler->compiler);
249#else
250 if (!compileLSL(compiler))
246 { 251 {
247 compiler->bugCount++; 252 compiler->compiler.bugCount++;
248 PE("Compile of %s failed in a mysterious way.", file); 253 PE("Compile of %s failed in a mysterious way.", file);
249 _compileCb(compiler); 254 _compileCb(&(compiler->compiler));
250 } 255 }
256#endif
251 } 257 }
252 else if (0 == strcmp(command, "run()")) 258 else if (0 == strcmp(command, "run()"))
253 { 259 {