chore: 更新 TODO/toast 脚本/测试源
TODO 补编译器实验方向;toast 通知改 list 泛型方法修复完成;DecoratorTest 补 global _call_count 声明;LLvmLiteTest ConstFloat 断言改十六进制位模式。
This commit is contained in:
1 parent
2b074dfb48
commit
3fe985648e
4 files changed
+17
-7
No files matched your search
@@ -45,4 +45,12 @@ TPV 虚类判断问题,参见 ast/parser.vp:2037行
|
||||
|
||||
替换式实现注入猴子,带有含函数指针检测和函数指针还原
|
||||
高级 define(时间戳,版本,config项)
|
||||
更多新关键字
|
||||
更多新关键字
|
||||
编译期表达式计算
|
||||
结构子(反射型 runtime lookup 鸭子(看起来像跑起来像,就是鸭子,愿意))
|
||||
函数前后父子构造钩子
|
||||
元对象协议 MOP 的编译期版本
|
||||
多分派实验
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
# ============================================================
|
||||
|
||||
+2
-2
@@ -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('<toast><visual><binding template=\"ToastText02\"><text id=\"1\">' + $t + '</text><text id=\"2\">' + $b + '</text></binding></visual></toast>')\n"
|
||||
"$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)\n"
|
||||
|
||||
Reference in new issue
Block a user