diff options
Diffstat (limited to '')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c index 445014e..9abe55d 100644 --- a/LuaSL/src/LuaSL_compile.c +++ b/LuaSL/src/LuaSL_compile.c | |||
@@ -209,6 +209,27 @@ void burnLeaf(void *data) | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | |||
213 | static LSL_Leaf *findVariable(LuaSL_compiler *compiler, const char *name) | ||
214 | { | ||
215 | LSL_Block *block = compiler->currentBlock; | ||
216 | LSL_Leaf *var = NULL; | ||
217 | |||
218 | if (name) | ||
219 | { | ||
220 | while ((block) && (NULL == var)) | ||
221 | { | ||
222 | if (block->variables) | ||
223 | var = eina_hash_find(block->variables, name); | ||
224 | block = block->outerBlock; | ||
225 | } | ||
226 | if (NULL == var) | ||
227 | var = eina_hash_find(compiler->script.variables, name); | ||
228 | } | ||
229 | |||
230 | return var; | ||
231 | } | ||
232 | |||
212 | LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right) | 233 | LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right) |
213 | { | 234 | { |
214 | gameGlobals *game = compiler->game; | 235 | gameGlobals *game = compiler->game; |