aboutsummaryrefslogtreecommitdiff
path: root/parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'parser.cpp')
-rw-r--r--parser.cpp6
1 files changed, 5 insertions, 1 deletions
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 )
)
);
}