TermiNexus
ba6beb439c
feat(compiler): __sizeof__ 支持实例接收者与泛型类引用(self/obj 实际类型 + Stack[T] 特化)
2026-08-08 12:26:44 +08:00
TermiNexus
51d0ef2c18
fix(compiler): __sizeof__ fast-fail 改为 Python traceback 风格
...
- __sizeof__ 处理器两个错误分支(已注册但大小 0 / 类型未注册)从 VLogger.critical(╠ 树形格式)改为 HandlesType.fatal_error(TypeError + File/line + 源码行 + 立即终止)
- 修复: 原 CRITICAL 不退出,会继续走到 _fail_method_ret_ty 二次报错,掩盖根因
2026-08-08 12:00:39 +08:00
TermiNexus
e0303c46f6
fix(compiler): 裸类形参按引用传参 + 同名类优先本模块 + 裸名泛型构造/类型参数转换
...
- 裸类形参(方法+函数)解析为 Ptr(struct),修复 GSList[T].append 按值传参悬垂(G5 Test4 head.Value 读到垃圾)
- resolve_annotation_type 裸类名优先 find_struct_by_module 命中本模块,避免跨模块同名类(main.vp G5Node vs g5container.vp)类型混用
- translate_call 新增裸名泛型类模板构造:Box(42)→从实参推断→特化→构造(GenericTest Test4/5/10、GenericTest2 Stack/Range 等)
- 类型转换路径先 resolve_generic_type_name:类特化/泛型函数中的 T(x) 解析为 int/str/bool/double 转换
- 泛型函数翻译时设泛型上下文 T→int(TPV 泛型函数按普通 i32 函数编译,退出作用域前清除)
2026-08-08 11:54:32 +08:00
TermiNexus
ea8bb0b3a4
fix(compiler): 方法返回类型三级来源重构(移除 _infer_method_ret_ty 按名推断)
...
方法返回类型改为:当前模块函数 → text.ll define → vpi stub 返回注解缓存,全部未命中 fail-fast 终止(无白名单、无 hook 编译器)。
1. VpiReader 文本提取缓存 + 按需加载 + 动态扩容 + 无注解默认 i32
2. 类名解析修复(继承括号不入类名、模块级函数清空类名)
3. SetTempDir 提前到 Phase1(json 在 Phase1 翻译,Phase2 太晚)
4. 内置方法 __before_init__/__init__/__new__ 固定返回类型
5. 泛型归一化匹配 + _subst_template_arg 模板参数替换
6. 调试插桩 VPI_DEBUG_ENABLE 开关(默认关闭)
2026-08-08 09:43:15 +08:00
TermiNexus
a9ebb20790
"fix(compiler): vpi 返回注解缓存按需加载 + 动态扩容
...
1. _lookup_method_ret_ty_via_vpi 查缓存前按需读取
{temp_dir}/{sha1[0:2]}/{sha1}.vpi 填充缓存,覆盖模块自身翻译时
(同模块方法调用、定义在后)stub 尚未注入的场景
2. 缓存容量由固定 4096 改为 stdlib.realloc 翻倍动态扩容(上限 1M),
根治写满后条目静默丢弃导致 JsonValue._pool_alloc 等查不到"
2026-08-08 02:24:12 +08:00
TermiNexus
09833a80eb
feat: 支持 t.Callable 函数指针类型注解、赋值与间接调用(含返回类型签名缓存)
2026-08-08 01:12:40 +08:00
TermiNexus
94ae2aee52
refactor: 提取 _lookup_sha1_from_modname_raw,消除 HandlesExpr 重复的模块 SHA1 查找段
2026-08-08 00:02:39 +08:00
TermiNexus
e2bdfc1c4e
chore: 移除 DDEBUG/MATCHDBG 调试日志残留
2026-08-07 23:29:39 +08:00
TermiNexus
adff2f35c4
fix(core): print 类型感知格式化,跨模块未导入 fast-fail,报错行号防御
2026-08-07 22:36:16 +08:00
TermiNexus
89cc30c757
基本稳定
2026-08-07 19:32:46 +08:00
TermiNexus
987088fdff
'fix(core): support keyword args in method calls
...
_translate_method_call ignored cl.keywords, so keyword-style calls
like add_argument("--count", short="-c", arg_type=INT) lost all
keyword values (short_name/arg_type stayed default), breaking
Test 4. Match keywords against function params by name, fill
missing params with zero values to keep call arity consistent.'
2026-08-07 17:30:41 +08:00
TermiNexus
f7cc0f84d1
解决了_parse_type_string 节点损坏,改用字符串直接解析
2026-08-07 01:44:34 +08:00
TermiNexus
f440bda421
清理 __new__/__init__/add_argument 中的 [DBG-argparse] 运行时打印,
...
还原标准库为静默实现。
2026-08-06 21:21:41 +08:00
TermiNexus
6d3fc4569c
通过了 Memhub BuddyTest 测试
2026-08-06 19:50:46 +08:00
TermiNexus
f8436c74d2
提交新的建议忽略
2026-08-06 18:08:09 +08:00
TermiNexus
8ad500c4da
基本稳定可以编译 Test
2026-08-05 20:12:08 +08:00
TermiNexus
a3b9bdc409
修正了逻辑,使 TPV 可以编译 Test,但自举还有一段距离
2026-08-03 02:01:20 +08:00
TermiNexus
9dcf34599d
升级了仿 Python 错误堆栈提示,修复了 bool 不存在的问题,将 bool 改为 i1 而非 i8,实现了 bool 的归一化
2026-07-31 04:12:12 +08:00
TermiNexus
bfb55d68f4
取消了 i8* == i8* 实际使用 strcmp 的规则,修复了诸多 Bug
2026-07-30 21:56:19 +08:00
TermiNexus
d227bee139
将 .py 和 .pyi 后缀名改为了 .vp 和 .vpi 后缀名
2026-07-30 16:34:50 +08:00