0264408 and Claude
9f75ec68ee
doc: 更新README,反映VM-only架构
...
- 移除树遍历解释器相关描述
- 移除 --vm 命令行标志
- 更新架构图和模块表,添加 runtime/ 模块
- 更新关键设计决策
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-26 10:45:50 +08:00
0264408 and Claude
fa6ea512b3
refactor: VM-only architecture — remove tree-walking interpreter
...
Eliminate dual-engine architecture (Interpreter + Vm) in favor of
a single bytecode VM executor.
- Extract shared types (Value, FunctionProto, Closure, UpvalueObj,
Runtime trait, NativeFn) into new module
- Consolidate builtin registration in — single
used by VM, eliminates 40-line duplicate
- Delete tree-walker: exec.rs, eval.rs, interpreter.rs, env.rs, module.rs
- Change Value::Function(Rc<Function>) → Value::Function(Rc<Closure>)
eliminating the closures HashMap pointer-key hack
- Fix VM semantic gaps found during migration:
* Structural equality for Object/Array in is_equal
* CompoundAssignGlobal opcode (global compound assigns were broken)
* 9 string methods added to VM get_property
* ForInInit error on non-iterable values
- Switch run_file/run_repl to VM; remove --vm CLI flag
- Move 327 tests from interpreter/ to vm/ — all pass
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-26 10:31:32 +08:00
0264408 and Claude
abe0844816
fix: CompoundAssignUpvalue支持 + const变量赋值检查
...
- 新增 CompoundAssignUpvalue 字节码,闭包中 x+=5 不再报错
- Local/Upvalue 上的 is_const 编译期检查
- globals 改为 HashMap<String, (Value, bool)> 追踪 const,StoreGlobal 运行时拒绝
- DefineGlobal 指令新增 1 字节 mutable 标志
- 更新 README:双执行模式、for-in、require()、VM 模块说明
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-26 09:42:38 +08:00
0264408
99c9e9c9bd
feat: 新增块注释及测试
2026-06-17 17:26:37 +08:00
0264408
df9ecb4de1
fix: 优化字符串类型在不同场景的打印形式
2026-06-17 16:08:40 +08:00
0264408
e356c208a6
feat: 实现模块引入功能以及测试
2026-06-17 15:57:45 +08:00
0264408 and Claude
9428e270af
refactor: 用 Value::get/set 简化属性访问,消除直接 borrow/borrow_mut 调用
...
- Value::set 签名改为接受 &str 并返回 RuntimeError,与 evaluator 对齐
- eval_get/eval_set/eval_index_get/eval_index_set 中统一使用 get/set
- 去掉 eval_index_get 和 eval_index_set 中不再使用的 map 绑定
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-17 15:05:59 +08:00
0264408
8e49df8062
feat: 添加字符串工具函数(split, trim, substring, replace, contains, upper, lower, starts_with, ends_with)及相关测试用例
2026-06-16 19:44:54 +08:00
0264408
bf705069a5
feat: 添加对数组和对象字面量的尾随逗号支持,更新相关测试用例
2026-06-16 19:40:24 +08:00
0264408
a7bedf6fa1
refactor: 优化代码组织
2026-06-16 19:33:16 +08:00
0264408
e4272943aa
refactor: 抽离测试代码
2026-06-16 19:25:01 +08:00
0264408
fdd42fce19
feat: 添加对单引号字符串的支持,更新词法分析器和相关测试用例
2026-06-16 19:16:48 +08:00
0264408
5e431dbba4
feat: 添加对象索引访问和赋值支持,更新相关错误处理和测试用例
2026-06-16 19:14:00 +08:00
0264408
8b20580402
feat: 添加for-in循环支持,更新解析器、解释器和相关测试用例
2026-06-16 19:10:26 +08:00
0264408
75c1d230ad
feat: 添加内置函数支持(len, typeof, push, pop),更新相关错误处理和测试用例
2026-06-16 19:03:47 +08:00
0264408
18fa53cf4a
feat: 实现字符串与数字的连接操作,增强加法运算符的功能
2026-06-16 18:55:05 +08:00
0264408
db541c315b
feat: 添加三元运算符支持,更新解析器和解释器以处理条件表达式
2026-06-16 18:41:42 +08:00
0264408
c2d6c518fc
feat: 添加对const关键字的支持,允许定义不可变变量并增强相关错误处理
2026-06-16 17:24:17 +08:00
0264408 and Claude
284a29a4be
fix: 修复字符串转义、对象相等比较、除零处理
...
- 词法分析器:字符串字面量中支持 \n \t \r " \ 转义序列,未知转义序列报告错误并跳过剩余字符串
- 解释器:对象相等比较新增深度比较(键值对逐一比对)
- 解释器:除法和取模运算在除数为零时返回 RuntimeError,避免产生 inf/NaN
Co-Authored-By: Claude <noreply@anthropic.com >
2026-06-16 17:02:30 +08:00
0264408
983a7d8b34
feat: 添加标准测试
2026-06-16 16:56:17 +08:00
0264408
a76cd79be2
feat: 添加CLAUDE.md文件
2026-06-16 16:55:43 +08:00
0264408
c7e4e0dce0
feat: 更新错误处理机制,增强词法分析器和解析器的错误报告功能
2026-06-16 14:24:49 +08:00
0264408
e052226cdb
feat: 重构main函数,添加run_file和run_repl函数以支持从文件和REPL读取输入
2026-06-16 10:11:11 +08:00
0264408
d951aa93ff
feat: 优化print函数,简化参数输出逻辑
2026-06-16 09:36:41 +08:00
0264408
bd052699f5
feat: 添加取模运算符支持,更新解析器、解释器、词法分析器和相关示例以处理相关语法
2026-06-16 09:36:32 +08:00
0264408
259dcf1af9
feat: 更新赋值运算符示例,添加数组和对象操作的打印输出
2026-06-16 08:58:04 +08:00
0264408
a40c8d1e9e
feat: 添加赋值运算符支持,更新解析器、解释器和词法分析器以处理相关语法
2026-06-16 08:55:21 +08:00
0264408
ae3060708d
feat: 添加break和continue语句的支持,更新解析器、解释器和词法分析器以处理相关语法
2026-06-10 17:37:12 +08:00
0264408
dd3f18da6f
feat: 添加数组字面量和索引访问功能,更新解析器和解释器以支持数组操作
2026-04-28 10:14:13 +08:00
0264408
5dc55c3476
feat: 实现for循环语句的解析和执行逻辑,更新词法分析器以支持for关键字
2026-02-11 09:39:06 +08:00
0264408
0e0077d96b
feat: 改进Value对象的显示格式,增加键值对输出
2026-02-11 09:02:52 +08:00
0264408
e9fbb92b15
feat: 更新README
2026-02-10 17:30:44 +08:00
0264408
521c7006d9
feat: 新增对象字面量和属性访问表达式
2026-02-10 17:13:40 +08:00
0264408
5c5ca8600a
feat: 新增内置函数input
2026-02-06 11:46:27 +08:00
0264408
f86300f3ce
Initialize Aster project with basic structure, including Cargo configuration, lexer, parser, interpreter, and AST definitions. Add a sample script and README documentation. Implement basic error handling and environment management for variable storage.
2026-02-04 16:42:51 +08:00