aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-02-04 20:06:29 +1000
committerDavid Walter Seikel2012-02-04 20:06:29 +1000
commitb75fb33cda872948cf91144feeb47450701efd05 (patch)
treed447cc26fa2d6f3e901c7074026f331c8d7b8b73 /LuaSL/src/LuaSL_compile.c
parentApply LuaJIT hotfix1. (diff)
downloadSledjHamr-b75fb33cda872948cf91144feeb47450701efd05.zip
SledjHamr-b75fb33cda872948cf91144feeb47450701efd05.tar.gz
SledjHamr-b75fb33cda872948cf91144feeb47450701efd05.tar.bz2
SledjHamr-b75fb33cda872948cf91144feeb47450701efd05.tar.xz
Track those functions and variables that are LSL constants.
Diffstat (limited to '')
-rw-r--r--LuaSL/src/LuaSL_compile.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 9d2456b..f997d62 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -261,8 +261,14 @@ static LSL_Leaf *findFunction(LuaSL_compiler *compiler, const char *name)
261 { 261 {
262 if (NULL == func) 262 if (NULL == func)
263 func = eina_hash_find(constants.functions, name); 263 func = eina_hash_find(constants.functions, name);
264 if (NULL == func) 264 if (NULL != func)
265 {
266 func->flags |= MF_LSLCONST;
267 func->value.functionValue->flags |= MF_LSLCONST;
268 }
269 else
265 func = eina_hash_find(compiler->script.functions, name); 270 func = eina_hash_find(compiler->script.functions, name);
271
266 } 272 }
267 273
268 return func; 274 return func;
@@ -298,7 +304,12 @@ static LSL_Leaf *findVariable(LuaSL_compiler *compiler, const char *name)
298 304
299 if (NULL == var) 305 if (NULL == var)
300 var = eina_hash_find(constants.variables, name); 306 var = eina_hash_find(constants.variables, name);
301 if (NULL == var) 307 if (NULL != var)
308 {
309 var->flags |= MF_LSLCONST;
310 var->value.identifierValue->flags |= MF_LSLCONST;
311 }
312 else
302 var = eina_hash_find(compiler->script.variables, name); 313 var = eina_hash_find(compiler->script.variables, name);
303 } 314 }
304 315