aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/LuaSL
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-17 15:46:46 +1000
committerDavid Walter Seikel2012-01-17 15:46:46 +1000
commitc846f450bf096d9d8d5ec96b01369d6bf651cdc2 (patch)
treeb22afeaddadc60632b8837fbefbdf661f6ebae8a /LuaSL
parentAdd a variable lookup function. (diff)
downloadSledjHamr-c846f450bf096d9d8d5ec96b01369d6bf651cdc2.zip
SledjHamr-c846f450bf096d9d8d5ec96b01369d6bf651cdc2.tar.gz
SledjHamr-c846f450bf096d9d8d5ec96b01369d6bf651cdc2.tar.bz2
SledjHamr-c846f450bf096d9d8d5ec96b01369d6bf651cdc2.tar.xz
More hacking at figuring out expression types with variables. Still not working.
Diffstat (limited to 'LuaSL')
-rw-r--r--LuaSL/src/LuaSL_compile.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/LuaSL/src/LuaSL_compile.c b/LuaSL/src/LuaSL_compile.c
index 9abe55d..d750fc4 100644
--- a/LuaSL/src/LuaSL_compile.c
+++ b/LuaSL/src/LuaSL_compile.c
@@ -246,7 +246,15 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
246 lType = OT_nothing; 246 lType = OT_nothing;
247 else 247 else
248 { 248 {
249 lType = left->basicType; 249// if ((LSL_IDENTIFIER == left->token->type) && (left->value.identifierValue))
250// {
251// LSL_Leaf *var = findVariable(compiler, left->value.identifierValue->name);
252
253// if (var)
254// lType = var->basicType;
255// }
256// else
257 lType = left->basicType;
250 if (OT_vector < lType) 258 if (OT_vector < lType)
251 lType = allowed[lType].result; 259 lType = allowed[lType].result;
252 } 260 }
@@ -301,9 +309,15 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
301 const char *leftType = "", *rightType = ""; 309 const char *leftType = "", *rightType = "";
302 310
303 if (left) 311 if (left)
312 {
313printf("left token type %s\n", left->token->token);
304 leftType = allowed[left->basicType].name; 314 leftType = allowed[left->basicType].name;
315 }
305 if (right) 316 if (right)
317 {
318printf("right token type %s\n", right->token->token);
306 rightType = allowed[right->basicType].name; 319 rightType = allowed[right->basicType].name;
320 }
307 321
308 PE("Invalid operation [%s %s %s] @ line %d column %d", leftType, lval->token->token, rightType, lval->line, lval->column); 322 PE("Invalid operation [%s %s %s] @ line %d column %d", leftType, lval->token->token, rightType, lval->line, lval->column);
309 } 323 }