From c846f450bf096d9d8d5ec96b01369d6bf651cdc2 Mon Sep 17 00:00:00 2001
From: David Walter Seikel
Date: Tue, 17 Jan 2012 15:46:46 +1000
Subject: More hacking at figuring out expression types with variables.  Still
 not working.

---
 LuaSL/src/LuaSL_compile.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

(limited to 'LuaSL')

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,
 	    lType = OT_nothing;
 	else
 	{
-	    lType = left->basicType;
+//	    if ((LSL_IDENTIFIER == left->token->type) && (left->value.identifierValue))
+//	    {
+//		LSL_Leaf *var = findVariable(compiler, left->value.identifierValue->name);
+
+//		if (var)
+//		    lType = var->basicType;
+//	    }
+//	    else
+		lType = left->basicType;
 	    if (OT_vector < lType)
 		lType = allowed[lType].result;
 	}
@@ -301,9 +309,15 @@ LSL_Leaf *addOperation(LuaSL_compiler *compiler, LSL_Leaf *left, LSL_Leaf *lval,
 	    const char *leftType = "", *rightType = "";
 
 	    if (left)
+	    {
+printf("left token type %s\n", left->token->token);
 		leftType = allowed[left->basicType].name;
+	    }
 	    if (right)
+	    {
+printf("right token type %s\n", right->token->token);
 		rightType = allowed[right->basicType].name;
+	    }
 
 	    PE("Invalid operation [%s %s %s] @ line %d column %d", leftType, lval->token->token, rightType, lval->line, lval->column);
 	}
-- 
cgit v1.1