diff options
author | David Walter Seikel | 2012-01-22 14:35:33 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-22 14:35:33 +1000 |
commit | 0f6f66972be036467464dde89f08ae82b9b2f32b (patch) | |
tree | 8918cf7712a5c989799e549f2c8ebd2f909a86bc /LuaSL | |
parent | Output function calls. (diff) | |
download | SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.zip SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.gz SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.bz2 SledjHamr-0f6f66972be036467464dde89f08ae82b9b2f32b.tar.xz |
Function definitions are statements now.
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 10 |
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 | ||
541 | LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block) | 541 | LSL_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 | ||
549 | LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close) | 557 | LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close) |