bjpop / language-python

A parser for Python 2.x and 3.x written in Haskell
157 stars 46 forks source link

pretty printer forces very long lines #3

Closed sebfisch closed 10 years ago

sebfisch commented 13 years ago

The Pretty instances for the AST allow few newlines, especially in expressions. Why not use sep instead of hsep in the definition of commaList?

(edited to include links for identifiers)

bjpop commented 10 years ago

I'm not sure what to do with this issue.

Inserting newlines into the pretty printed output of Python is tricky. The suggested change to commaList probably won't work, because you can't always put a newline inside a comma separated list of things.

Without a test case it is hard to know what to do. So I will close this issue. Feel free to reopen if you have a particular test case in mind.

mignon-p commented 7 years ago

The place where I'm running into this problem is with keyword arguments, such as:

kicad_mod.append(Text(type="reference", text="REF**", at=[0.0, 12.5], rotation=0.0, layer="F.SilkS", size=[1.0, 1.0], thickness=0.15, hide=False))