1.1 --- a/common.py Fri Nov 11 00:03:05 2016 +0100
1.2 +++ b/common.py Fri Nov 11 00:05:34 2016 +0100
1.3 @@ -510,6 +510,26 @@
1.4 )
1.5 return self.process_structure_node(invocation)
1.6
1.7 + def process_print_node(self, n):
1.8 +
1.9 + """
1.10 + Process the given print node 'n' as an invocation on a stream of the
1.11 + form...
1.12 +
1.13 + $print(dest, args, nl)
1.14 +
1.15 + The special function name will be translated elsewhere.
1.16 + """
1.17 +
1.18 + nl = isinstance(n, compiler.ast.Printnl)
1.19 + invocation = compiler.ast.CallFunc(
1.20 + compiler.ast.Name("$print"),
1.21 + [n.dest or compiler.ast.Name("None"),
1.22 + compiler.ast.List(list(n.nodes)),
1.23 + nl and compiler.ast.Name("True") or compiler.ast.Name("false")]
1.24 + )
1.25 + return self.process_structure_node(invocation)
1.26 +
1.27 def process_slice_node(self, n, expr=None):
1.28
1.29 """