aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-30 18:56:12 +1000
committerDavid Walter Seikel2012-01-30 18:56:12 +1000
commitcfd9edae2557192c5de95ec3336a496874377068 (patch)
tree6ecd235578115a2759c471a4b25b27a243f4a670 /LuaSL/src/LuaSL_compile.c
parentClean up dangling function calls. (diff)
downloadSledjHamr-cfd9edae2557192c5de95ec3336a496874377068.zip
SledjHamr-cfd9edae2557192c5de95ec3336a496874377068.tar.gz
SledjHamr-cfd9edae2557192c5de95ec3336a496874377068.tar.bz2
SledjHamr-cfd9edae2557192c5de95ec3336a496874377068.tar.xz
Track function type ignorable, and no need to store the leaf.
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r--LuaSL/src/LuaSL_compile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 7745f93..b10ae07 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -539,9 +539,12 @@ LSL_Leaf *addFunction(LuaSL_compiler *compiler, LSL_Leaf *type, LSL_Leaf *identi
539 func->name.ignorableText = identifier->ignorableText; 539 func->name.ignorableText = identifier->ignorableText;
540 identifier->toKen = tokens[LSL_FUNCTION - lowestToken]; 540 identifier->toKen = tokens[LSL_FUNCTION - lowestToken];
541 identifier->value.functionValue = func; 541 identifier->value.functionValue = func;
542 func->type = type;
543 if (type) 542 if (type)
543 {
544 func->type.text = type->toKen->toKen;
545 func->type.ignorableText = type->ignorableText;
544 identifier->basicType = type->basicType; 546 identifier->basicType = type->basicType;
547 }
545 else 548 else
546 identifier->basicType = OT_nothing; 549 identifier->basicType = OT_nothing;
547 eina_hash_add(compiler->script.functions, func->name.text, identifier); 550 eina_hash_add(compiler->script.functions, func->name.text, identifier);
@@ -1227,9 +1230,8 @@ static void outputFunctionToken(FILE *file, outputMode mode, LSL_Leaf *content)
1227 LSL_Leaf *param = NULL; 1230 LSL_Leaf *param = NULL;
1228 int first = TRUE; 1231 int first = TRUE;
1229 1232
1230 outputLeaf(file, mode, func->type); 1233 outputText(file, &(func->type), !(LSL_NOIGNORE & content->toKen->flags));
1231 outputText(file, &(func->name), !(LSL_NOIGNORE & content->toKen->flags)); 1234 outputText(file, &(func->name), !(LSL_NOIGNORE & content->toKen->flags));
1232// fprintf(file, "%s(", func->name);
1233// TODO - should print comma and parenthesis ignorables. 1235// TODO - should print comma and parenthesis ignorables.
1234 fprintf(file, "("); 1236 fprintf(file, "(");
1235 EINA_INARRAY_FOREACH((&(func->vars)), param) 1237 EINA_INARRAY_FOREACH((&(func->vars)), param)