Skip to content

Commit

Permalink
Organize variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed May 28, 2024
1 parent d2bd60f commit 716e751
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions tinyexpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1108,29 +1108,36 @@ class te_parser
[[nodiscard]]
te_expr* list(state* theState);

std::string m_expression;
te_expr* m_compiledExpression{ nullptr };

std::set<te_variable>::const_iterator m_currentVar;
bool m_varFound{ false };
#ifndef TE_NO_BOOKKEEPING
std::set<te_variable::name_type, te_string_less> m_usedFunctions;
std::set<te_variable::name_type, te_string_less> m_usedVars;
#endif

// built-in functions
static const std::set<te_variable> m_functions;

// customizable settings
std::set<te_variable> m_customFuncsAndVars;

te_usr_variant_type m_unknownSymbolResolve{ te_usr_noop{} };
std::set<te_variable::name_type> m_resolvedVariables;

bool m_keepResolvedVarialbes{ true };

char m_decimalSeparator{ '.' };
char m_listSeparator{ ',' };

// state information
std::string m_expression;
te_expr* m_compiledExpression{ nullptr };

bool m_parseSuccess{ false };
int64_t m_errorPos{ 0 };
std::string m_lastErrorMessage;
te_type m_result{ te_nan };
char m_decimalSeparator{ '.' };
char m_listSeparator{ ',' };

std::set<te_variable::name_type> m_resolvedVariables;

std::set<te_variable>::const_iterator m_currentVar;
bool m_varFound{ false };
#ifndef TE_NO_BOOKKEEPING
std::set<te_variable::name_type, te_string_less> m_usedFunctions;
std::set<te_variable::name_type, te_string_less> m_usedVars;
#endif
};

#endif // __TINYEXPR_PLUS_PLUS_H__

0 comments on commit 716e751

Please sign in to comment.