From f10294d7502da37f9aae37a26addef9b0172ab34 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 19 Jul 2008 10:48:58 +0200 Subject: [PATCH] code writer support for cascaded assignment nodes and string nodes --- Cython/CodeWriter.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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. -- 2.26.2