From 0f6f66972be036467464dde89f08ae82b9b2f32b Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Jan 2012 14:35:33 +1000 Subject: Function definitions are statements now. --- LuaSL/src/LuaSL_compile.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 LSL_Leaf *addFunctionBody(LuaSL_compiler *compiler, LSL_Leaf *function, LSL_Leaf *block) { + LSL_Leaf *statement = newLeaf(LSL_STATEMENT, NULL, NULL); + if (function) + { function->value.functionValue->block = block; + if (statement) + { + addStatement(statement, LSL_FUNCTION, function); + } + } - return function; + return statement; } LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Leaf *open, LSL_Leaf *params, LSL_Leaf *close) -- cgit v1.1