changeset 182:4011495cad44

pretty_print: added litteral lists
author Sigurd Meldgaard <stm@daimi.au.dk>
date Wed, 16 Dec 2009 14:28:22 +0100
parents 9b4cd7d86f1b
children ed8996462be5
files pysmcl/pretty_print.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pysmcl/pretty_print.py	Wed Dec 16 12:53:09 2009 +0100
+++ b/pysmcl/pretty_print.py	Wed Dec 16 14:28:22 2009 +0100
@@ -210,6 +210,9 @@
     elif(isinstance(exp, ast.Tuple)):
         my_precedence = 25
         r = "("+", ".join(["%s" % (expr_string(i)) for i in exp.elts])+")"
+    elif(isinstance(exp, ast.List)):
+        my_precedence = 25
+        r = "["+", ".join(["%s" % (expr_string(i)) for i in exp.elts])+"]"
     # | Name(identifier id, expr_context ctx)
     elif(isinstance(exp, ast.Name)):
         my_precedence = 1
@@ -234,7 +237,6 @@
 #             -- the following expression can appear in assignment context
 #             | Subscript(expr value, slice slice, expr_context ctx)
 #             | Name(identifier id, expr_context ctx)
-#             | List(expr* elts, expr_context ctx)
 #             | Tuple(expr* elts, expr_context ctx)
 #
 #              attributes (int lineno, int col_offset)