aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL/src/LuaSL_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'LuaSL/src/LuaSL_compile.c')
-rw-r--r--LuaSL/src/LuaSL_compile.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 42b0798..f84b1e1 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -295,14 +295,23 @@ static LSL_Leaf *findVariable(LuaSL_compiler *compiler, const char *name)
295LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier) 295LSL_Leaf *checkVariable(LuaSL_compiler *compiler, LSL_Leaf *identifier)
296{ 296{
297 gameGlobals *game = compiler->game; 297 gameGlobals *game = compiler->game;
298 LSL_Leaf *var = findVariable(compiler, identifier->value.stringValue);
299 298
300 if (NULL == var) 299 if (identifier)
301 PE("NOT found %s @ line %d, column %d!", identifier->value.stringValue, identifier->line, identifier->column); 300 {
302 else if (LUASL_DEBUG) 301 LSL_Leaf *var = findVariable(compiler, identifier->value.stringValue);
303 PI("Found %s!", identifier->value.stringValue);
304 302
305 return var; 303 if (var)
304 {
305 if (LUASL_DEBUG)
306 PI("Found %s!", identifier->value.stringValue);
307 identifier->value.identifierValue = var->value.identifierValue;
308 identifier->basicType = var->basicType;
309 }
310 else
311 PE("NOT found %s @ line %d, column %d!", identifier->value.stringValue, identifier->line, identifier->column);
312 }
313
314 return identifier;
306} 315}
307 316
308LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right) 317LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval, LSL_Leaf *right)