C++ Mathematical Expression Library (ExprTk) http://www.partow.net/programming/exprtk/index.html

This commit is contained in:
Arash Partow
2016-10-13 11:22:37 +11:00
parent 57041af631
commit c57053fba1
2 changed files with 21 additions and 7 deletions

View File

@ -2427,11 +2427,25 @@ namespace exprtk
{
const char* initial_itr = s_itr_;
while (
(!is_end(s_itr_)) &&
(details::is_letter_or_digit(*s_itr_) || ((*s_itr_) == '_'))
)
while (!is_end(s_itr_))
{
if (!details::is_letter_or_digit(*s_itr_) && ('_' != (*s_itr_)))
{
if ('.' != (*s_itr_))
break;
/*
Permit symbols that contain a 'dot'
Allowed : abc.xyz, a123.xyz, abc.123, abc_.xyz a123_.xyz abc._123
Disallowed: abc.<white-space>, abc.<eof>
*/
if (
!is_end(s_itr_ + 1) &&
details::is_letter_or_digit(*s_itr_ + 1) &&
('_' != (*s_itr_ + 1))
)
break;
}
++s_itr_;
}