forked from M-Labs/artiq
transform/inline: fix subscript handling
This commit is contained in:
parent
8aa69cb959
commit
0ad2b4d09b
|
@ -96,7 +96,7 @@ class _ReferenceManager:
|
||||||
evd.update(inspect.getmodule(obj).__dict__)
|
evd.update(inspect.getmodule(obj).__dict__)
|
||||||
return eval_ast(ref, evd)
|
return eval_ast(ref, evd)
|
||||||
else:
|
else:
|
||||||
raise KeyError
|
raise KeyError(ast.dump(ref))
|
||||||
|
|
||||||
def set(self, obj, funcname, name, value):
|
def set(self, obj, funcname, name, value):
|
||||||
self.to_inlined[(id(obj), funcname, name)] = value
|
self.to_inlined[(id(obj), funcname, name)] = value
|
||||||
|
@ -147,7 +147,6 @@ class _ReferenceReplacer(ast.NodeTransformer):
|
||||||
|
|
||||||
visit_Name = visit_ref
|
visit_Name = visit_ref
|
||||||
visit_Attribute = visit_ref
|
visit_Attribute = visit_ref
|
||||||
visit_Subscript = visit_ref
|
|
||||||
|
|
||||||
def visit_Call(self, node):
|
def visit_Call(self, node):
|
||||||
func = self.rm.get(self.obj, self.funcname, node.func)
|
func = self.rm.get(self.obj, self.funcname, node.func)
|
||||||
|
|
Loading…
Reference in New Issue