Skip to content

Commit

Permalink
21
Browse files Browse the repository at this point in the history
  • Loading branch information
srepmub committed Jul 26, 2024
1 parent 87e0849 commit 953f4a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shedskin/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 367,7 @@ def declare_defs(self, vars: List[Tuple[str, 'python.Variable']], declare: bool)
return "".join(self.group_declarations(pairs))

def get_constant(self, node:ast.Constant) -> Optional[str]:
parent = infer.inode(self.gx, node).parent
parent: Union['python.Function', 'python.Class', None] = infer.inode(self.gx, node).parent
while isinstance(parent, python.Function) and parent.listcomp: # XXX
parent = parent.parent
if isinstance(parent, python.Function) and (
Expand Down Expand Up @@ -423,6 423,7 @@ def module_hpp(self, node: ast.Module) -> None:
if isinstance(child, ast.FunctionDef):
func = self.mv.funcs[child.name]
if self.inhcpa(func):
assert func.node
self.visit_FunctionDef(func.node, declare=True)
self.print()

Expand Down
2 changes: 2 additions & 0 deletions shedskin/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 2267,8 @@ def visit_Name(self, node:ast.Name, func:Optional['python.Function']=None) -> No
self.instance(node, python.def_class(self.gx, "bool_"), func)
return

var: Optional['python.Variable']

if isinstance(func, python.Function) and node.id in func.globals:
var = infer.default_var(self.gx, node.id, None, mv=getmv())
else:
Expand Down

0 comments on commit 953f4a2

Please sign in to comment.