diff options
author | David Walter Seikel | 2012-01-17 15:46:46 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-17 15:46:46 +1000 |
commit | c846f450bf096d9d8d5ec96b01369d6bf651cdc2 (patch) | |
tree | b22afeaddadc60632b8837fbefbdf661f6ebae8a /LuaSL/src/LuaSL_compile.c | |
parent | Add a variable lookup function. (diff) | |
download | SledjHamr-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 '')
-rw-r--r-- | LuaSL/src/LuaSL_compile.c | 16 |
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 | { | ||
313 | printf("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 | { | ||
318 | printf("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 | } |