Skip to content

Commit 716e751

Browse files
committed
Organize variables
1 parent d2bd60f commit 716e751

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

tinyexpr.h

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,29 +1108,36 @@ class te_parser
11081108
[[nodiscard]]
11091109
te_expr* list(state* theState);
11101110

1111-
std::string m_expression;
1112-
te_expr* m_compiledExpression{ nullptr };
1113-
1114-
std::set<te_variable>::const_iterator m_currentVar;
1115-
bool m_varFound{ false };
1116-
#ifndef TE_NO_BOOKKEEPING
1117-
std::set<te_variable::name_type, te_string_less> m_usedFunctions;
1118-
std::set<te_variable::name_type, te_string_less> m_usedVars;
1119-
#endif
1120-
1111+
// built-in functions
11211112
static const std::set<te_variable> m_functions;
1113+
1114+
// customizable settings
11221115
std::set<te_variable> m_customFuncsAndVars;
11231116

11241117
te_usr_variant_type m_unknownSymbolResolve{ te_usr_noop{} };
1125-
std::set<te_variable::name_type> m_resolvedVariables;
1118+
11261119
bool m_keepResolvedVarialbes{ true };
11271120

1121+
char m_decimalSeparator{ '.' };
1122+
char m_listSeparator{ ',' };
1123+
1124+
// state information
1125+
std::string m_expression;
1126+
te_expr* m_compiledExpression{ nullptr };
1127+
11281128
bool m_parseSuccess{ false };
11291129
int64_t m_errorPos{ 0 };
11301130
std::string m_lastErrorMessage;
11311131
te_type m_result{ te_nan };
1132-
char m_decimalSeparator{ '.' };
1133-
char m_listSeparator{ ',' };
1132+
1133+
std::set<te_variable::name_type> m_resolvedVariables;
1134+
1135+
std::set<te_variable>::const_iterator m_currentVar;
1136+
bool m_varFound{ false };
1137+
#ifndef TE_NO_BOOKKEEPING
1138+
std::set<te_variable::name_type, te_string_less> m_usedFunctions;
1139+
std::set<te_variable::name_type, te_string_less> m_usedVars;
1140+
#endif
11341141
};
11351142

11361143
#endif // __TINYEXPR_PLUS_PLUS_H__

0 commit comments

Comments
 (0)