diff options
author | Adrian Kummerländer | 2012-04-22 13:33:50 +0200 |
---|---|---|
committer | Adrian Kummerländer | 2012-04-22 13:33:50 +0200 |
commit | 7c83dbbd089e29a420a388e78b14c7cb675f17a1 (patch) | |
tree | 3670e3a49066c815352c5239af98a757140c01fb | |
parent | 4daed5ebe3e8eae184a96055974ac15a3c55507f (diff) | |
download | SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar.gz SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar.bz2 SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar.lz SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar.xz SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.tar.zst SimpleParser-7c83dbbd089e29a420a388e78b14c7cb675f17a1.zip |
Fixed a bug which was preventing the lexer from working correctly
-rw-r--r-- | parser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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 ) ) ); } |