aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-31 15:45:06 +1000
committerDavid Walter Seikel2012-01-31 15:45:06 +1000
commit0dd2b7e3487b1d41772a5ee84fce9162f407546b (patch)
treed171e82d610b1862335cc78f2fab420b9d2176db /LuaSL/src/LuaSL_compile.c
parentOutput string tokens. (diff)
downloadSledjHamr-0dd2b7e3487b1d41772a5ee84fce9162f407546b.zip
SledjHamr-0dd2b7e3487b1d41772a5ee84fce9162f407546b.tar.gz
SledjHamr-0dd2b7e3487b1d41772a5ee84fce9162f407546b.tar.bz2
SledjHamr-0dd2b7e3487b1d41772a5ee84fce9162f407546b.tar.xz
Put back function call stuff I removed before, and document why it needs to be there so I don't remove it again. lol
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_compile.c10
1 files changed, 8 insertions, 2 deletions
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
596 LSL_Leaf *func = findFunction(compiler, identifier->value.stringValue); 596 LSL_Leaf *func = findFunction(compiler, identifier->value.stringValue);
597 LSL_FunctionCall *call = calloc(1, sizeof(LSL_FunctionCall)); 597 LSL_FunctionCall *call = calloc(1, sizeof(LSL_FunctionCall));
598 598
599 identifier->toKen = tokens[LSL_UNKNOWN - lowestToken];
600
601 if (func) 599 if (func)
602 { 600 {
603 if (call) 601 if (call)
@@ -619,6 +617,8 @@ LSL_Leaf *addFunctionCall(LuaSL_compiler *compiler, LSL_Leaf *identifier, LSL_Le
619 eina_clist_add_tail(&(compiler->danglingCalls), &(call->dangler)); 617 eina_clist_add_tail(&(compiler->danglingCalls), &(call->dangler));
620 call->call = identifier; 618 call->call = identifier;
621 } 619 }
620 // Here the identifier stringValue needs to be kept for later searching.
621 identifier->toKen = tokens[LSL_UNKNOWN - lowestToken];
622 identifier->basicType = OT_undeclared; 622 identifier->basicType = OT_undeclared;
623 compiler->undeclared = TRUE; 623 compiler->undeclared = TRUE;
624 } 624 }
@@ -1733,7 +1733,13 @@ boolean compileLSL(gameGlobals *game, char *script, boolean doConstants)
1733 LSL_Leaf *func = findFunction(&(compiler), call->call->value.stringValue); 1733 LSL_Leaf *func = findFunction(&(compiler), call->call->value.stringValue);
1734 1734
1735 if (func) 1735 if (func)
1736 {
1736 call->function = func->value.functionValue; 1737 call->function = func->value.functionValue;
1738 // Coz the leaf still had the stringValue from before.
1739 call->call->value.functionCallValue = call;
1740 call->call->toKen = tokens[LSL_FUNCTION_CALL - lowestToken];
1741 call->call->basicType = func->basicType;
1742 }
1737 else 1743 else
1738 PE("Undeclared function %s called @ line %d, column %d!", call->call->value.stringValue, call->call->line, call->call->column); 1744 PE("Undeclared function %s called @ line %d, column %d!", call->call->value.stringValue, call->call->line, call->call->column);
1739 } 1745 }