From 9bfb125df029148a3924fe0072836720a319487c Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 1 Feb 2012 21:34:31 +1000 Subject: Little cleanups. --- LuaSL/src/LuaSL_compile.c | 8 +++++--- LuaSL/src/LuaSL_lemon_yaccer.y | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index d9ac1c3..a438a63 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -814,6 +814,7 @@ LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, } } +#if LUASL_DIFF_CHECK if (justOne && (flow)) { stat->ignorable = calloc(2, sizeof(Eina_Strbuf *)); @@ -823,6 +824,7 @@ LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, flow->ignorable = NULL; } } +#endif if (lval) { @@ -927,13 +929,13 @@ LSL_Leaf *beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block) blok->variables = eina_hash_stringshared_new(burnLeaf); block->value.blockValue = blok; blok->outerBlock = compiler->currentBlock; + compiler->currentBlock = blok; + blok->function = compiler->currentFunction; + compiler->currentFunction = NULL; #if LUASL_DIFF_CHECK blok->openIgnorable = block->ignorable; block->ignorable = NULL; #endif - compiler->currentBlock = blok; - blok->function = compiler->currentFunction; - compiler->currentFunction = NULL; } return block; } diff --git a/LuaSL/src/LuaSL_lemon_yaccer.y b/LuaSL/src/LuaSL_lemon_yaccer.y index 0aa6c5b..828cf12 100644 --- a/LuaSL/src/LuaSL_lemon_yaccer.y +++ b/LuaSL/src/LuaSL_lemon_yaccer.y @@ -43,7 +43,7 @@ functionList(A) ::= functionBody(C). { A = collectStatements(compiler, NULL // No such thing as a function list with no functions. //functionList(A) ::= . { A = collectStatements(compiler, NULL, NULL); } -functionBody(A) ::= function(F) block(B). { A = addFunctionBody(compiler, F, B); } // addFunctionBody has an implied addStatement(compiler, NULL, F, NULL, B, NULL, NULL); +functionBody(A) ::= function(F) block(B). { A = addFunctionBody(compiler, F, B); } // addFunctionBody returns an implied addStatement(compiler, NULL, F, NULL, F, NULL, NULL); parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(compiler, B, C, D); } parameterList(A) ::= parameter(D). { A = collectParameters(compiler, NULL, NULL, D); } @@ -54,7 +54,7 @@ function(A) ::= type(B) LSL_IDENTIFIER(C) LSL_PARENTHESIS_OPEN(D) parameterList( // Blocks. -block(A) ::= beginBlock(L) statementList(B) LSL_BLOCK_CLOSE(R). { A = addBlock(compiler, L, B, R); } +block(A) ::= beginBlock(L) statementList(B) LSL_BLOCK_CLOSE(R). { A = addBlock(compiler, L, B, R); } // Various forms of statement. -- cgit v1.1