Skip to content

Commit

Permalink
muparser: file cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongxu Li committed Mar 21, 2014
1 parent 2977873 commit 3ee22f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 24 deletions.
11 changes: 0 additions & 11 deletions libraries/muparser/src/muParser.cpp
Expand Up @@ -37,18 +37,11 @@
/** \brief The eulerian number. */
#define PARSER_CONST_E 2.718281828459045235360287

#include <iostream>
#define DEBUG_HEADER() std::cout<<__FILE__<<" : "<<__FUNCTION__<<" : line "<<__LINE__<<std::endl

using namespace std;

/** \file
\brief Implementation of the standard floating point parser.
*/
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
};


/** \brief Namespace for mathematical applications. */
Expand Down Expand Up @@ -210,8 +203,6 @@ namespace mu
*/
int Parser::IsVal(const char_type* a_szExpr, int *a_iPos, value_type *a_fVal)
{
DEBUG_HEADER();
cout<<"begin "<<a_szExpr<<"\n";
value_type fVal(0);

stringstream_type stream(a_szExpr);
Expand All @@ -226,8 +217,6 @@ namespace mu

*a_iPos += (int)iEnd;
*a_fVal = fVal;
DEBUG_HEADER();
cout<<"end"<<a_fVal<<"\n";
return 1;
}

Expand Down
6 changes: 6 additions & 0 deletions libraries/muparser/src/muParser.h
Expand Up @@ -28,6 +28,12 @@
//--- Standard includes ------------------------------------------------------------------------
#include <vector>

#include <iostream>
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
};

//--- Parser includes --------------------------------------------------------------------------
#include "muParserBase.h"
#include "muParserTemplateMagic.h"
Expand Down
13 changes: 0 additions & 13 deletions libraries/muparser/src/muParserBase.cpp
Expand Up @@ -40,12 +40,6 @@
#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 @@ -201,8 +195,6 @@ namespace mu
void ParserBase::SetDecSep(char_type cDecSep)
{
char_type cThousandsSep = std::use_facet< change_dec_sep<char_type> >(s_locale).thousands_sep();
DEBUG_HEADER();
printf("setting thousand_sep='%c'\n", cThousandsSep);
s_locale = std::locale(std::locale("C"), new change_dec_sep<char_type>(cDecSep, cThousandsSep));
}

Expand All @@ -218,8 +210,6 @@ namespace mu
void ParserBase::SetThousandsSep(char_type cThousandsSep)
{
char_type cDecSep = std::use_facet< change_dec_sep<char_type> >(s_locale).decimal_point();
DEBUG_HEADER();
printf("setting change_dec_sep='%c'\n", cThousandsSep);
s_locale = std::locale(std::locale("C"), new change_dec_sep<char_type>(cDecSep, cThousandsSep));
}

Expand All @@ -231,7 +221,6 @@ namespace mu
*/
void ParserBase::ResetLocale()
{
DEBUG_HEADER();
s_locale = std::locale(std::locale("C"), new change_dec_sep<char_type>('.'));
SetArgSep(',');
}
Expand Down Expand Up @@ -424,8 +413,6 @@ 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(mu::Parser::s_locale,new space_out);
if (m_pTokenReader->GetArgSep()==std::use_facet<numpunct<char_type> >(loc).decimal_point())
Expand Down

0 comments on commit 3ee22f8

Please sign in to comment.