aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL_compile.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/LuaSL/LuaSL_compile.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c
index 13ebe1e..2b838e3 100644
--- a/src/LuaSL/LuaSL_compile.c
+++ b/src/LuaSL/LuaSL_compile.c
@@ -220,15 +220,6 @@ LSL_Script constants;
220int lowestToken = 999999; 220int lowestToken = 999999;
221 221
222 222
223void finishMessage(LuaCompile *compiler, compileMessage *message, int type, int column, int line)
224{
225 message->type = type;
226 message->column = column;
227 message->line = line;
228 if (type)
229 compiler->bugCount++;
230}
231
232static LSL_Leaf *newLeaf(LSL_Type type, LSL_Leaf *left, LSL_Leaf *right) 223static LSL_Leaf *newLeaf(LSL_Type type, LSL_Leaf *left, LSL_Leaf *right)
233{ 224{
234 LSL_Leaf *leaf = calloc(1, sizeof(LSL_Leaf)); 225 LSL_Leaf *leaf = calloc(1, sizeof(LSL_Leaf));
@@ -596,7 +587,7 @@ else if (right)
596 printf("NOLEFT %s %s\n", lval->toKen->toKen, right->toKen->toKen); 587 printf("NOLEFT %s %s\n", lval->toKen->toKen, right->toKen->toKen);
597else 588else
598 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen); 589 printf("NOLEFT %s NORIGHT\n", lval->toKen->toKen);
599 printf("############################################################################## left\n"); 590 printf("############################################################################## left - column %i, line %i %s\n", lval->column, lval->line, compiler->compiler->file);
600#endif 591#endif
601 left->flags |= MF_WRAPFUNC; 592 left->flags |= MF_WRAPFUNC;
602 if (LSL_PARENTHESIS_OPEN == left->toKen->type) 593 if (LSL_PARENTHESIS_OPEN == left->toKen->type)
@@ -2222,7 +2213,7 @@ boolean compilerSetup(gameGlobals *ourGlobals)
2222 if (tokens) 2213 if (tokens)
2223 { 2214 {
2224 char buf[PATH_MAX]; 2215 char buf[PATH_MAX];
2225 LuaCompiler *compiler = calloc(1, sizeof(LuaCompiler)); 2216 LuaCompiler *compiler;
2226 2217
2227 // Sort the token table. 2218 // Sort the token table.
2228 for (i = 0; LSL_Tokens[i].toKen != NULL; i++) 2219 for (i = 0; LSL_Tokens[i].toKen != NULL; i++)
@@ -2236,10 +2227,8 @@ boolean compilerSetup(gameGlobals *ourGlobals)
2236 snprintf(buf, sizeof(buf), "luajit -e 'require(\"LSL\").gimmeLSL()' > %s/constants.lsl", prefix_lib_get()); 2227 snprintf(buf, sizeof(buf), "luajit -e 'require(\"LSL\").gimmeLSL()' > %s/constants.lsl", prefix_lib_get());
2237 system(buf); 2228 system(buf);
2238 snprintf(buf, sizeof(buf), "%s/constants.lsl", prefix_lib_get()); 2229 snprintf(buf, sizeof(buf), "%s/constants.lsl", prefix_lib_get());
2239 compiler->file = strdup(buf); 2230 compiler = createCompiler("FAKE_SID", buf, (compileCb) compileLSL, NULL);
2240 compiler->SID = strdup("FAKE_SID");
2241 compiler->doConstants = TRUE; 2231 compiler->doConstants = TRUE;
2242 compiler->parser = (compileCb) compileLSL;
2243 compileScript(compiler, FALSE); 2232 compileScript(compiler, FALSE);
2244 2233
2245 return TRUE; 2234 return TRUE;