Signed-off-by: Paul Beckingham <paul@beckingham.net>

Bug #836

 - Make A3 use same the number representation as the user.
This commit is contained in:
Matt Kraai 2011-11-14 23:44:05 -05:00 committed by Paul Beckingham
parent 6473c9f39b
commit 3a4871e975
5 changed files with 25 additions and 9 deletions

View file

@ -686,7 +686,6 @@ const A3 A3::tokenize (const A3& input) const
std::string s;
int i;
double d;
time_t t;
while (! n.depleted ())
{
@ -815,9 +814,9 @@ const A3 A3::tokenize (const A3& input) const
}
}
else if (is_number (n, d))
else if (is_number (n, s))
{
output.push_back (Arg (format (d), Arg::type_number, Arg::cat_literal));
output.push_back (Arg (s, Arg::type_number, Arg::cat_literal));
if (found_sequence)
found_something_after_sequence = true;
}
@ -1699,10 +1698,10 @@ bool A3::is_tag (Nibbler& n, std::string& result)
// <number> followed by either: \0, ), +, -, *, /, ' '.
//
// This prevents the interpretation of '3M' as a number.
bool A3::is_number (Nibbler& n, double& d)
bool A3::is_number (Nibbler& n, std::string& result)
{
n.save ();
if (n.getNumber (d))
if (n.getNumber (result))
{
char next = n.next ();
if (next == '\0' ||