refactor(tpv): 变量/字段注解类名读取统一走 Spec.SourceName 封装
- VarGenMixin 新增 var_annot_class_name(SourceName 优先,回退 AnnotClassName) - 变量侧类名恢复与诊断读取切读:ExprGenAttr(5) / ExprGenOps(6) / ExprGenName(1) / CallGenDispatch(3) / CallGenCall / CallGenProp / CallGenVt / ExprGenCls / AssignGenMixin / MatchGenMixin - ExprGenAttr 字段侧直读改走 get_field_annot_class_name
This commit is contained in:
1 parent
8aad248c25
commit
95133d8483
11 files changed
+63
-38
No files matched your search
@@ -2383,7 +2383,7 @@ class AssignGenMixin:
|
||||
trans.SymTab, nm.id)
|
||||
if ve is None:
|
||||
return None
|
||||
return ve.AnnotClassName
|
||||
return self.Gen.VarGen.var_annot_class_name(ve)
|
||||
# BinOp/UnaryOp: 运算符重载返回同类对象
|
||||
if k == ast.ASTKind.BinOp:
|
||||
bop: ast.BinOp | t.CPtr = (ast.BinOp | t.CPtr)(node)
|
||||
|
||||
Reference in new issue
Block a user