diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 8 | ||||
-rw-r--r-- | 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, | |||
814 | } | 814 | } |
815 | } | 815 | } |
816 | 816 | ||
817 | #if LUASL_DIFF_CHECK | ||
817 | if (justOne && (flow)) | 818 | if (justOne && (flow)) |
818 | { | 819 | { |
819 | stat->ignorable = calloc(2, sizeof(Eina_Strbuf *)); | 820 | stat->ignorable = calloc(2, sizeof(Eina_Strbuf *)); |
@@ -823,6 +824,7 @@ LSL_Leaf *addStatement(LuaSL_compiler *compiler, LSL_Leaf *lval, LSL_Leaf *flow, | |||
823 | flow->ignorable = NULL; | 824 | flow->ignorable = NULL; |
824 | } | 825 | } |
825 | } | 826 | } |
827 | #endif | ||
826 | 828 | ||
827 | if (lval) | 829 | if (lval) |
828 | { | 830 | { |
@@ -927,13 +929,13 @@ LSL_Leaf *beginBlock(LuaSL_compiler *compiler, LSL_Leaf *block) | |||
927 | blok->variables = eina_hash_stringshared_new(burnLeaf); | 929 | blok->variables = eina_hash_stringshared_new(burnLeaf); |
928 | block->value.blockValue = blok; | 930 | block->value.blockValue = blok; |
929 | blok->outerBlock = compiler->currentBlock; | 931 | blok->outerBlock = compiler->currentBlock; |
932 | compiler->currentBlock = blok; | ||
933 | blok->function = compiler->currentFunction; | ||
934 | compiler->currentFunction = NULL; | ||
930 | #if LUASL_DIFF_CHECK | 935 | #if LUASL_DIFF_CHECK |
931 | blok->openIgnorable = block->ignorable; | 936 | blok->openIgnorable = block->ignorable; |
932 | block->ignorable = NULL; | 937 | block->ignorable = NULL; |
933 | #endif | 938 | #endif |
934 | compiler->currentBlock = blok; | ||
935 | blok->function = compiler->currentFunction; | ||
936 | compiler->currentFunction = NULL; | ||
937 | } | 939 | } |
938 | return block; | 940 | return block; |
939 | } | 941 | } |
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 | |||
43 | // No such thing as a function list with no functions. | 43 | // No such thing as a function list with no functions. |
44 | //functionList(A) ::= . { A = collectStatements(compiler, NULL, NULL); } | 44 | //functionList(A) ::= . { A = collectStatements(compiler, NULL, NULL); } |
45 | 45 | ||
46 | functionBody(A) ::= function(F) block(B). { A = addFunctionBody(compiler, F, B); } // addFunctionBody has an implied addStatement(compiler, NULL, F, NULL, B, NULL, NULL); | 46 | functionBody(A) ::= function(F) block(B). { A = addFunctionBody(compiler, F, B); } // addFunctionBody returns an implied addStatement(compiler, NULL, F, NULL, F, NULL, NULL); |
47 | 47 | ||
48 | parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(compiler, B, C, D); } | 48 | parameterList(A) ::= parameterList(B) LSL_COMMA(C) parameter(D). { A = collectParameters(compiler, B, C, D); } |
49 | parameterList(A) ::= parameter(D). { A = collectParameters(compiler, NULL, NULL, D); } | 49 | 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( | |||
54 | 54 | ||
55 | // Blocks. | 55 | // Blocks. |
56 | 56 | ||
57 | block(A) ::= beginBlock(L) statementList(B) LSL_BLOCK_CLOSE(R). { A = addBlock(compiler, L, B, R); } | 57 | block(A) ::= beginBlock(L) statementList(B) LSL_BLOCK_CLOSE(R). { A = addBlock(compiler, L, B, R); } |
58 | 58 | ||
59 | // Various forms of statement. | 59 | // Various forms of statement. |
60 | 60 | ||