Skip to content

Commit

Permalink
Fixed bug on repeated calls to Evaluate ()
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Feb 15, 2010
1 parent 9b11fb1 commit 994c673
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parser.cpp
Expand Up @@ -639,6 +639,8 @@ const double Parser::CommaList (const bool get) // expr1, expr2

const double Parser::Evaluate () // get result
{
pWord_ = program_.c_str ();
type_ = NONE;
double v = CommaList (true);
if (type_ != END)
throw std::runtime_error ("Unexpected text at end of expression: " + std::string (pWordStart_));
Expand Down

0 comments on commit 994c673

Please sign in to comment.