From 7c83dbbd089e29a420a388e78b14c7cb675f17a1 Mon Sep 17 00:00:00 2001
From: Adrian Kummerländer
Date: Sun, 22 Apr 2012 13:33:50 +0200
Subject: Fixed a bug which was preventing the lexer from working correctly

---
 parser.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/parser.cpp b/parser.cpp
index 7ce5cab..0378a3f 100644
--- a/parser.cpp
+++ b/parser.cpp
@@ -102,6 +102,10 @@ vector<string> Parser::lexer(string term)
 		throw parenthese_exception();
 	}
 
+	if ( last_priority == 90 && output.size() == 1 ) {
+		output = lexer(output[0]);
+	}
+
 	return output;
 }
 
@@ -155,7 +159,7 @@ Node* Parser::buildTree(Tree *tree, string term)
 			if ( tmpLexer.size() == 1 ) {
 				operandStack.push( 
 					tree->addOperand( NULL, 
-						strtod( termIter->c_str(), NULL ) 
+						strtod( tmpLexer[0].c_str(), NULL )
 					)
 				);
 			}
-- 
cgit v1.2.3