chore(comments): Test 仓注释英文化(R11)

把 81 个 .vp 文件的中文 # 注释与三引号文档串改写为简洁英文,每个连续注释块 <=2 行;运行时中文字符串字面量(testcheck.begin/print 等用户可见消息)保持原样。骨架比对 HEAD 与工作区 112 文件漂移 0,全量 77/77 顺序回归通过。
This commit is contained in:
TermiNexus committed 2026-10-05 22:43:38 +08:00
1 parent aa5a7e7250
commit ee6461be46
81 files changed
+1231 -1925

No files matched your search

+8 -14
View File
@@ -3,33 +3,27 @@ import stdio
import testcheck
# ============================================================
# Extern2Test - ExternalDecl/StateDecl 重定义错误最小化复现
#
# 在 TransPyV Test 的 deco_test.py 中,这三个声明在生成的 .ll 中
# 被声明两次(line 56-60 和 62-66),导致 llc 报错:
# llc.exe: error: invalid redefinition of function 'ExternalDecl'
# 本测试只含这三个声明 + main,避免 TransPyV 大量依赖冲击上下文。
# ============================================================
# Extern2Test - minimal repro: ExternalDecl/StateDecl redefinition
# Three declarations plus main; each must emit exactly one declare.
# Test 1: t.CExtern | t.CExport - 外部声明函数(pass 体)
# 声明一个外部函数,翻译器应生成 declare 而非 define
# Test 1: t.CExtern | t.CExport - external declaration (pass body)
# Translator must emit declare, not define.
def ExternalDecl(x: int) -> int | t.CExtern | t.CExport: pass
# Test 2: t.State - 状态声明(等价于 CExtern | CExport)
# Test 2: t.State - state declaration (same as CExtern | CExport)
def StateDecl(x: int) -> int | t.State: pass
# Test 3: t.State 返回 void
# Test 3: t.State returning void
def StateVoidDecl() -> t.State: pass
def test_extern_decl():
"""验证三个 extern 声明只生成一次 declare,不重复"""
"""Verify the three extern declarations emit declare only once."""
testcheck.section("Extern/State declarations (no duplicate)")
# 外部声明函数,不调用(应由链接器解析符号)
# External declarations are not called; the linker resolves the symbols.
testcheck.check(True, "ExternalDecl declared (not called)", "expect declared once")
testcheck.check(True, "StateDecl declared (not called)", "expect declared once")
testcheck.check(True, "StateVoidDecl declared (not called)", "expect declared once")