feat(lang): 同步 cif/celif/celse、值引用注解与 assert 改译 testcheck.check

vast 双路径(Python Parser/ExprParser 与 C 扩展 vast_c.c)新增 cif-celif-celse 语句族与 &T / &temp T 参数注解解析,_parser.pyd 已同步重编。HandlesIf 改认 @CIf 标记并做编译期常量求值,含运行时变量一律 fail-fast,同时删除 c.CIf 家族(c.py)。HandlesAssert 合成 testcheck.check(cond, None, msg) 调用,非字符串字面量消息报 TypeError。FuncGen 调用点按形参模式自动取址(ref 仅接受左值,右值 fail-fast;temp 物化临时栈),SymbolUtils/TypeAnnotationResolver 提供模式识别;t.py 删除 CNeedPtr。
This commit is contained in:
TermiNexus committed 2026-10-07 19:03:29 +08:00
1 parent 64f3d79b64
commit 2514cee4c9
24 files changed
+1139 -246

No files matched your search

+3 -2
View File
@@ -378,8 +378,9 @@ class BaseGenMixin:
# 编译期 with 上下文栈:记录当前嵌套 with 链中所有可用的 provides 字段名
# 用于 __require_must__ 的纯编译期静态可达性检查
self._with_provides_stack: list[list[str]] = []
# 函数参数自动取地址模式: func_name -> [None, None, 'need', 'always', ...]
# 'need': t.CNeedPtr — 仅对非指针值取地址
# 函数参数自动取地址模式: func_name -> [None, None, 'ref', 'temp', 'always', ...]
# 'ref': &T — 实参非指针左值取址,右值 fail-fast
# 'temp': &temp T — 实参非指针时在调用方建同型临时再取址
# 'always': t.CAutoPtr — 无条件取地址
self._auto_addr_params: dict[str, list[str | None]] = {}
self.global_struct_class: dict[str, str] = {}