From: Stefan Behnel Date: Sat, 19 Jul 2008 08:48:58 +0000 (+0200) Subject: code writer support for cascaded assignment nodes and string nodes X-Git-Tag: 0.9.8.1~119 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f10294d7502da37f9aae37a26addef9b0172ab34;p=cython.git code writer support for cascaded assignment nodes and string nodes --- diff --git a/Cython/CodeWriter.py b/Cython/CodeWriter.py index 7d995b08..dca1f6a7 100644 --- a/Cython/CodeWriter.py +++ b/Cython/CodeWriter.py @@ -123,12 +123,26 @@ class CodeWriter(TreeVisitor): self.visit(node.rhs) self.endline() + def visit_CascadedAssignmentNode(self, node): + self.startline() + for lhs in node.lhs_list: + self.visit(lhs) + self.put(u" = ") + self.visit(node.rhs) + self.endline() + def visit_NameNode(self, node): self.putname(node.name) def visit_IntNode(self, node): self.put(node.value) - + + def visit_StringNode(self, node): + value = node.value + if value.encoding is not None: + value = value.encode(value.encoding) + self.put(repr(value)) + def visit_IfStatNode(self, node): # The IfClauseNode is handled directly without a seperate match # for clariy.