aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-22 14:35:33 +1000
committerDavid Walter Seikel2012-01-22 14:35:33 +1000
commit0f6f66972be036467464dde89f08ae82b9b2f32b (patch)
tree8918cf7712a5c989799e549f2c8ebd2f909a86bc
parentOutput function calls. (diff)
downloadSledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.zip
SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.gz
SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.bz2
SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.xz
Function definitions are statements now.
-rw-r--r--LuaSL/src/LuaSL_compile.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index c4af1b6..c2cf781 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -540,10 +540,18 @@ LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identi
540 540
541LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block) 541LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block)
542{ 542{
543 LSL_Leaf *statement = newLeaf(LSL_STATEMENT, NULL, NULL);
544
543 if (function) 545 if (function)
546 {
544 function->value.functionValue->block = block; 547 function->value.functionValue->block = block;
548 if (statement)
549 {
550 addStatement(statement, LSL_FUNCTION, function);
551 }
552 }
545 553
546 return function; 554 return statement;
547} 555}
548 556
549LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close) 557LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close)