From 3fe985648e88623a96a3b06342de8314759a4d06 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sat, 15 Aug 2026 06:24:22 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=20TODO/toast=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC/=E6=B5=8B=E8=AF=95=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO 补编译器实验方向;toast 通知改 list 泛型方法修复完成;DecoratorTest 补 global _call_count 声明;LLvmLiteTest ConstFloat 断言改十六进制位模式。 --- TODO | 10 +++++++++- Test/DecoratorTest/App/main.vp | 1 + Test/LLvmLiteTest/App/main.vp | 9 +++++---- _toast_gen.py | 4 ++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/TODO b/TODO index e436284..9abb85d 100644 --- a/TODO +++ b/TODO @@ -45,4 +45,12 @@ TPV 虚类判断问题,参见 ast/parser.vp:2037行 替换式实现注入猴子,带有含函数指针检测和函数指针还原 高级 define(时间戳,版本,config项) -更多新关键字 \ No newline at end of file +更多新关键字 +编译期表达式计算 +结构子(反射型 runtime lookup 鸭子(看起来像跑起来像,就是鸭子,愿意)) +函数前后父子构造钩子 +元对象协议 MOP 的编译期版本 +多分派实验 + + + diff --git a/Test/DecoratorTest/App/main.vp b/Test/DecoratorTest/App/main.vp index 97553c5..cd5d4c4 100644 --- a/Test/DecoratorTest/App/main.vp +++ b/Test/DecoratorTest/App/main.vp @@ -283,6 +283,7 @@ def main() -> t.CInt | t.CExport: # 测试 10:递归装饰保护 — @count_calls testcheck.section("Test 10: recursive decoration protection") + global _call_count _call_count = 0 r10: t.CInt = factorial(5) printf("factorial(5) = %d (should be 120)\n", r10) diff --git a/Test/LLvmLiteTest/App/main.vp b/Test/LLvmLiteTest/App/main.vp index f9ba474..ae3d5f0 100644 --- a/Test/LLvmLiteTest/App/main.vp +++ b/Test/LLvmLiteTest/App/main.vp @@ -445,16 +445,17 @@ def test_float_types(pool: memhub.MemPool | t.CPtr): "FP128 -> fp128", "FP128 fail") - # ConstFloat(3.14) -> "double 3.140000e+00" + # ConstFloat(3.14) -> "double 0x40091EB851EB851F" + # (LLVM IR 浮点常量规范为十六进制位模式,非科学计数法;位模式无精度损失) val_pi: llvmlite.Value | t.CPtr = mcore.ConstFloat(ty_double, 3.14) buf[0] = 0 mcore.PrintValue(buf, 128, val_pi) testcheck.check(string.strstr(buf, "double") is not None, "ConstFloat has 'double'", "ConstFloat missing type") - testcheck.check(string.strstr(buf, "e+") is not None or string.strstr(buf, "e-") is not None, - "ConstFloat has scientific notation", - "ConstFloat missing sci notation") + testcheck.check(string.strstr(buf, "0x") is not None, + "ConstFloat has hex bit pattern", + "ConstFloat missing hex pattern") # ============================================================ diff --git a/_toast_gen.py b/_toast_gen.py index d8e4ed5..110069c 100644 --- a/_toast_gen.py +++ b/_toast_gen.py @@ -6,8 +6,8 @@ ps = ( "Add-Type -AssemblyName System.Runtime.WindowsRuntime\n" "[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null\n" "[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null\n" - "$t = 'GenericOopTest 测试源修复'\n" - "$b = 'TPV 设计遵循找不到 fast-fail,不支持 __init__ 未注解 self 成员推断;GenericOopTest 4 个泛型类缺字段注解(a/first/second/val/value/flag),已补齐(a: T 等),重跑测试即可'\n" + "$t = 'list 泛型方法调用修复完成'\n" + "$b = 'obj.method 检测将 list[AST|CPtr] 特化 struct 误当普通结构体走 _translate_method_call 查 append 返回类型失败;新增 _is_list_builtin_method 跳过,落到 list 内置分支' \n" "$xml = [Windows.Data.Xml.Dom.XmlDocument]::new()\n" "$xml.LoadXml('' + $t + '' + $b + '')\n" "$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)\n"