diff --git a/includes/ast/parser.vp b/includes/ast/parser.vp index 7a55d99..93bb137 100644 --- a/includes/ast/parser.vp +++ b/includes/ast/parser.vp @@ -1038,6 +1038,9 @@ def _parse_atom(ps: Parser | t.CPtr) -> AST | t.CPtr: if _match_op(ps, TokOp.LBrace): return _parse_brace(ps) + stdio.printf("[DBG-atom-fail] line=%d col=%d type=%d str='%s' op_id=%d\n", + _cur_lineno(ps), _cur_col(ps), _cur_type(ps), + _cur_str(ps) if _cur_str(ps) is not None else "(null)", _cur_op(ps)) ps.error_count += 1 return None @@ -1576,7 +1579,7 @@ def _parse_type_ann(ps: Parser | t.CPtr) -> AST | t.CPtr: ptr_level: t.CInt = 0 # 回收垃圾节点(_parse_test 对后缀 * / ** 的消费产物) if base.kind() == ASTKind.BinOp: - gb: ast.BinOp | t.CPtr = (ast.BinOp | t.CPtr)(base) + gb: BinOp | t.CPtr = (BinOp | t.CPtr)(base) if gb.op == OpKind.Mult and gb.right is None: ptr_level += 1 base = gb.left @@ -1585,7 +1588,7 @@ def _parse_type_ann(ps: Parser | t.CPtr) -> AST | t.CPtr: ptr_level += 2 base = gb.left elif gb.right.kind() == ASTKind.UnaryOp: - gu: ast.UnaryOp | t.CPtr = (ast.UnaryOp | t.CPtr)(gb.right) + gu: UnaryOp | t.CPtr = (UnaryOp | t.CPtr)(gb.right) if gu.op == OpKind.Deref and gu.operand is None: ptr_level += 3 base = gb.left diff --git a/lib/core/Handles/HandlesExprCall.py b/lib/core/Handles/HandlesExprCall.py index 068a7fd..02c0b21 100644 --- a/lib/core/Handles/HandlesExprCall.py +++ b/lib/core/Handles/HandlesExprCall.py @@ -2787,7 +2787,7 @@ class ExprCallHandle(BaseHandle): ModuleName = Node.func.value.id imported = getattr(self.Trans, '_ImportedModules', set()) actual_module = self.Trans.SymbolTable.resolve_alias(ModuleName) - if ModuleName in imported or actual_module in imported: + if (ModuleName in imported or actual_module in imported) and ModuleName not in Gen.var_struct_class: mangled_name = Gen._mangle_func_name(MethodName, actual_module) if Gen._has_function(mangled_name): CallArgs = []