Commit 267634fb authored by Davis King's avatar Davis King

Fixed the incorrect parsing of exponentiated numbers like 1e100.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403221
parent f24f61a4
......@@ -444,12 +444,13 @@ namespace dlib
}
}
// or this could be a floating point value
else if (tokenizer.peek_type() == tok::CHAR && tokenizer.peek_token()[0] == '.')
// or this could be a floating point value or something with an 'e' or 'E' in it.
else if ((tokenizer.peek_type() == tok::CHAR && tokenizer.peek_token()[0] == '.') ||
(tokenizer.peek_type() == tok::IDENTIFIER && std::tolower(tokenizer.peek_token()[0]) == 'e'))
{
std::string temp;
tokenizer.get_token(type,temp);
token += '.';
token += temp;
// now get the rest of the floating point value
while (tokenizer.peek_type() == tok::IDENTIFIER ||
tokenizer.peek_type() == tok::NUMBER
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment