[muparser] Clean up ParserTokenReader constructor

This commit is contained in:
ridiculousfish 2017-11-22 13:57:28 -08:00
parent 83799832bc
commit d97bb3425f
2 changed files with 18 additions and 38 deletions

View file

@ -121,25 +121,25 @@ class ParserTokenReader final {
ParserBase *m_pParser; ParserBase *m_pParser;
string_type m_strFormula; string_type m_strFormula;
int m_iPos; int m_iPos = 0;
int m_iSynFlags; int m_iSynFlags = 0;
bool m_bIgnoreUndefVar; bool m_bIgnoreUndefVar = false;
const funmap_type *m_pFunDef; const funmap_type *m_pFunDef = nullptr;
const funmap_type *m_pPostOprtDef; const funmap_type *m_pPostOprtDef = nullptr;
const funmap_type *m_pInfixOprtDef; const funmap_type *m_pInfixOprtDef = nullptr;
const funmap_type *m_pOprtDef; const funmap_type *m_pOprtDef = nullptr;
const valmap_type *m_pConstDef; const valmap_type *m_pConstDef = nullptr;
const strmap_type *m_pStrVarDef; const strmap_type *m_pStrVarDef = nullptr;
varmap_type *m_pVarDef; ///< The only non const pointer to parser internals varmap_type *m_pVarDef = nullptr; ///< The only non const pointer to parser internals
facfun_type m_pFactory; facfun_type m_pFactory = nullptr;
void *m_pFactoryData; void *m_pFactoryData = nullptr;
std::list<identfun_type> m_vIdentFun; ///< Value token identification function std::list<identfun_type> m_vIdentFun; ///< Value token identification function
varmap_type m_UsedVar; varmap_type m_UsedVar;
value_type m_fZero; ///< Dummy value of zero, referenced by undefined variables value_type m_fZero = 0; ///< Dummy value of zero, referenced by undefined variables
int m_iBrackets; int m_iBrackets = 0;
token_type m_lastTok; token_type m_lastTok;
char_type m_cArgSep; ///< The character used for separating function arguments char_type m_cArgSep = ','; ///< The character used for separating function arguments
}; };
} // namespace mu } // namespace mu

View file

@ -47,29 +47,9 @@ namespace mu {
\post #m_pParser==a_pParser \post #m_pParser==a_pParser
\param a_pParent Parent parser object of the token reader. \param a_pParent Parent parser object of the token reader.
*/ */
ParserTokenReader::ParserTokenReader(ParserBase *a_pParent) ParserTokenReader::ParserTokenReader(ParserBase *a_pParent) {
: m_pParser(a_pParent), assert(a_pParent && "Missing parent");
m_strFormula(), SetParent(a_pParent);
m_iPos(0),
m_iSynFlags(0),
m_bIgnoreUndefVar(false),
m_pFunDef(NULL),
m_pPostOprtDef(NULL),
m_pInfixOprtDef(NULL),
m_pOprtDef(NULL),
m_pConstDef(NULL),
m_pStrVarDef(NULL),
m_pVarDef(NULL),
m_pFactory(NULL),
m_pFactoryData(NULL),
m_vIdentFun(),
m_UsedVar(),
m_fZero(0),
m_iBrackets(0),
m_lastTok(),
m_cArgSep(',') {
assert(m_pParser);
SetParent(m_pParser);
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------