[VER] v0.3.9-alpha

[Feat] is 操作符现在可以直接判断内置数据类型, 如 10 is Int
[Fix] evalMemberExpr的lhs可以为右值,修复原来限制为左值的BUG,如调用一个函数返回结果为struct且访问member触发此bug
[Impl] 可更换的std::dynamic_pointer_cast更换为static版本,更快!
[Feat] 增加标准库 std.time,以及用到的builtin: __ftime_now_ns,但目前 Time类有点BUG
[...] 剩下的忘了
This commit is contained in:
2026-01-15 17:51:01 +08:00
parent ccf80536b3
commit d398d457b5
10 changed files with 199 additions and 41 deletions

View File

@@ -2,6 +2,7 @@
#include <Core/fig_string.hpp>
#include <unordered_set>
#include <variant>
#include <map>
@@ -75,6 +76,28 @@ namespace Fig
using BoolClass = bool;
using NullClass = std::monostate;
using StringClass = FString;
static const std::unordered_set<TypeInfo, TypeInfoHash> builtinTypes
{
Any,
Null,
Int,
String,
Bool,
Double,
Function,
StructType,
StructInstance,
List,
Map,
Module,
InterfaceType
};
inline bool isTypeBuiltin(const TypeInfo &type)
{
return builtinTypes.contains(type);
}
}; // namespace ValueType
}; // namespace Fig