Skip to content

Commit

Permalink
pp_ast() can now properly print custom ASTs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bl0b committed Jan 9, 2012
1 parent bf7322d commit dda792f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jupyLR/__init__.py
Expand Up @@ -12,7 +12,9 @@ def pp_ast(ast, indent='', is_last=True):
else:
prefix = '+- '
follow = '| '
if type(ast[1]) == tuple:
if type(ast) is not tuple:
print ''.join((indent, prefix, str(ast)))
elif len(ast) and type(ast[1]) is not str: # be it a tuple or anything
print ''.join((indent, prefix, ast[0]))
subi = indent + follow
for x in ast[1:-1]:
Expand Down

0 comments on commit dda792f

Please sign in to comment.