aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src
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
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')
-rw-r--r--LuaSL/src/LuaSL_LSL_tree.h2
-rw-r--r--LuaSL/src/LuaSL_compile.c8
2 files changed, 6 insertions, 4 deletions
diff --git a/LuaSL/src/LuaSL_LSL_tree.h b/LuaSL/src/LuaSL_LSL_tree.h
index 561a2ff..104ba45 100644
--- a/LuaSL/src/LuaSL_LSL_tree.h
+++ b/LuaSL/src/LuaSL_LSL_tree.h
@@ -256,7 +256,7 @@ struct _LSL_Block
256struct _LSL_Function 256struct _LSL_Function
257{ 257{
258 LSL_Text name; 258 LSL_Text name;
259 LSL_Leaf *type; 259 LSL_Text type;
260#if LUASL_DIFF_CHECK 260#if LUASL_DIFF_CHECK
261// LSL_Leaf *params; // So we store the parenthesis, and their ignorables. 261// LSL_Leaf *params; // So we store the parenthesis, and their ignorables.
262 // This points to the params leaf, which is a function, pointing to this structure. The actual params are in vars. 262 // This points to the params leaf, which is a function, pointing to this structure. The actual params are in vars.
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)