aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LuaSL/LuaSL_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LuaSL/LuaSL_compile.c')
-rw-r--r--src/LuaSL/LuaSL_compile.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c
index 3265acf..0c398b9 100644
--- a/src/LuaSL/LuaSL_compile.c
+++ b/src/LuaSL/LuaSL_compile.c
@@ -1,5 +1,6 @@
1 1
2#include "LuaSL.h" 2#include "LuaSL.h"
3#include "Runnr.h"
3 4
4/* TODO - problem de jour 5/* TODO - problem de jour
5*/ 6*/
@@ -316,7 +317,6 @@ static LSL_Leaf *findVariable(LuaSL_compiler *compiler, const char *name)
316 317
317LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *dot, LSL_Leaf *sub) 318LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *dot, LSL_Leaf *sub)
318{ 319{
319 gameGlobals *ourGlobals = compiler->game;
320 const char *search; 320 const char *search;
321 321
322 if (dot) 322 if (dot)
@@ -358,7 +358,7 @@ LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf
358 else 358 else
359 { 359 {
360 compiler->script.bugCount++; 360 compiler->script.bugCount++;
361 sendBack(ourGlobals, compiler->client, compiler->SID, "compilerError(%d,%d,NOT found %s)", identifier->line, identifier->column, identifier->value.stringValue); 361 sendBack(compiler->client, compiler->SID, "compilerError(%d,%d,NOT found %s)", identifier->line, identifier->column, identifier->value.stringValue);
362 } 362 }
363 } 363 }
364 364
@@ -367,8 +367,6 @@ LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf
367 367
368LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right) 368LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right)
369{ 369{
370 gameGlobals *ourGlobals = compiler->game;
371
372 if (lval) 370 if (lval)
373 { 371 {
374 opType lType, rType; 372 opType lType, rType;
@@ -402,7 +400,7 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
402 if (OT_undeclared == lType) 400 if (OT_undeclared == lType)
403 { 401 {
404 compiler->script.warningCount++; 402 compiler->script.warningCount++;
405 sendBack(ourGlobals, compiler->client, compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column); 403 sendBack(compiler->client, compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column);
406 lval->basicType = OT_undeclared; 404 lval->basicType = OT_undeclared;
407 return lval; 405 return lval;
408 } 406 }
@@ -430,7 +428,7 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
430 if (OT_undeclared == rType) 428 if (OT_undeclared == rType)
431 { 429 {
432 compiler->script.warningCount++; 430 compiler->script.warningCount++;
433 sendBack(ourGlobals, compiler->client, compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column); 431 sendBack(compiler->client, compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column);
434 lval->basicType = OT_undeclared; 432 lval->basicType = OT_undeclared;
435 return lval; 433 return lval;
436 } 434 }
@@ -587,7 +585,7 @@ else
587 } 585 }
588 586
589 compiler->script.bugCount++; 587 compiler->script.bugCount++;
590 sendBack(ourGlobals, compiler->client, compiler->SID, "compilerError(%d,%d,Invalid operation [%s(%s) %s %s(%s)])", lval->line, lval->column, leftType, leftToken, lval->toKen->toKen, rightType, rightToken); 588 sendBack(compiler->client, compiler->SID, "compilerError(%d,%d,Invalid operation [%s(%s) %s %s(%s)])", lval->line, lval->column, leftType, leftToken, lval->toKen->toKen, rightType, rightToken);
591 } 589 }
592 } 590 }
593 591
@@ -991,7 +989,6 @@ LSL_Leaf *addFor(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, LSL_L
991 989
992LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, LSL_Leaf *left, LSL_Leaf *expr, LSL_Leaf *right, LSL_Leaf *block, LSL_Leaf *identifier) 990LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, LSL_Leaf *left, LSL_Leaf *expr, LSL_Leaf *right, LSL_Leaf *block, LSL_Leaf *identifier)
993{ 991{
994// gameGlobals *ourGlobals = compiler->game;
995 LSL_Statement *stat = calloc(1, sizeof(LSL_Statement)); 992 LSL_Statement *stat = calloc(1, sizeof(LSL_Statement));
996 boolean justOne = FALSE; 993 boolean justOne = FALSE;
997 994
@@ -2220,7 +2217,7 @@ boolean compileLSL(gameGlobals *ourGlobals, Ecore_Con_Client *client, char *SID,
2220 call->call->basicType = func->basicType; 2217 call->call->basicType = func->basicType;
2221 } 2218 }
2222 else 2219 else
2223 sendBack(ourGlobals, compiler.client, compiler.SID, "compilerError(%d,%d,Undeclared function %s called)", call->call->line, call->call->column, call->call->value.stringValue); 2220 sendBack(compiler.client, compiler.SID, "compilerError(%d,%d,Undeclared function %s called)", call->call->line, call->call->column, call->call->value.stringValue);
2224 } 2221 }
2225 } 2222 }
2226 secondPass(&compiler, compiler.ast); 2223 secondPass(&compiler, compiler.ast);