fix: 修复了在解析字面量时的条件逻辑,确保整数转换在浮点数转换之后进行
This commit is contained in:
@@ -54,9 +54,12 @@ namespace Fig
|
||||
double d = std::stod(lexeme.toStdString());
|
||||
v = Value::FromDouble(d);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::int32_t i = std::stoi(lexeme.toStdString());
|
||||
v = Value::FromInt(i);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
assert("false" && "CompileLiteral: unsupport literal");
|
||||
|
||||
Reference in New Issue
Block a user