Fix SimpleLexer not understanding floating point numbers that omit pre dot zero

This commit is contained in:
Jan 2021-11-01 15:12:46 +01:00
parent e19f526d8b
commit 99ca6f8efb
2 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ protected:
{
const auto& currentLine = CurrentLine();
assert(m_current_line_offset >= 1);
assert(isdigit(currentLine.m_line[m_current_line_offset - 1]));
assert(isdigit(currentLine.m_line[m_current_line_offset - 1]) || currentLine.m_line[m_current_line_offset - 1] == '.');
const auto lineLength = currentLine.m_line.size();
if (lineLength - m_current_line_offset >= 1

View File

@ -48,7 +48,7 @@ SimpleParserValue SimpleLexer::GetNextToken()
if (m_config.m_read_strings && c == '\"')
return SimpleParserValue::String(GetPreviousCharacterPos(), new std::string(ReadString()));
if (m_config.m_read_numbers && isdigit(c))
if (m_config.m_read_numbers && (isdigit(c) || c == '.' && isdigit(PeekChar())))
{
bool isFloatingPointValue;
double doubleValue;