Skip to content

Commit

Permalink
more debugging info
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongxu Li committed Mar 21, 2014
1 parent 9bdaa20 commit c4f2341
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions libraries/muparser/src/muParser.cpp
Expand Up @@ -211,7 +211,7 @@ namespace mu
int Parser::IsVal(const char_type* a_szExpr, int *a_iPos, value_type *a_fVal)
{
DEBUG_HEADER();
cout<<"begin\n";
cout<<"begin "<<a_szExpr<<"\n";
value_type fVal(0);

stringstream_type stream(a_szExpr);
Expand All @@ -227,7 +227,7 @@ namespace mu
*a_iPos += (int)iEnd;
*a_fVal = fVal;
DEBUG_HEADER();
cout<<"end\n";
cout<<"end"<<a_fVal<<"\n";
return 1;
}

Expand Down
9 changes: 8 additions & 1 deletion libraries/muparser/src/muParserBase.cpp
Expand Up @@ -34,13 +34,18 @@
#include <deque>
#include <sstream>
#include <locale>
#include "muParser.h"

#ifdef MUP_USE_OPENMP
#include <omp.h>
#endif

#include <iostream>
#define DEBUG_HEADER() std::cout<<__FILE__<<" : "<<__FUNCTION__<<" : line "<<__LINE__<<std::endl
struct space_out : std::numpunct<char> {
char do_thousands_sep() const { return '\0'; } // separate with spaces
std::string do_grouping() const { return "\09"; } // groups of 1 digit
};

using namespace std;

Expand Down Expand Up @@ -419,8 +424,10 @@ namespace mu
*/
void ParserBase::SetExpr(const string_type &a_sExpr)
{
DEBUG_HEADER();
std::cout<<"Parsing: "<<a_sExpr<<std::endl;
// Check locale compatibility
std::locale loc;
std::locale loc(mu::Parser::s_locale,new space_out);
if (m_pTokenReader->GetArgSep()==std::use_facet<numpunct<char_type> >(loc).decimal_point())
Error(ecLOCALE);

Expand Down

0 comments on commit c4f2341

Please sign in to comment.