2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

ts_real_policies: Fixed small numbers parsing

Numbers in range (-1000.0, 1000.0) has only one segment (no thousands delimiter),
and are parsed in `if` statement expression.
This commit is contained in:
Nikita Kniazev
2018-03-10 18:52:50 +03:00
parent a0df3c098f
commit 1a72c27306
5 changed files with 14 additions and 15 deletions

View File

@@ -168,7 +168,6 @@ struct ts_real_policies : boost::spirit::qi::ureal_policies<T>
T result = 0;
if (parse(first, last, uint3, result))
{
bool hit = false;
T n;
Iterator save = first;
@@ -176,13 +175,11 @@ struct ts_real_policies : boost::spirit::qi::ureal_policies<T>
{
result = result * 1000 + n;
save = first;
hit = true;
}
first = save;
if (hit)
attr = result;
return hit;
attr = result;
return true;
}
return false;
}