From b812ef21ce228143b909128ff5ee8ba03043a5fe Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 15 Sep 2014 05:23:30 +1000 Subject: Clean up some TODOs and comments. --- src/LuaSL/LuaSL_compile.c | 12 ++---------- src/love/love.c | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/LuaSL/LuaSL_compile.c b/src/LuaSL/LuaSL_compile.c index f1e7db1..13ebe1e 100644 --- a/src/LuaSL/LuaSL_compile.c +++ b/src/LuaSL/LuaSL_compile.c @@ -1,9 +1,6 @@ #include "LuaSL.h" -/* TODO - problem de jour -*/ - static void outputBitOp(FILE *file, outputMode mode, LSL_Leaf *leaf); static void outputBlockToken(FILE *file, outputMode mode, LSL_Leaf *content); @@ -433,8 +430,6 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, lType = left->basicType; if (OT_undeclared == lType) { -// compiler->script.warningCount++; -// sendBack(compiler->compiler->client, compiler->compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column); lval->basicType = OT_undeclared; return lval; } @@ -461,8 +456,6 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, rType = right->basicType; if (OT_undeclared == rType) { -// compiler->script.warningCount++; -// sendBack(compiler->compiler->client, compiler->compiler->SID, "compilerWarning(%d,%d,Undeclared identifier issue, deferring this until the second pass)", lval->line, lval->column); lval->basicType = OT_undeclared; return lval; } @@ -865,8 +858,9 @@ LSL_Leaf *collectArguments(LuaSL_compiler *compiler, LSL_Leaf *list, LSL_Leaf *c if (comma) eina_inarray_push(&(call->params), comma); } + // Only stashing the pointer in the inarray, so that other pointers to the actual data are still valid. + // Specifically for variable declarations in the second pass. eina_inarray_push(&(call->params), &arg); - // At this point, pointers to arg are not pointing to the one in call->params, AND arg is no longer needed. } } } @@ -2390,7 +2384,6 @@ void compileLSL(LuaCompiler *compiler) if (lcompiler->undeclared) { lcompiler->pass++; -// PW("A second pass is needed to check functions or variables that where used before they where declared. To avoid this second pass, don't do that."); if (eina_clist_count(&(lcompiler->danglingVars))) { struct _LSL_DanglingVar *dangleVar = NULL; @@ -2429,7 +2422,6 @@ void compileLSL(LuaCompiler *compiler) // TODO - Should clean up these clists. secondPass(lcompiler, lcompiler->ast); -// PD("Second pass completed."); } if (lcompiler->compiler->doConstants) diff --git a/src/love/love.c b/src/love/love.c index e7b8e40..e90278a 100644 --- a/src/love/love.c +++ b/src/love/love.c @@ -270,7 +270,7 @@ static Eina_Bool _dataLuaSL(void *data, int type, Ecore_Con_Event_Server_Data *e } else if (0 == strcmp(command, "compiled(false)")) { - PE("The compile of %s failed!", SID); +// PE("The compile of %s failed!", SID); if (me) { struct timeval now; -- cgit v1.1