feat: 实现最小 BigInt 子集(字面量/算术/比较/构造器,Temporal 前置)

This commit is contained in:
2026-08-10 23:02:31 +08:00
parent 9e26a13655
commit 078688070d
22 changed files with 706 additions and 32 deletions
+3
View File
@@ -242,6 +242,7 @@ impl ParamSpec<'_> {
enum ConstantKey {
Number(u64),
Int(i32),
BigInt(i128),
String(String),
Boolean(bool),
Null,
@@ -642,6 +643,7 @@ impl ConstantKey {
match value {
Constant::Number(v) => Some(Self::Number(v.to_bits())),
Constant::Int(v) => Some(Self::Int(*v)),
Constant::BigInt(v) => Some(Self::BigInt(*v)),
Constant::String(v) => Some(Self::String(v.clone())),
Constant::Boolean(v) => Some(Self::Boolean(*v)),
Constant::Null => Some(Self::Null),
@@ -1255,6 +1257,7 @@ impl Emitter {
pub(crate) fn emit_expression(&self, expr: &Expression, ctx: &mut CompileCtx) -> Result<u32, String> {
match expr {
Expression::NumericLiteral(_)
| Expression::BigIntLiteral(_)
| Expression::StringLiteral(_)
| Expression::BooleanLiteral(_)
| Expression::NullLiteral(_)