py2llvm/ast_body: support getattr

This commit is contained in:
Sebastien Bourdeauducq 2014-09-07 15:24:19 +08:00
parent c5c38c6376
commit e2d834928f
1 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,10 @@ class Visitor:
else:
raise NameError("Function '{}' is not defined".format(fn))
def _visit_expr_Attribute(self, node):
value = self.visit_expression(node.value)
return value.o_getattr(node.attr, self.builder)
def visit_statements(self, stmts):
for node in stmts:
node_type = node.__class__.__name__