把 81 个 .vp 文件的中文 # 注释与三引号文档串改写为简洁英文,每个连续注释块 <=2 行;运行时中文字符串字面量(testcheck.begin/print 等用户可见消息)保持原样。骨架比对 HEAD 与工作区 112 文件漂移 0,全量 77/77 顺序回归通过。
42 lines
718 B
Plaintext
42 lines
718 B
Plaintext
import t
|
|
from t import CInt
|
|
|
|
|
|
# ============================================================
|
|
# Cross-module isinstance test library: classes defined here are imported by
|
|
# main.vp to verify vtable comparison resolves across object files.
|
|
# ============================================================
|
|
|
|
|
|
@t.CVTable
|
|
class Shape:
|
|
def area(self) -> CInt:
|
|
return 0
|
|
|
|
|
|
@t.CVTable
|
|
class Circle(Shape):
|
|
r: CInt
|
|
|
|
def __init__(self, r: CInt):
|
|
self.r = r
|
|
|
|
def area(self) -> CInt:
|
|
return self.r
|
|
|
|
|
|
@t.CVTable
|
|
class Square(Shape):
|
|
s: CInt
|
|
|
|
def __init__(self, s: CInt):
|
|
self.s = s
|
|
|
|
def area(self) -> CInt:
|
|
return self.s
|
|
|
|
|
|
@t.NoVTable
|
|
class PlainShape:
|
|
tag: CInt
|