Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit 36f9bdd

Browse files
committed
新增静态成员结构体,增强类的静态字段管理功能,为面向对象编程提供更强大的支持。
1 parent 769316e commit 36f9bdd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/interpreter/value.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ pub struct ObjectInstance {
2121
pub fields: HashMap<String, Value>,
2222
}
2323

24+
// 静态成员存储
25+
#[derive(Debug, Clone)]
26+
pub struct StaticMembers {
27+
pub static_fields: HashMap<String, Value>,
28+
}
29+
2430
impl Value {
2531
// 将Value转换为String,用于传递给库函数
2632
pub fn to_string(&self) -> String {

0 commit comments

Comments
 (0)