# locals builtin
if isinstance(node.function, ExprNodes.NameNode):
if node.function.name == 'locals':
- lenv = self.env_stack[-1]
+ lenv = self.current_env()
entry = lenv.lookup_here('locals')
if entry:
# not the builtin 'locals'
if len(node.args) != 2:
error(node.function.pos, u"cast() takes exactly two arguments")
else:
- type = node.args[0].analyse_as_type(self.env_stack[-1])
+ type = node.args[0].analyse_as_type(self.current_env())
if type:
node = TypecastNode(node.function.pos, type=type, operand=node.args[1])
else:
if len(node.args) != 1:
error(node.function.pos, u"sizeof() takes exactly one argument")
else:
- type = node.args[0].analyse_as_type(self.env_stack[-1])
+ type = node.args[0].analyse_as_type(self.current_env())
if type:
node = SizeofTypeNode(node.function.pos, arg_type=type)
else: