2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-04 07:47:25 +00:00

Fix not reading hex numbers with integer only lexing for SimpleLexer

This commit is contained in:
Jan
2022-03-30 19:25:07 +02:00
parent a092f76ec9
commit 1d798647c3
2 changed files with 27 additions and 3 deletions

View File

@@ -125,12 +125,13 @@ SimpleParserValue SimpleLexer::GetNextToken()
if (m_config.m_read_integer_numbers && (isdigit(c) || (c == '+' || c == '-' || (m_config.m_read_floating_point_numbers && c == '.')) && isdigit(PeekChar())))
{
bool hasSignPrefix;
int integerValue;
if(m_config.m_read_floating_point_numbers)
{
bool isFloatingPointValue;
bool hasSignPrefix;
double floatingPointValue;
int integerValue;
ReadNumber(isFloatingPointValue, hasSignPrefix, floatingPointValue, integerValue);
@@ -140,7 +141,8 @@ SimpleParserValue SimpleLexer::GetNextToken()
return SimpleParserValue::Integer(pos, integerValue, hasSignPrefix);
}
return SimpleParserValue::Integer(pos, ReadInteger(), c == '+' || c == '-');
ReadNumber(hasSignPrefix, integerValue);
return SimpleParserValue::Integer(pos, integerValue, hasSignPrefix);
}
if (isalpha(c) || c == '_')