Commit c1902976 authored by Stefan Behnel's avatar Stefan Behnel

code cleanup

parent 91bce96e
...@@ -1272,7 +1272,7 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -1272,7 +1272,7 @@ class TransformBuiltinMethods(EnvTransform):
# locals builtin # locals builtin
if isinstance(node.function, ExprNodes.NameNode): if isinstance(node.function, ExprNodes.NameNode):
if node.function.name == 'locals': if node.function.name == 'locals':
lenv = self.env_stack[-1] lenv = self.current_env()
entry = lenv.lookup_here('locals') entry = lenv.lookup_here('locals')
if entry: if entry:
# not the builtin 'locals' # not the builtin 'locals'
...@@ -1298,7 +1298,7 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -1298,7 +1298,7 @@ class TransformBuiltinMethods(EnvTransform):
if len(node.args) != 2: if len(node.args) != 2:
error(node.function.pos, u"cast() takes exactly two arguments") error(node.function.pos, u"cast() takes exactly two arguments")
else: else:
type = node.args[0].analyse_as_type(self.env_stack[-1]) type = node.args[0].analyse_as_type(self.current_env())
if type: if type:
node = TypecastNode(node.function.pos, type=type, operand=node.args[1]) node = TypecastNode(node.function.pos, type=type, operand=node.args[1])
else: else:
...@@ -1307,7 +1307,7 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -1307,7 +1307,7 @@ class TransformBuiltinMethods(EnvTransform):
if len(node.args) != 1: if len(node.args) != 1:
error(node.function.pos, u"sizeof() takes exactly one argument") error(node.function.pos, u"sizeof() takes exactly one argument")
else: else:
type = node.args[0].analyse_as_type(self.env_stack[-1]) type = node.args[0].analyse_as_type(self.current_env())
if type: if type:
node = SizeofTypeNode(node.function.pos, arg_type=type) node = SizeofTypeNode(node.function.pos, arg_type=type)
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment