From 0dd2b7e3487b1d41772a5ee84fce9162f407546b Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 31 Jan 2012 15:45:06 +1000 Subject: Put back function call stuff I removed before, and document why it needs to be there so I don't remove it again. lol --- LuaSL/src/LuaSL_compile.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'LuaSL/src/LuaSL_compile.c') diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index c01529a..f8310a6 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c @@ -596,8 +596,6 @@ LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Le LSL_Leaf *func = findFunction(compiler, identifier->value.stringValue); LSL_FunctionCall *call = calloc(1, sizeof(LSL_FunctionCall)); - identifier->toKen = tokens[LSL_UNKNOWN - lowestToken]; - if (func) { if (call) @@ -619,6 +617,8 @@ LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Le eina_clist_add_tail(&(compiler->danglingCalls), &(call->dangler)); call->call = identifier; } + // Here the identifier stringValue needs to be kept for later searching. + identifier->toKen = tokens[LSL_UNKNOWN - lowestToken]; identifier->basicType = OT_undeclared; compiler->undeclared = TRUE; } @@ -1733,7 +1733,13 @@ boolean compileLSL(gameGlobals *game, char *script, boolean doConstants) LSL_Leaf *func = findFunction(&(compiler), call->call->value.stringValue); if (func) + { call->function = func->value.functionValue; + // Coz the leaf still had the stringValue from before. + call->call->value.functionCallValue = call; + call->call->toKen = tokens[LSL_FUNCTION_CALL - lowestToken]; + call->call->basicType = func->basicType; + } else PE("Undeclared function %s called @ line %d, column %d!", call->call->value.stringValue, call->call->line, call->call->column); } -- cgit v1.1