feat: 增加了analyzer, compiler不再分析并且报错, 只生产 bytecode, analyzer作为前端结束最后一道防线检查代码,同时引入一个简单的LSP

This commit is contained in:
2026-02-23 19:57:28 +08:00
parent 852dd27836
commit b7bb889676
28 changed files with 26665 additions and 3153 deletions

View File

@@ -165,12 +165,12 @@ namespace Fig
// 让 VM 的 OP_EQ 指令极简:`if (RA == RB)`
[[nodiscard]] constexpr bool operator==(const Value &other) const
{
// IEEE 754 规定浮点数有 +0.0 == -0.0 的特殊规则
// IEEE 754 规定浮点数有 +0.0 == -0.0 的特殊规则所以不直接比对raw bits而是转换成 double进行C++比对
if (IsDouble() && other.IsDouble())
{
return AsDouble() == other.AsDouble();
}
// 直接比较 64 位整数内存
// 直接比较 64 位整数内存,所以堆对象比较为地址(运算符重载由Compiler处理)
return v_ == other.v_;
}