Closed GoogleCodeExporter closed 9 years ago
Original comment by inkytonik
on 22 Jan 2013 at 10:15
The "line (repl)" method is now part of the pretty-printer API so the
replacement string can be customised (rf9d6a7847f1d).
We could go further and allow an arbitrary document to specify the replacement.
For now we stick to strings since that is easy to implement and covers the
obvious use cases.
We can revisit the arbitrary document case in the future if we can find use
cases where this is needed. Presumably we would have to recursively
pretty-print the replacement document on a single line to get the replacement
string. Allowing newlines in the replacement seems wrong since we are replacing
a line break. The main question is whether this additional implementation
complexity is worth it.
Original comment by inkytonik
on 16 Feb 2013 at 11:56
Original issue reported on code.google.com by
inkytonik
on 22 Jan 2013 at 10:15